Сильному мылу не нравится мой WSDL, в то время как SOAP-UI работает с ним
У меня есть следующий WSDL:
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions targetNamespace="http://namespaces.gsma.org/esim-messaging/3"
xmlns:rps="http://namespaces.gsma.org/esim-messaging/3"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- WSDL TYPES -->
<wsdl:types>
<xs:schema targetNamespace="http://namespaces.gsma.org/esim-messaging/3" elementFormDefault="qualified" >
<xs:include schemaLocation="xsd/euicc.request.ES2.xsd"/>
</xs:schema>
<xs:schema targetNamespace="http://www.w3.org/2005/08/addressing" elementFormDefault="qualified" >
<xs:include schemaLocation="xsd/import/ws-addr.xsd"/>
</xs:schema>
</wsdl:types>
<!-- WSA MESSAGES -->
<wsdl:message name="SoapHeader">
<!-- WSA MANDATORY -->
<wsdl:part name="From" element="wsa:From"/>
<wsdl:part name="To" element="wsa:To"/>
<wsdl:part name="Action" element="wsa:Action"/>
<wsdl:part name="MessageID" element="wsa:MessageID"/>
<wsdl:part name="RelatesTo" element="wsa:RelatesTo"/>
<!-- WSA OPTIONAL -->
<wsdl:part name="ReplyTo" element="wsa:ReplyTo"/>
</wsdl:message>
<!-- ES2 MESSAGES -->
<wsdl:message name="ES2-GetEISRequestMessage">
<wsdl:part name="parameters" element="rps:ES2-GetEISRequest"/>
</wsdl:message>
<wsdl:message name="ES2-GetEISResponseMessage">
<wsdl:part name="parameters" element="rps:ES2-GetEISResponse"/>
</wsdl:message>
<!-- SOAP PORT OPERATIONS -->
<wsdl:portType name="ES2SmDp">
<wsdl:operation name="ES2-GetEIS">
<wsdl:input message="rps:ES2-GetEISRequestMessage"
wsa:Action="http://gsma.com/ES2/DataPreparation/ES2-GetEISRequest"
wsam:Action="http://gsma.com/ES2/DataPreparation/ES2-GetEISRequest"/>
<wsdl:output message="rps:ES2-GetEISResponseMessage"
wsa:Action="http://gsma.com/ES2/DataPreparation/ES2-GetEISResponse"
wsam:Action="http://gsma.com/ES2/DataPreparation/ES2-GetEISResponse"/>
</wsdl:operation>
</wsdl:portType>
<!-- SOAP BINDING -->
<wsdl:binding name="ES2SmDpServiceBinding" type="rps:ES2SmDp">
<wsoap12:binding transport="http://www.w3.org/2003/05/soap/bindings/HTTP/" style="document"/>
<wsdl:operation name="ES2-GetEIS">
<wsoap12:operation style="document"/>
<wsdl:input>
<wsoap12:header message="rps:SoapHeader" use="literal" part="From" wsdl:required="true"/>
<wsoap12:header message="rps:SoapHeader" use="literal" part="To" wsdl:required="true"/>
<wsoap12:header message="rps:SoapHeader" use="literal" part="MessageID" wsdl:required="true"/>
<wsoap12:header message="rps:SoapHeader" use="literal" part="Action" wsdl:required="true"/>
<wsoap12:body use="literal" wsdl:required="true"/>
</wsdl:input>
<wsdl:output>
<wsoap12:header message="rps:SoapHeader" use="literal" part="From" wsdl:required="true"/>
<wsoap12:header message="rps:SoapHeader" use="literal" part="To" wsdl:required="true"/>
<wsoap12:header message="rps:SoapHeader" use="literal" part="MessageID" wsdl:required="true"/>
<wsoap12:header message="rps:SoapHeader" use="literal" part="Action" wsdl:required="true"/>
<wsoap12:header message="rps:SoapHeader" use="literal" part="RelatesTo" wsdl:required="true"/>
<wsoap12:body use="literal" wsdl:required="true"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<!-- SOAP SERVICE -->
<wsdl:service name="ES2SmDpService">
<wsdl:port binding="rps:ES2SmDpServiceBinding" name="SmDpES2Port">
<wsoap12:address location="http://gsma.org/esim-messaging/3/ES2/ES2SmDpService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
который я собираюсь назвать своим сервисом, используя сильное мыло. Но процесс завершается неудачей, просто пытаясь загрузить WSDL:
var soap = require('strong-soap').soap;
var url = __dirname + '/wsdl.wsdl';
var options = {};
soap.createClient(url, options, function(err, client) {
console.log(arguments);
});
Жалуется:
throw new errors.AssertionError({
^
AssertionError [ERR_ASSERTION]: Document/literal part should use element
at Operation.getMode (/home/mehran/tmp/soap/oberthur/node_modules/strong-soap/src/parser/wsdl/operation.js:349:11)
at Operation.postProcess (/home/mehran/tmp/soap/oberthur/node_modules/strong-soap/src/parser/wsdl/operation.js:65:12)
at Binding.postProcess (/home/mehran/tmp/soap/oberthur/node_modules/strong-soap/src/parser/wsdl/binding.js:60:17)
at Service.postProcess (/home/mehran/tmp/soap/oberthur/node_modules/strong-soap/src/parser/wsdl/service.js:22:19)
at /home/mehran/tmp/soap/oberthur/node_modules/strong-soap/src/parser/wsdl.js:69:25
at /home/mehran/tmp/soap/oberthur/node_modules/strong-soap/src/parser/wsdl.js:189:9
at /home/mehran/tmp/soap/oberthur/node_modules/strong-soap/src/parser/wsdl.js:189:9
at WSDL._processNextInclude (/home/mehran/tmp/soap/oberthur/node_modules/strong-soap/src/parser/wsdl.js:157:14)
at /home/mehran/tmp/soap/oberthur/node_modules/strong-soap/src/parser/wsdl.js:188:12
at /home/mehran/tmp/soap/oberthur/node_modules/strong-soap/src/parser/wsdl.js:101:9
Включив отладку, я получу (множество журналов, не связанных с ошибками, опущено):
$ DEBUG=strong-soap:* node ./src/client.js
....
Thu, 04 Jan 2018 23:10:38 GMT strong-soap:wsdl:element Schema element not found: http://namespaces.gsma.org/esim-messaging/3 rps:ES2-GetEISRequest
Thu, 04 Jan 2018 23:10:38 GMT strong-soap:wsdl:element Schema element not found: http://namespaces.gsma.org/esim-messaging/3 rps:ES2-GetEISResponse
Кто-нибудь знает, на что он жалуется? Или, что более важно, как я могу это исправить? И, как говорится в заголовке, SOAP-UI отлично работает с точно таким же файлом WSDL!