Classic ASP - Server was unable to process request. Unable to parse the request. Please validate your SOAP XML.

414 views
Skip to first unread message

raymo...@hextronik.com

unread,
Apr 9, 2013, 12:12:57 AM4/9/13
to ca...@googlegroups.com
Hi guys

Our company are using Classic ASP for everything hence I will need to use it for implementing the API.

I was trying to call RequestAccess, which is the first step of the whole game :(, and not managed to make a successful call. Code as followed:

        dim localID
localID = XXXXXXXX
set ca = new channeladvisor

xml = ca.RequestAccess(localID)

set xmlRequest = Server.CreateObject("MSXML2.ServerXMLHTTP")

xmlRequest.setRequestHeader "Content-Type", "text/xml"
xmlRequest.setRequestHeader "Charset", "UTF-8"
xmlRequest.setRequestHeader "Content-Length", len(xml)
xmlRequest.setRequestHeader "SOAPAction", """http://api.channeladvisor.com/webservices/RequestAccess"""
xmlRequest.send xmlDoc

response.write xmlRequest.status & " "

set result = xmlRequest.responseXML

Set xmlDOM = Server.CreateObject("MSXML2.DOMDocument")
xmlDOM.async = False
xmlDOM.Load result

xpath = "//soap:Envelope"
set xml_response = xmlDOM.selectSingleNode(xpath)

if xml_response is nothing then
response.write "xml_response has no value"
else
response.write xml_response.text
end if

XML created by ca.RequestAccess:

<soapenv:Header>
<web:APICredentials>
<web:DeveloperKey>?</web:DeveloperKey>
<web:Password>?</web:Password>
</web:APICredentials>
</soapenv:Header>
<soapenv:Body>
<web:RequestAccess>
<web:localID>XXXXXXXX</web:localID>
</web:RequestAccess>
</soapenv:Body>
</soapenv:Envelope>

Thanks in advanced.

Ray

[CA] Marshall McClure

unread,
Apr 9, 2013, 12:42:21 PM4/9/13
to ChannelAdvisor Developer Network
I can't offer any help with classic ASP, but your XML certainly looks
fine to me. For reference, here is a full example as submitted from
soapUI:

POST https://api.channeladvisor.com/channeladvisorapi/v6/adminservice.asmx
HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://api.channeladvisor.com/webservices/RequestAccess"
Content-Length: 513
Host: api.channeladvisor.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:web="http://api.channeladvisor.com/webservices/">
<soapenv:Header>
<web:APICredentials>
<web:DeveloperKey>...</web:DeveloperKey>
<web:Password>...</web:Password>
</web:APICredentials>
</soapenv:Header>
<soapenv:Body>
<web:RequestAccess>
<web:localID>XXXXXXXX</web:localID>
</web:RequestAccess>
</soapenv:Body>
</soapenv:Envelope>

raymo...@hextronik.com

unread,
Apr 10, 2013, 11:54:22 PM4/10/13
to ca...@googlegroups.com
Thanks Marshall

I am still finding my way to use soapUI, 

Have no idea how it helps in regards to XML docs.

Somehow when I am not using "string" XML instead of using physical xml file, the error has gone.

Can't find out what the reason is... anyway, need to move on

Ray
Reply all
Reply to author
Forward
0 new messages