ServerXMLHTTP Post Problem

I have an application that connects to a server using an MSXML XMLHTTP object (specifically Msxml2.ServerXMLHTTP). The script was working and then all of a sudden the values passed via the url don’t get read by the remote server. Here is a sample of the code used…

’ — instantiate an MSXML XMLHTTP object

Set objHttp = CreateObject(“Msxml2.ServerXMLHTTP”)

url = “https://www.abc.com/gateway/inbound

’ — Add appropriate parameters to the url

url = url + |?transport=“ALE (R/3 IDOC)”&Content-type=application/x-sap.idoc|

url = url + |&sender=| & doc.ClientNum(0) & |&receiver=| & doc.CompanyNum(0) & |usename=12345678&password=87654321|

’ — Open the url path

objhttp.Open “POST”, url, False

The remote server shows that a connection is made, the values dont get passed. If I was to cut and paste the URL in a browser with the correct values, it works fine. When debugging the program, the url is built correctly, but if fails to pass any values.

I’m using Microsoft MSXML Parser 3.0 SP7. I haven’t upgraded to the latest version yet.

Thanks in Advance…

Subject: ServerXMLHTTP Post Problem

Maybe your XMLHTTP is using cached results?Add “&rnd=”+cstr(timer) to the end of your URL to force unique URLs on each request and avoid caching problems.

Subject: RE: ServerXMLHTTP Post Problem

I added to the end of the URL by the same error response is generated by the remote server… missing or invalid parameter. I posted the new URL in IE and it worked with no errors. Could it be something with the way that the xmlhttp.open is encoding the URL before it sends it. There are quotes and a question mark in the URL. should they be formatted differently before calling the open command?

Thanks.

Subject: RE: ServerXMLHTTP Post Problem

I think that special characters are formatted automatically by XMLHTTP as needed… but you never know.

What I would do to debug the problem is to start a local HTTP server and see what data is sent from both IE and XMLHTTP. Then compare the results and see what is missing. I usually use NETCAT for this kind of HTTP testing.