How to call SOAP WS from Javascript/jQuery

前端 未结 3 1346
予麋鹿
予麋鹿 2021-02-01 22:10

I would like to call a SOAP WebService directly from Javascript. I have been looking all around but still is unable to have something working. I assumed that i must build the SO

3条回答
  •  失恋的感觉
    2021-02-01 22:44

    How about this? https://github.com/doedje/jquery.soap

    Seems easy enough. Maybe it will help you.

    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!
        
      
    
    

提交回复
热议问题