How to call SOAP WS from Javascript/jQuery

前端 未结 3 1343
予麋鹿
予麋鹿 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:40

    below code is working fine. may be it may help you.

        var SoaMessage = ''
                    + ''
                      + ''
                        + ' '
                         + ' ADBC'
                      + ''
                     + ''
                 + '';
        var url = "http://XXXXXXX/XXX/XXXXX?wsdl";
        $.support.cors = true;
        $.ajax({
            type: "POST",
            url: url,
            jsonpCallback: "MyCallbackDED",
            dataType: "xml",
            processData: false,
            contentType: "text/xml; charset=\"utf-8\"",
            success: function (msg) {
                alert("suc: " + msg.tradeLicenseData.master[0].arabicAddress + ": " + msg.tradeLicenseData.master[0].arabicAddress);
    
            },
            error: function (msg) {
                alert("Failed: " + msg.status + ": " + msg.statusText);
            }
    
        });
    

提交回复
热议问题