Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Call a .Net Web Service Method from Classic ASP Using SOAP
    primarykey
    data
    text
    <p>I am trying to call a .Net Web Service from Classic ASP using SOAP. I have built the following code as a test and keep getting back an empty reponsebody with a 400 Bad Request error. Am I doing something wrong or might this issue be on the .Net side?</p> <pre><code>'set up xmlhttp to checkout server Dim oRequest Set oRequest = Server.CreateObject("MSXML2.ServerXMLHTTP") 'setting this option will allow ServerXMLHTTP to ignore the certificate errors it encounters. oRequest.setOption(2) = SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS ' resolve, connect, send, receive - in milliseconds oRequest.setTimeouts 10000, 10000, 10000, 10000 'set the URL msURL = "[redacted]" msSOAP = "&lt;?xml version=""1.0"" encoding=""utf-8"" ?&gt;" msSOAP = msSOAP &amp; "&lt;soap12:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope""&gt;" msSOAP = msSOAP &amp; "&lt;SOAP:Body&gt;" msSOAP = msSOAP &amp; "&lt;[Some Service] xmlns=""http://localhost""&gt;" msSOAP = msSOAP &amp; "&lt;MethodName&gt;" msSOAP = msSOAP &amp; "&lt;methodParam1&gt;[some value]&lt;/methodParam1&gt;" msSOAP = msSOAP &amp; "&lt;methodParam2&gt;[some value]&lt;/methodParam2&gt;" msSOAP = msSOAP &amp; "&lt;methodParam3&gt;[some value]&lt;/methodParam3&gt;" msSOAP = msSOAP &amp; "&lt;/MethodName&gt;" msSOAP = msSOAP &amp; "&lt;/[Some Service]&gt;" msSOAP = msSOAP &amp; "&lt;/SOAP:Body&gt;" msSOAP = msSOAP &amp; "&lt;/soap12:Envelope&gt;" oRequest.Open "POST", msURL, False oRequest.setRequestHeader "Content-Type", "text/xml" oRequest.setRequestHeader "SOAPMethodName", "[MethodName]" oRequest.setRequestHeader "SOAPAction", "[Some Url]" oRequest.send msSOAP Response.Write oRequest.ResponseBody </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload