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 147 forks source link

Error - Ouput format and Request #6

Closed julienwetzel closed 11 years ago

julienwetzel commented 11 years ago

Hey Guy, I don't speak good English ^^ Sorry

In the README you write output format for the last version:

`<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:myns="urn://service.my.server.com">

Remy Blom Hi! ` but really is this: ` Remy Blom Hi! ` My web services connect is not recognize parameter with myns:name... It is 'name' only. I have change the variable prefix in the jquery.soap.js to: var prefix = ""; I have tested send request with the SOAPUI and it is correct. Now, I have 2 possibility for the message format: XML and SOAP with different link. But it's not work. Firebug console return me this: `status: string 'error' a:object isXMLDoc(a):false a.responseText:string isXMLDoc(a.responseText):false a.responseXML:undefined isXMLDoc(a.responseXML):false c:string isXMLDoc(c):false c.responseText:undefined isXMLDoc(c.responseText):false c.responseXML:undefined isXMLDoc(c.responseXML):false --a-- Object { readyState=0, status=0, statusText="error"} --c-- (an empty string) { typeOf="SOAPResponse", status="error", headers=[1], more...}` In the network analysis, the response server is: `HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Allow: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS Content-Length: 0 Date: Thu, 16 May 2013 11:42:59 GMT` Do you have an idea of what does not work? Many thanks
doedje commented 11 years ago

Sorry I reply to you this late. I am really busy at the moment and therefore had not had any time to look into your problem. I am still coping with some heavy deadlines... Are you still having the problem?

julienwetzel commented 11 years ago

No problem. Yes, always

doedje commented 11 years ago

I am sorry it took me so long to respond.... I played around a bit with the plugin in trying to do what you want and I got my server to send me the right response when I did not specify the namespaceQualifier and namespaceURL...

example:

$.soap({
    url: 'http://my.server.com/soapservices/',
    method: 'helloWorld',
    params: {
        name: 'Remy Blom',
        msg: 'Hi!'
    },
    success: function (soapResponse) {
        // do stuff with soapResponse
        // if you want to have the response as JSON use soapResponse.toJSON();
        // or soapResponse.toString() to get XML string
        // or soapResponse.toXML() to get XML DOM
    },
    error: function (SOAPResponse) {
        // show error
    }
});

It then makes a soap request like so:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <helloWorld>
            <name>Remy Blom</name>
            <msg>Hi!</msg>
        </helloWorld>
    </soap:Body>
</soap:Envelope>

My server was okay with that... Hope yours will be too! Please let me know...