3

I've been googling for something to call WSDL (SOAP) based service using jQuery but I don't find anything.

Is there really a way to call them like I call REST based services?

The example URL I have is http://sub.domain.com/j/services/ivos?wsdl

Umair A.
  • 6,690
  • 20
  • 83
  • 130
  • What do you want to do with the result of this call? WSDL is just XML, so you should be able to parse it. But what do you want to do afterwards? –  Apr 05 '11 at 12:01

2 Answers2

2

if u can modify the header sent to your wsdl i guess its possible.

RoyFat
  • 44
  • 2
  • to get the results from a wsdl, u need to send a specifik header request. Example on a soap request : POST/BibleWebservice.asmx HTTP/1.1" Host: www.webservicex.net Content-Type: text/xml; charset=utf-8 http://www.webserviceX.NET/GetBookTitles. if u are able to modify the header jquery is sending to the wsdl, i guess u will get the right result back, – RoyFat Apr 05 '11 at 12:35
  • actually the Service is created via Visual Studio by some guy and I am not sure how can I utilize it. Can you post some link for me to read about SOAP based services as when I point to the ?wsdl link it has huge XML in it? – Umair A. Apr 05 '11 at 12:42
  • a soap envelope need also to be included – RoyFat Apr 05 '11 at 12:42
  • its the the required xml (function name, paramters etc) thats need to be sent to a wsdl, a wsdl does always have instructions on how the SOAP envelop should look like example: http://www.w3schools.com/soap/soap_envelope.asp, – RoyFat Apr 06 '11 at 12:05
  • Now I realized. I think the question should how to create SOAP Envelope using WSDL response XML? – Umair A. Apr 06 '11 at 18:08
0

Check out the stack overflow question Simplest SOAP example if that's what you need

Although I am unsure what you need to do ?wsdl will just send the webservice description in xml form.

The way I would tackle this would be to create a rest wrapper that takes care of the soap handling and sends json responses.

This way you can call it using $.ajax, $.getJSON, $.post etc

Community
  • 1
  • 1
James Kyburz
  • 13,775
  • 1
  • 32
  • 33
  • No the services are already written via SOAP. I just want to know the way to call them using JS. Any way you know? – Umair A. Apr 05 '11 at 12:20
  • No, I am sure there are libraries to do that, I just meant that it will probably be easier to wrap it server side. – James Kyburz Apr 05 '11 at 12:41