WSDLで添付ファイルを扱う場合,wsi:swaRef形式で記述します。wsi:swaRef形式は,WSDLで添付ファイルを扱う形式としてWS-I Attachments Profile - Version 1.0で規定されています。
WS-I Attachments Profile - Version 1.0で規定された形式に基づいて,wsi:swaRef形式で記述したWSDLの例を示します。
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://localhost"
xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd" ...>
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://localhost"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://ws-i.org/profiles/basic/1.1/xsd"/>
<element name="getUserData">
<complexType>
<sequence>
<element name="in0" type="xsd:string"/>
<element name="in1" type="wsi:swaRef"/>
</sequence>
</complexType>
</element>
...
</schema>
</wsdl:types>
<wsdl:message name="getUserDataRequest">
<wsdl:part element="intf:getUserData" name="parameters"/>
</wsdl:message>
...
<wsdl:portType name="UserInfo">
<wsdl:operation name="getUserData">
<wsdl:input message="intf:getUserDataRequest" name="getUserDataRequest"/>
...
</wsdl:operation>
</wsdl:portType>
...
</wsdl:definitions> |
この例では,getUserDataメソッドの引数(スキーマ定義のelement要素の型)に,添付ファイルを表すwsi:swaRef型を指定しています。
- WSDLで添付ファイルを扱う場合の注意事項