xsharp.eu • Post XML-file - Page 2
Page 2 of 2

Post XLM-file

Posted: Tue Jan 30, 2018 3:01 pm
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

Post XLM-file

Posted: Wed Jan 31, 2018 11:44 pm
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

Post XLM-file

Posted: Fri Feb 02, 2018 9:59 am
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   

Post XLM-file

Posted: Fri Feb 02, 2018 10:14 am
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

Post XLM-file

Posted: Fri Feb 02, 2018 11:58 am
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