views:

199

answers:

1

Hi, I am sending an XML content via HTTP Post from Access VBA to Web Methods, using XMLHTTP object in MSXML. Here is the Code.

Dim objXmlHttp As Object
Set objXmlHttp = CreateObject("MSXML2.ServerXMLHTTP")
objXmlHttp.Open "POST", webServicePath, False
objXmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

Dim Response As String
objXmlHttp.send wrt.output

'OK status
If objXmlHttp.Status = 200 Then
    Response = objXmlHttp.responseText
End If
Set objXmlHttp = Nothing

I am getting the XML with "&lt" and "&gt" instead of < and >. If I try to do URL encoding, everything is received as ASCII text in the Recipient side. Can you please guide what I need to do to get the valid XML format.

+2  A: 

You need to set the content-type correctly, try this instead:

objXmlHttp.setRequestHeader "Content-Type", "text/xml; charset=""utf-8"""
Andrew Hare
When I include this content type, I am not getting the XML content in the Reveiving end.
Seshan