wsdl服务标记多个url';s

wsdl服务标记多个url';s,wsdl,Wsdl,我可以在服务标签中为单个portType操作指定两个位置吗?基本上这意味着,如果客户机支持soap绑定,那么它将调用url1,而对于其他一些绑定,则调用url2 我不能这样做吗?您可以通过url1或url2访问NewPort操作。是的,您可以执行以下操作: <wsdl:service name="NewService"> <wsdl:port name="NewPort" binding="tns:NewBinding"> <soap:

我可以在服务标签中为单个portType操作指定两个位置吗?基本上这意味着,如果客户机支持soap绑定,那么它将调用url1,而对于其他一些绑定,则调用url2




我不能这样做吗?您可以通过url1或url2访问NewPort操作。

是的,您可以执行以下操作:

<wsdl:service name="NewService">
    <wsdl:port name="NewPort" binding="tns:NewBinding">
        <soap:address location="http://url1"/>
    </wsdl:port>
    <wsdl:port name="NewPort2" binding="tns:NewBinding2">
        <soap12:address location="http://url2"/>
    </wsdl:port>
</wsdl:service>

哦,不,两者应该是相同的端口操作。您使用了两个不同的端口。纽波特和内波特2对不起,你搞错了。一个
portType
定义操作。
binding
portType
与特定于所用通信技术的参数相关联。
服务
元素包含
端口
元素,这些元素将绑定与寻址信息关联起来。是的,我知道。但是我想让客户端通过两种不同的绑定技术进行访问。一个可以是肥皂,另一个可以是ABC。
<wsdl:service name="NewService">
    <wsdl:port name="NewPort" binding="tns:NewBinding">
        <soap:address location="http://url1"/>
    </wsdl:port>
    <wsdl:port name="NewPort2" binding="tns:NewBinding2">
        <soap12:address location="http://url2"/>
    </wsdl:port>
</wsdl:service>
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
    xmlns:tns="http://new.webservice.namespace" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
    targetNamespace="http://new.webservice.namespace">
    <wsdl:types>
        <xs:schema targetNamespace="http://new.webservice.namespace" elementFormDefault="qualified"/>
    </wsdl:types>
    <wsdl:message name="NewMessageRequest">
        <wsdl:part name="parameter" type="xs:string"/>
    </wsdl:message>
    <wsdl:message name="NewMessageResponse">
        <wsdl:part name="parameter" type="xs:string"/>
    </wsdl:message>
    <wsdl:portType name="NewPortType">
        <wsdl:operation name="NewOperation">
            <wsdl:input message="tns:NewMessageRequest"/>
            <wsdl:output message="tns:NewMessageResponse"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="NewBinding" type="tns:NewPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="NewOperation">
            <soap:operation soapAction="urn:#NewOperation"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="NewBinding2" type="tns:NewPortType">
        <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="NewOperation">
            <soap12:operation soapAction="urn:#NewOperation" soapActionRequired="true" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="NewService">
        <wsdl:port name="NewPort" binding="tns:NewBinding">
            <soap:address location="http://url1"/>
        </wsdl:port>
        <wsdl:port name="NewPort2" binding="tns:NewBinding2">
            <soap12:address location="http://url2"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>