node-soap 패키지를 사용하여 다음 SOAP 서비스를 사용하고 있습니다. https://paymentsuat.mppglobal.com/interface/mpp/ipaypaymentpages/ipaypaymentpages.asmx?wsdl
iPayPaymentPagesSoap 포트의 경우 이름은 같지만 매개 변수가 다른 두 개의 조작이 있습니다.
설명 기능 node-soap을 사용하면 각 포트 유형에 대한 마지막 작업 만 표시됩니다. 호출되는 작업을 선택하는 방법이 있습니까?
<wsdl:portType name="iPayPaymentPagesSoap">
<wsdl:operation name="CreateSession">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
Retrieves a Guid from the system populated with details. Used in conjunction with ipayment pages.
</wsdl:documentation>
<wsdl:input name="CreateSessionBySOAP" message="tns:CreateSessionBySOAPSoapIn"/>
<wsdl:output name="CreateSessionBySOAP" message="tns:CreateSessionBySOAPSoapOut"/>
</wsdl:operation>
<wsdl:operation name="CreateSession">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
Retrieves a Guid from the system populated with user details. Used in conjunction with ipayment pages.
</wsdl:documentation>
<wsdl:input name="CreateSessionByGET" message="tns:CreateSessionByGETSoapIn"/>
<wsdl:output name="CreateSessionByGET" message="tns:CreateSessionByGETSoapOut"/>
</wsdl:operation>
</wsdl:portType>
렌더링 대상 :
{
iPayPaymentPages: {
iPayPaymentPagesSoap: {
CreateSession: {
input: {
affiliateId: "s:int",
password: "s:string"
},
output: {
CreateSessionByGETResult: {
Guid: "s:string",
ErrorNumber: "s:int",
ErrorMessage: "s:string",
targetNSAlias: "tns",
targetNamespace: "https://secure1.mppglobal.com/interface/ipaypaymentpages/ipaypaymentpages.asmx"
}
}
}
}
}
}
그러나 CreateSession을 CreateSessionBySOAP 매개 변수와 함께 사용하는 것을 목표로하고 있지만 node-soap의 기본값은 CreateSessionByGET입니다.
* 저는 WSDL을 제어 할 수 없으며 Node.js와 함께 SOAP를 사용하지 않을 것입니다.하지만이 경우에는 문제가 있습니다!
나는 동일한 동작에 갇혀있는 것 같습니다 .node-soap / lib / client.js에서 wsdl을 객체 또는 dom 객체로 사용하지만 wsdl : portTypes에서는 마지막 작업 요소 만 나타냅니다. 제 경우에는 이름이 같은 작업이 4 개 있으므로 해결 방법은 다음과 같습니다.
soap.createClient(url, options, function(err, client) {
var method = client.wsdl.definitions.services.[Service].ports.[Port].binding.methods['CreateSession'];
var location = client.wsdl.definitions.services.[Service].ports.[Port].location;
//change method $name, method input $name
method.$name = 'CreateSessionBySOAP';
method.input.$name = 'CreateSessionBySOAP';
var def= client._defineMethod(method, location);
//invoke the method
def(args, options, function(err, result) {
console.log(JSON.stringify(result));
});
console.log(client.lastMessage);
console.log(client.lastResponse);
});
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다