p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP XML (http://p2p.wrox.com/forumdisplay.php?f=69)
-   -   First SOAP Request with Classic ASP (http://p2p.wrox.com/showthread.php?t=93595)

emmals September 22nd, 2014 03:42 AM

First SOAP Request with Classic ASP
 
I am trying to integrate SOAP into a classic ASP website in VBScript, found numerous examples online and have viewed this one here consuming SOAP web services in classic ASP

The XML needs sending to a service at https://www.cartell.ie/secure/xml/findvehicle to invoke a service named XML_Cartell. The application needs to generate a http GET or Soap XML Post request identical to below. It says username and password credentials should be inserted into the HTTP header as per the http basic Authentication protocol. e.g. Authorization: Basic QWxhZGRpbjpvcGVIHNl2FtZQ==.

I am currently receiving the error msxml3.dll error '80070005' Access is denied. I am not sure if i am inserting the authorisation correctly. There is also POST and SOAPAction, not sure what the difference is ?

My current code is
Code:

<%Set oXmlHTTP = CreateObject("Microsoft.XMLHTTP")

oXmlHTTP.Open "POST", "https://www.cartell.ie/secure/xml/findvehicle", False

oXmlHTTP.setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8"
oXmlHTTP.setRequestHeader "SOAPAction", "https://www.cartell.ie/secure/xml/findvehicle"
oXmlHTTP.setRequestHeader "Authorisation", "QWxhZGRpbjpvcGVIHNl2FtZQ=="

SOAPRequest = _
  "<?xml version=""1.0"" encoding=""utf-8""?>" &_
  "<soap:Envelope xmlns:soap=""http://www.w3.org/2003/05/soap-envelope"">" &_
    "<soap:Body>" &_
      "<FindByRegistration>" &_
  "<registration>96D29782</registration>" &_
  "<servicename>XML_Cartell</servicename>" &_
"</FindByRegistration>" &_
    "</soap:Body>" &_
  "</soap:Envelope>" &_

  oXmlHTTP.send & SOAPRequest %>

<%Set xmlResp = oXmlHTTP.responseXML%>

<%    Set nodes = xmlResp.getElementsByTagName("Model") %>
<ul>
<%    For Each node in nodes    %>
  <li><%=node.text%></li>
<%    Next    %>
</ul>

The Request message posted should be like this

Code:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<FindByRegistration>
  <registration>96D29782</registration>
  <servicename>XML_Cartell</servicename>
</FindByRegistration>
</soap:Body>
</soap:Envelope>

The Response Message should be something like this.

Code:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body><FindByRegistration>
<Vehicle>
  <Registration>96d29782</Registration>
  <Make>OPEL</Make>
  <Model>OMEGA</Model>
  <Description>CD 2.0</Description>
  <BodyType>SALOON</BodyType>
  <FirstRegistrationDate>1996-05-20</FirstRegistrationDate>
  <FuelType>PETROL</FuelType>
  <EngineCapacity>1998</EngineCapacity>
  <Transmission>Manual</Transmission>
  <Power>136BHP</Power>
</Vehicle>
</FindByRegistration>
</soap:Body></soap:Envelope>



All times are GMT -4. The time now is 06:09 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.