Simplest SOAP example

前端 未结 13 1664
死守一世寂寞
死守一世寂寞 2020-11-22 01:32

What is the simplest SOAP example using Javascript?

To be as useful as possible, the answer should:

  • Be functional (in other words actually work)
  • <
13条回答
  •  攒了一身酷
    2020-11-22 01:58

    Has anyone tried this? https://github.com/doedje/jquery.soap

    Seems very easy to implement.

    Example:

    $.soap({
    url: 'http://my.server.com/soapservices/',
    method: 'helloWorld',
    
    data: {
        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
    }
    });
    

    will result in

    
      
        
            Remy Blom
            Hi!
        
      
    
    

提交回复
热议问题