Это действительный файл wsdl? - PullRequest
0 голосов
/ 31 октября 2018

Мне нужно интегрироваться с очень старой службой, написанной на SOAP, и имеет этот файл wsdl. Я пытался использовать https://github.com/vpulim/node-soap для создания мыльного клиента, но он выдает исключение, которое не очень полезно, но после отладки в его коде кажется, что оно ожидает, что «сообщение» будет присутствовать в файле wsdl (прерывается на https://github.com/vpulim/node-soap/blob/master/lib/wsdl.js#L669). Мой вопрос: допустим ли нижеприведенный wsdl? Если да, как я могу создать клиент для этого файла?

Заранее спасибо!

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions name="LocateService" targetNamespace="http://tempuri.org/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:tns="http://tempuri.org/"
    xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
    xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"
    xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
    xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
    xmlns:wsa10="http://www.w3.org/2005/08/addressing"
    xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
    <wsp:Policy wsu:Id="SOAPEndpoint_policy">
        <wsp:ExactlyOne>
            <wsp:All>
                <wsoma:OptimizedMimeSerialization
                    xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/>
                    <http:BasicAuthentication
                        xmlns:http="http://schemas.microsoft.com/ws/06/2004/policy/http"/>
                        <sp:TransportBinding
                            xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                            <wsp:Policy>
                                <sp:TransportToken>
                                    <wsp:Policy>
                                        <sp:HttpsToken RequireClientCertificate="false"/>
                                    </wsp:Policy>
                                </sp:TransportToken>
                                <sp:AlgorithmSuite>
                                    <wsp:Policy>
                                        <sp:Basic256/>
                                    </wsp:Policy>
                                </sp:AlgorithmSuite>
                                <sp:Layout>
                                    <wsp:Policy>
                                        <sp:Strict/>
                                    </wsp:Policy>
                                </sp:Layout>
                            </wsp:Policy>
                        </sp:TransportBinding>
                        <wsaw:UsingAddressing/>
                    </wsp:All>
                </wsp:ExactlyOne>
            </wsp:Policy>
            <wsdl:types/>
            <wsdl:portType name="ILocateWebService">
                <wsdl:operation name="ProcessLocates">
                    <wsdl:input wsaw:Action="http://tempuri.org/ILocateWebService/ProcessLocates"/>
                </wsdl:operation>
                <wsdl:operation name="ProcessResponses">
                    <wsdl:input wsaw:Action="http://tempuri.org/ILocateWebService/ProcessResponses"/>
                </wsdl:operation>
                <wsdl:operation name="GetLocateUpdates">
                    <wsdl:input wsaw:Action="http://tempuri.org/ILocateWebService/GetLocateUpdates"/>
                    <wsdl:output wsaw:Action="http://tempuri.org/ILocateWebService/GetLocateUpdatesResponse"/>
                    <wsdl:fault wsaw:Action="http://tempuri.org/ILocateWebService/GetLocateUpdatesLocateServiceFaultFault" name="LocateServiceFaultFault"/>
                </wsdl:operation>
                <wsdl:operation name="GetConnectionDetails">
                    <wsdl:input wsaw:Action="http://tempuri.org/ILocateWebService/GetConnectionDetails"/>
                    <wsdl:output wsaw:Action="http://tempuri.org/ILocateWebService/GetConnectionDetailsResponse"/>
                    <wsdl:fault wsaw:Action="http://tempuri.org/ILocateWebService/GetConnectionDetailsLocateServiceFaultFault" name="LocateServiceFaultFault"/>
                </wsdl:operation>
                <wsdl:operation name="LocateProcessingEnabled">
                    <wsdl:input wsaw:Action="http://tempuri.org/ILocateWebService/LocateProcessingEnabled"/>
                    <wsdl:output wsaw:Action="http://tempuri.org/ILocateWebService/LocateProcessingEnabledResponse"/>
                    <wsdl:fault wsaw:Action="http://tempuri.org/ILocateWebService/LocateProcessingEnabledLocateServiceFaultFault" name="LocateServiceFaultFault"/>
                </wsdl:operation>
            </wsdl:portType>
            <wsdl:portType name="ILocateRESTService">
                <wsdl:operation name="ProcessResponsesXml">
                    <wsdl:input wsaw:Action="http://tempuri.org/ILocateRESTService/ProcessResponsesXml"/>
                    <wsdl:output wsaw:Action="http://tempuri.org/ILocateRESTService/ProcessResponsesXmlResponse"/>
                </wsdl:operation>
            </wsdl:portType>
            <wsdl:binding name="SOAPEndpoint" type="tns:ILocateWebService">
                <wsp:PolicyReference URI="#SOAPEndpoint_policy"/>
                <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
                <wsdl:operation name="ProcessLocates">
                    <soap12:operation soapAction=""/>
                    <wsdl:input/>
                </wsdl:operation>
                <wsdl:operation name="ProcessResponses">
                    <soap12:operation soapAction=""/>
                    <wsdl:input/>
                </wsdl:operation>
                <wsdl:operation name="GetLocateUpdates">
                    <soap12:operation soapAction=""/>
                    <wsdl:input/>
                    <wsdl:output/>
                    <wsdl:fault name="LocateServiceFaultFault"/>
                </wsdl:operation>
                <wsdl:operation name="GetConnectionDetails">
                    <soap12:operation soapAction=""/>
                    <wsdl:input/>
                    <wsdl:output/>
                    <wsdl:fault name="LocateServiceFaultFault"/>
                </wsdl:operation>
                <wsdl:operation name="LocateProcessingEnabled">
                    <soap12:operation soapAction=""/>
                    <wsdl:input/>
                    <wsdl:output/>
                    <wsdl:fault name="LocateServiceFaultFault"/>
                </wsdl:operation>
            </wsdl:binding>
            <wsdl:service name="LocateService">
                <wsdl:port name="SOAPEndpoint" binding="tns:SOAPEndpoint">
                    <soap12:address location="https://locatehubchi.qalab.net/locatehub.locateservice/LocateService.svc"/>
                    <wsa10:EndpointReference>
                        <wsa10:Address>https://locatehubchi.qalab.net/locatehub.locateservice/LocateService.svc</wsa10:Address>
                    </wsa10:EndpointReference>
                </wsdl:port>
            </wsdl:service>
        </wsdl:definitions>

1 Ответ

0 голосов
/ 01 ноября 2018

Насколько я знаю, сообщение является обязательным атрибутом элемента wsdl: operation / wsdl: input. Поэтому это не будет действительным WSDL. А поскольку сообщения не определены, было бы невозможно создать правильного клиента на основе wsdl, потому что вы не представляете, какое сообщение вам придется отправлять.

...