这是有效的wsdl文件吗?

时间:2018-10-31 18:43:52

标签: soap soap-client

我需要与一个用SOAP编写的非常老的服务集成,并具有此wsdl文件。我尝试使用https://github.com/vpulim/node-soap创建一个soap客户端,但是它引发了异常,它不是很有用,但是在调试其代码后,似乎希望wsdl文件中存在“消息”(在{{ 3}})。我的问题是-下面的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 :(得分:0)

据我所知,消息是wsdl:operation / wsdl:input元素上的必需属性。因此,这不是有效的WSDL。而且,由于没有定义消息,因此无法基于wsdl创建合适的客户端,因为您不知道必须发送什么消息。