プロジェクトでの HTTP バインディングコンポーネントの使用

XML/HTTP GET 処理

HTTP バインディングコンポーネントは、JBI 環境のサービスへの接続を提供するプロバイダプロキシとして、あるいはサービスを呼び出すコンシューマプロキシとして使用されます。バインディングコンポーネントは、WSDL 1.1 仕様で定義されている HTTP 1.1 GET バインディングを実装します。これにより、アプリケーションは Web ブラウザに似た HTTP GET 対話を使用して、JBI 環境からサービスを消費または提供することができます。

HTTP バインディングコンポーネントを HTTP Get 対話用に設定する

HTTP バインディングコンポーネントを HTTP Get 対話で機能するように設定するには、バインディングコンポーネントがプロキシとして機能しているサービスの WSDL ファイルで、WSDL 1.1 仕様で定義されている次の HTTP バインディング言語要素を使用する必要があります。

HTTP バインディングコンポーネントをプロバイダプロキシまたはコンシューマプロキシとして設定する方法の例は、Using the HTTP Binding Component with the HTTP GET method および Using the HTTP Binding Component with the HTTP POST Method で参照できます。

バインディングの詳細

以降の節では、HTTP バインディングコンポーネントが HTTP バインディング言語要素をどのようにサポートし、実装するかについて説明します。特に指示がないかぎり、ここで説明する WSDL 要素は名前空間 http://schemas.xmlsoap.org/wsdl/http/ で定義されています。

http:binding 要素

<http:binding> 要素:


注 –

現在、HTTP バインディングコンポーネントでは GET と POST の値だけがサポートされています (HTTP メソッドでは大文字と小文字が区別されることに注意してください)。


例:


<http:binding verb="POST"/>

http:address 要素

<http:address> 要素:

例:


<http::address location="http://localhost/MyService/MyPort"/>

http:operation 要素

<http:operation> 要素:

HTTP バインディングコンポーネントでは、この要素の location 属性の値として空白がサポートされています。

例:


Given:
    <http:operation location="Submit">
    <http:address location="http://localhost/MyService/MyPort">

The full HTTP request URI is: 
http://localhost/MyService/MyPort/Submit

http:urlEncoded 要素

<http:urlEncoded> 要素:

例:


Given this description:
<wsd:message name="MyMessage">
    <wsdl:part name="partA" type="xsd:string"/>
    <wsdl:part name="partB" type="xsd:string"/>
</wsdl:message>
...
<wsdl:portType name="MyPortType">
    <wsdl:operation name="MyOperation">
        <wsdl:input message="MyMessage"/>
    </wsdl:operation>
</wsdl:portType>
...
<wsdl:binding name="MyBinding" type="MyPortType">
    <http:binding verb="GET"/>
    <wsdl:operation name="MyOperation">
        <wsdl:input>
            <http:urlEncoded/>
        </wsdl:input>
    </wsdl:operation>
</wsdl:binding>
...
<wsdl:service name="MyService">
    <wsdl:port name="Port1" binding="MyBinding">
        <http:address location="http://localhost/MyService/MyPort"/>
    </wsdl:port>
</wsdl:service>

Given these values mapped to the input parts:
"valueY" -> "partA"
"valueZ" -> "partB"

The full HTTP request URI is:
http://localhost/MyService/MyPort/MyOperation/partA=valueY&partB=valueZ

http:urlReplacement

<http:urlReplacement/> 要素:

例:


Given this description:
<wsd:message name="MyMessage">
    <wsdl:part name="partA" type="xsd:string"/>
    <wsdl:part name="partB" type="xsd:string"/>
</wsdl:message>
...
<wsdl:portType name="MyPortType">
    <wsdl:operation name="MyOperation">
        <wsdl:input message="MyMessage"/>
    </wsdl:operation>
</wsdl:portType>
...
<wsdl:binding name="MyBinding" type="MyPortType">
    <http:binding verb="GET"/>
    <wsdl:operation name="MyOperation/(partA)/subcategory/(partB)">
        <wsdl:input>
            <http:urlReplacement/>
        </wsdl:input>
    </wsdl:operation>
</wsdl:binding>
...
<wsdl:service name="MyService">
    <wsdl:port name="Port1" binding="MyBinding">
        <http:address location="http://localhost/MyService/MyPort"/>
    </wsdl:port>
</wsdl:service>

Given these values mapped to the input parts:
"valueY" -> "partA"
"valueZ" -> "partB"

The full HTTP request URI is:
http://localhost/MyService/MyPort/MyOperation/valueY/subcategory/valueZ