2011-01-31 7 views
1

サービスタグの1つのportType操作に2つの場所を指定できますか?基本的にこれは、クライアントがsoapバインディングをサポートする場合はurl1、その他のバインディングの場合はurl2を呼び出します。wsdlサービスタグ複数のURLの


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

私はこのような何かを行うことはできませんか?ここでは、url1またはurl2のいずれかを使用してNewPort操作にアクセスできます。

答えて

0

はい、あなたはこのような何かを行うことができます。

<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> 

どちらのバインディングが同じportTypeを参照することができます。


全WSDL:

<?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> 
+0

ああ、いや両方が同じポート操作する必要があります。 2つの異なるポートを使用しています。 NewPortとNePort2 – user581734

+0

申し訳ありません、あなたは間違っています。 'portType'は操作を定義します。 'binding'は' portType'を、使用されている通信技術に特有のパラメータと関連付けます。 'service'要素は、バインディングをアドレス指定情報に関連付ける' port'要素を含んでいます。 –

+0

ええ、私はそれを知っています。しかし、私はクライアントが2つの異なるバインディング技術を通じてアクセスできるようにしたい。 1つは石鹸で、もう1つはABCと言うことができます。 – user581734

関連する問題