doedje / jquery.soap

This script uses $.ajax to send a SOAP:Envelope. It can take XML DOM, XML string or JSON as input and the response can be returned as either XML DOM, XML string or JSON too.
352 stars 148 forks source link

Created url don't match tomcat AXIS servlet #135

Closed Gagliardelli closed 3 years ago

Gagliardelli commented 3 years ago

The code $.soap({ url: 'http://my.server.com/soapservices/', method: 'helloWorld',... produce the url to contat the webservice http://my.server.com/soapservices/helloWorld as per documentation. The axis servlet inside a Tomcat server fails saying: AXIS error No service is available at this URL because "helloWorld" is the name of a described operation inside the wsdl and must not be part of the url. While the call with url http://my.server.com/soapservices is successful and the server replies; Hi there, this is an AXIS service! In my opinion, the property 'method' should not be appended to the url. Maybe using a property named 'operation', just to comply the wsdl terminology, would help.

Gagliardelli commented 3 years ago

Browsing soap.js I found there's a global attribute appendMethodToURL that defauts to true. This attribute is not documented so I tried putting appendMethodToURL=false into my soap options like this: $.soap({ url: 'http://my.server.com/soapservices/', appendMethodToURL=false, method: 'helloWorld',... This change solved my issue. In my opinon this behaviour should be documented.

doedje commented 3 years ago

RTFM? ;)

There is a page (which resides in the directory called 'doc' and is also linked from the README.md) that describes every attribute: https://github.com/doedje/jquery.soap/blob/master/doc/options.md

Hope that helps!