Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: POSTing XML in HTTP Request?

$
0
0
Re: POSTing XML in HTTP Request?
West Wind Internet Protocols
Re: POSTing XML in HTTP Request?
Feb. 2, 2013
10:18 am
3PG0M3I8JShow this entire thread in new window
Gratar Image based on email address
From:SteveP
To:Rick Strahl
Hi Rick,
Yes, I saw where HTTPGet is easier, and I may end up using it as I get further down the road.
I also re-looked at the lcOutputFile option and probably need to use that to capture the zip file.
It also appears that AddPostKey(lcXML) does add the XML file after the headers, essentially as body, right?

This is a new service on the vendor's webserver, so the issue may be on their end. We are in test mode.

Thanks for the feedback! Hope it's warmer where you are then Kentucky!


Steve,

This is much simpler:

lcXML = "<XML FROM WHEREEVER>" loHttp = CREATEOBJECT("wwHttp") loHttp.nHttpPostMode = 4 loHttp.AddPostKey(lcXML) lcResult = loHttp.HttpGet(lcUrl) ? lcResult

+++ Rick ---


Hi All,
I need to submit an XML string to a vendor's website. I need to confirm I am doing this correctly.

Here's what I am doing:

1) Create Object using wwIPStuff > Success
2) Connect to server using HTTPConnect() > Success
3) Build XML String > XML Validator indicates No errors when I validate the string
4) Issue lcXML = STRCONV(lcXML, 9)
5) Set Headers to include: Content-Type: text/xml
6) Issue AddPostKey() to clear POST Buffer
7) Set nHttpPostMode = 4
8) Issue AddPostKey(lcXML)
9) Issue HTTPGetEx(lcPage,@lcResponse,@lnSize,lcHeaders) > Error 500.00 Internal Server Error

The vendor says the problem is either bad XML or invalid content type header.
The vendor also says the XML String should be posted as body of http request.

Question: Does AddPostKey(lcXML) place the XML string into the body of the http request?
If not, how would I place the XML string into the body of the http request?

Finally, once I get this working correctly, the vendor will send a zipped file in the response. The file size will be approximately 6Meg. Am I using the correct approach with HTTPGetEx shown above? Ultimately, I need to save the zipped file to disk for further processing.

Thanks!




TIA,
Steve


Viewing all articles
Browse latest Browse all 10393

Trending Articles