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:58 am
3PG0NJ82TShow this entire thread in new window
Gratar Image based on email address
From:SteveP
To:Rick Strahl
Is there any way to see exactly what is being sent by HTTPGetEx()?
Do I need Fiddler for this?



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