Post XML-file

This forum is meant for questions and discussions about the X# language and tools
JKW

Post XLM-file

Post by JKW »

Hello Wolfgang

Thanks for the information, am going to consult the supplier.
If it works I will let you know what the problem was.

Greetings,

Johan
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Post XLM-file

Post by ic2 »

Hello Johan,

I'll doublecheck with my json code Thursday but first 2 remarks:

1 It seems you did reach the server and got a custom error from it. The receiving site should be able to tell you ore; it could easily be a ill-formatted XML file
2 I had a custom error as well and heard that I had to change the POST to a PUT. Maybe that's your problem as well.

Let me know that first, then I'll check further if required.

Dick
JKW

Post XLM-file

Post by JKW »

Hello Dick

The POST or PUT gives this same error.
"The underlying connection is closed: An unexpected error has occurred during transmission."

In VO it will work: maybe because it works with HttpOpenRequest
and not with oClient.uploaddata

I will inform the supplier of the website.

Thanks for your reply !!

Johan

VO-code

Code: Select all

if self:hConnect <> null_ptr
  self:__SetStatusObject()
  //  Once we've identified the service, we need to indicate the
  //  page to which the data will be posted. In this example, it will
  //  be "/getorpost.php"
  self:hRequest := HttpOpenRequest(self:hConnect, ;   // hConnect
       String2Psz("POST"), ;       // lpszVerb
       String2Psz(cDocument), ;    // pszObjectName
       String2Psz("HTTP/1.1"), ;   // pszVersion
       null_psz, ;                 // pszReferer
       null_psz, ;                 // pszAcceptTypes
       nFlags, ;                   // dwFlags
       self:__GetStatusContext())  // dwContext   
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Post XLM-file

Post by ic2 »

Hello Johan,
But is used to be the error "An unexpected error occurred during the shipment"

What you now see is something else. There's quite some info about this, e.g.:
https://stackoverflow.com/questions/217 ... n-a-receiv

Not sure why it works with VO. The whole idea is that .Net has much more built in to handle json or XML. I never programmed it in VO but it took a while before I got it running as well. Usually the server owner could see if we reached them and if so, what was wrong (e.g. something in the XML/formatting or the PUT instead of the POST, etc).

Dick
JKW

Post XLM-file

Post by JKW »

Hello Dick

I will consult the supplier and then see what he gets,
it can also be in a configuration issue.

Thanks for help with finding a solution !

If I succeed, I'll let you know.

Johan Kwaspen
Post Reply