4

I have a problem with this is code:

Set oXmlHTTP = CreateObject("Microsoft.XMLHTTP")
oXmlHTTP.Open "POST", "http://www.oursite.com/WebServices/ourService.asmx?WSDL", False 

oXmlHTTP.setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8" 
oXmlHTTP.setRequestHeader "SOAPAction", "http://ourNameSpace/ourFunction"

SOAPRequest = _
  "<?xml version=""1.0"" encoding=""utf-8""?>" &_
  "<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"">" &_
    "<soap12:Body>" &_
      "<ourFunction xmlns=""http://ourNameSpace/"">" &_
        "<var1>" & Session("userid") & "</var1>" &_
        "<var2>" & Session("internetid") & "</var2>" &_
      "</ourFunction>" &_
    "</soap12:Body>" &_
  "</soap12:Envelope>"

oXmlHTTP.send SOAPRequest

It executes and gives no error, but I can't find any output, or I can't parse it even if it exists - but in both cases I don't know about it.

After doing the call, how am I supposed to get the parsing of returned XML?

Tomalak
  • 332,285
  • 67
  • 532
  • 628
chsab420
  • 191
  • 2
  • 3
  • 14

2 Answers2

2

You're missing the:

Set xmlResp = oXmlHTTP.responseXML

This gives you access to an Msxml2.DOMDocument object. How you get the data from that really depends on the format of your soap response.

It should probably look something like this:

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

See also:

C. Ross
  • 31,137
  • 42
  • 147
  • 238
  • can u please tell me how can i parse also i mean i have done parsing but after assigning this i cant get anything from this. can u please elaborate further – chsab420 Jul 03 '09 at 13:39
  • @chris dear its the web service which i am going to use http://buergerserviceschul.niedersachsen.de/modules/id/public/webservice/V4_00/rpc_lit/?wsdl ur code is perfect and with no problems if i use xml return (hardcoded by me in a text file or in string) but as soon as i call the webservice live, it does not give me anything but a blank page i dont know whether its my Service or i dont know what can u please look into this as well so thanks for ur support – chsab420 Jul 06 '09 at 07:41
0

Consuming web services in classic asp

Chris Klepeis
  • 9,783
  • 16
  • 83
  • 149
  • i have tried this already but i dont know where i am doing mistake or my service is not sending me right stuff. but whatever i try fails. this is the service address http://buergerserviceschul.niedersachsen.de/modules/id/public/webservice/V4_00/rpc_lit/?wsdl – chsab420 Jul 03 '09 at 13:46