Jquery ajax SOAP无响应

Jquery ajax SOAP无响应,jquery,ajax,xml,soap,wsdl,Jquery,Ajax,Xml,Soap,Wsdl,我不知道到底发生了什么事。我正在尝试调用soap服务,但没有得到任何响应 function soap_call(){ var wsUrl = "https://ws.cert.transactionexpress.com/portal/merchantframework/MerchantWebServices-v1?wsdl"; var soapRequest = '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http:

我不知道到底发生了什么事。我正在尝试调用soap服务,但没有得到任何响应

function soap_call(){     
    var wsUrl = "https://ws.cert.transactionexpress.com/portal/merchantframework/MerchantWebServices-v1?wsdl";
    var soapRequest = 
        '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://postilion/realtime/merchantframework/xsd/v1/"> \
          <SOAP-ENV:Body> \
            <v1:UpdtRecurrProfRequest> \
                 <v1:merc> \
                    <v1:id>7777778598</v1:id> \
                    <v1:regKey>BLHP7DK5W385J6WZ</v1:regKey> \
                    <v1:inType>1</v1:inType> \
                    <v1:prodType>5</v1:prodType> \
                 </v1:merc> \
                 <v1:cust> \
                    <v1:type>0</v1:type> \
                    <v1:contact> \
                       <v1:fullName>Test Person</v1:fullName> \
                       <v1:addrLn1>123 Main</v1:addrLn1> \
                       <v1:addrLn2>Second Floor</v1:addrLn2> \
                       <v1:city>Gilbert</v1:city> \
                       <v1:state>AZ</v1:state> \
                       <v1:zipCode>85296</v1:zipCode> \
                       <v1:type>1</v1:type> \
                       <v1:stat>1</v1:stat> \
                    </v1:contact> \
                    <v1:pmt> \
                       <v1:type>0</v1:type> \
                       <v1:card> \
                          <v1:pan>4485896261017708</v1:pan> \
                          <v1:sec>999</v1:sec> \
                          <v1:xprDt>1602</v1:xprDt> \
                       </v1:card> \
                       <v1:ordNr>Cust Ref ID  Can be used for extra info</v1:ordNr> \
                       <v1:desc>Can be used to name wallet again</v1:desc> \
                       <v1:indCode>2</v1:indCode> \
                    </v1:pmt> \
                 </v1:cust> \
              </v1:UpdtRecurrProfRequest> \
          </SOAP-ENV:Body> \
        </SOAP-ENV:Envelope>' ;
        jQuery.ajax({
            type: "POST",
            url: wsUrl,
            contentType: "text/xml; charset=\"utf-8\"",
            dataType: "xml",
            data: soapRequest,
            //processData: false,
            //async:true,
            headers: {
                SOAPAction: "UpdtRecurrProf"
            },
            complete: function (xmlHttpRequest) {
                alert(xmlHttpRequest.responseXML);
            },

        });

    }
函数soap\u call(){
var wsUrl=”https://ws.cert.transactionexpress.com/portal/merchantframework/MerchantWebServices-v1?wsdl";
var soapRequest=
' \
\
\
\
7777778598 \
BLHP7DK5W385J6WZ\
1 \
5 \
\
\
0 \
\
测试人员\
123主要\
二楼\
吉尔伯特\
阿兹\
85296 \
1 \
1 \
\
\
0 \
\
4485896261017708 \
999 \
1602 \
\
Cust Ref ID可用于额外信息\
可用于重新命名钱包\
2 \
\
\
\
\
' ;
jQuery.ajax({
类型:“POST”,
url:wsUrl,
contentType:“text/xml;字符集=\“utf-8\”,
数据类型:“xml”,
数据:soapRequest,
//processData:false,
//async:true,
标题:{
SOAPAction:“UpdtRecurrProf”
},
完成:函数(xmlHttpRequest){
警报(xmlHttpRequest.responseXML);
},
});
}
我试着打电话,然后它给了我正确的回答

function soap_call(){     
    var wsUrl = "https://ws.cert.transactionexpress.com/portal/merchantframework/MerchantWebServices-v1?wsdl";
    var soapRequest = 
        '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://postilion/realtime/merchantframework/xsd/v1/"> \
          <SOAP-ENV:Body> \
            <v1:UpdtRecurrProfRequest> \
                 <v1:merc> \
                    <v1:id>7777778598</v1:id> \
                    <v1:regKey>BLHP7DK5W385J6WZ</v1:regKey> \
                    <v1:inType>1</v1:inType> \
                    <v1:prodType>5</v1:prodType> \
                 </v1:merc> \
                 <v1:cust> \
                    <v1:type>0</v1:type> \
                    <v1:contact> \
                       <v1:fullName>Test Person</v1:fullName> \
                       <v1:addrLn1>123 Main</v1:addrLn1> \
                       <v1:addrLn2>Second Floor</v1:addrLn2> \
                       <v1:city>Gilbert</v1:city> \
                       <v1:state>AZ</v1:state> \
                       <v1:zipCode>85296</v1:zipCode> \
                       <v1:type>1</v1:type> \
                       <v1:stat>1</v1:stat> \
                    </v1:contact> \
                    <v1:pmt> \
                       <v1:type>0</v1:type> \
                       <v1:card> \
                          <v1:pan>4485896261017708</v1:pan> \
                          <v1:sec>999</v1:sec> \
                          <v1:xprDt>1602</v1:xprDt> \
                       </v1:card> \
                       <v1:ordNr>Cust Ref ID  Can be used for extra info</v1:ordNr> \
                       <v1:desc>Can be used to name wallet again</v1:desc> \
                       <v1:indCode>2</v1:indCode> \
                    </v1:pmt> \
                 </v1:cust> \
              </v1:UpdtRecurrProfRequest> \
          </SOAP-ENV:Body> \
        </SOAP-ENV:Envelope>' ;
        jQuery.ajax({
            type: "POST",
            url: wsUrl,
            contentType: "text/xml; charset=\"utf-8\"",
            dataType: "xml",
            data: soapRequest,
            //processData: false,
            //async:true,
            headers: {
                SOAPAction: "UpdtRecurrProf"
            },
            complete: function (xmlHttpRequest) {
                alert(xmlHttpRequest.responseXML);
            },

        });

    }

我没有肥皂方面的专业知识。如果有人能在这里帮助我,我将不胜感激。

刚刚用a检查了您的请求-请求本身绝对没有问题。以下是我的回答:

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        <ns2:UpdtRecurrProfResponse xmlns="http://postilion/realtime/portal/soa/xsd/Faults/2009/01" xmlns:ns2="http://postilion/realtime/merchantframework/xsd/v1/">
            <ns2:custId>1450956517822188336</ns2:custId>
            <ns2:pmtId>1450956517853193808</ns2:pmtId>
            <ns2:rspCode>00</ns2:rspCode>
        </ns2:UpdtRecurrProfResponse>
    </S:Body>
</S:Envelope>
此外,您应该在浏览器控制台中看到此错误消息,它批准了我的建议

对飞行前请求的响应未通过访问控制检查:否 “Access Control Allow Origin”标头出现在请求的服务器上 资源


所以问题不在于SOAP请求本身,而在于您试图通过javascript请求它。通过您的后端(例如PHP)发出请求-应该会顺利进行。

谢谢您的回复。对于PCI编译,我需要从javascript调用它。从服务器端看,它可以正常工作。但我需要用javascript来完成。