views:

252

answers:

3

hey all, first of all this is my third question about web services here and i am very thankful to guyz for helping me out, but yet something is missing which is not right here is the code which i got already from a question of mine

    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""&gt;" &_
    "<soap12:Body>" &_
      "<ourFunction xmlns=""http://ourNameSpace/""&gt;" &_
        "<var1>" & Session("userid") & "</var1>" &_
        "<var2>" & Session("internetid") & "</var2>" &_
      "</ourFunction>" &_
    "</soap12:Body>" &_
  "</soap12:Envelope>"

oXmlHTTP.send SOAPRequest

Now my web service link is

http://buergerserviceschul.niedersachsen.de/modules/id/public/webservice/V4_00/rpc_lit/?wsdl

When i give call to the web service providing all the details and all the necessary stuff, still i am not able to get any kind of input from this procedure which is frustrating. i mean i get nothing, empty responses i get, while if i use old way which i was suggested not to implement which was using soap client i.e.

Set oSOAP = Server.CreateObject("MSSOAP.SoapClient30")
oSOAP.ClientProperty("ServerHTTPRequest") = True

now this way i atleast get a session id but again i could not go further even if using this procedure, so guyz i am stuck at this problem

i need to call functions and get xml in return but i am not getting anything in return

either how i am calling the service makes it not to respond but if that would be case then it would have given error as it does if i do any mistake in code.

so kindly help me out in this regard i will be very thankful to you for this favor. thanks

+2  A: 

Don't use "?WSDL". That's only for the purpose of retrieving the WSDL.

Also, even in VBSCRIPT, do not ever build XML through string concatenation. Always use an XML API to create XML.


I recognize that many people still using Classic ASP have little choice. (*) Still, you should welcome any opportunity to not write more VBSCRIPT that someone will have to maintain (maybe even you). Instead, write a small piece of C# code to expose the web service as a COM object. You get to use the normal "Add Service Reference" technique, yet VBSCRIPT will see it as a normal COM object. I'll look to see if I can find an example.


(*) Maybe if we started calling it "crappy, stinking, ASP", Management would get rid of it more quickly? But maybe not, and then we'd be stuck with the name.

John Saunders
+1 for calling out to another library to perform the web service call.
p.campbell
A: 

as Mr. Saunders indicated, don't use the "?WSDL", instead, replace

"http://www.oursite.com/WebServices/ourService.asmx?WSDL"

with

http://www.oursite.com/WebServices/ourService.asmx

Saif Khan
A: 

Ultimately I agree with John, ditch doing this in VBScript, use a C# dll to do the work and expose a COM inteface to consume in ASP.

However some things you might look into. First off don't use Microsoft.XMLHTTP it isn't thread-safe. Use CreateObject("MSXML2.ServerXMLHTTP") instead.

To diagnose what is going wrong use Fiddler. When using SOAP start up fiddler then issue

ProxyCfg -u

on the command line. You will see the exact conversation between the servers in fiddler. If you have another example of this SOAP interface working correctly then use fiddler to examine the HTTP sessions from that.

Now switch to your new code and examine the requests being generated by that. You should be able to determine from this data what changes to the headers and the XML you need to make things work.

Remember to issue a

Proxycfg -d

before closing fiddler.

AnthonyWJones
hey guyz, i dont have asmx filei have given urlif i remove ?wsdl then it wont even run
chsab420