標準の WSDL ファイル (XML で表現) があるとします。
<wsdl:definitions>
<wsdl:types>
...
</wsdl:types>
<wsdl:message>
...
</wsdl:message>
<wsdl:portType name="countrySoap”>
<wsdl:operation name="GetCountryByCountryCode">
<wsdl:documentation>Get country name by country code</wsdl:documentation>
<wsdl:input message="tns:GetCountryByCountryCodeSoapIn" />
<wsdl:output message="tns:GetCountryByCountryCodeSoapOut" />
</wsdl:operation>
<wsdl:operation name="GetISD">
<wsdl:documentation>Get International Dialing Code </wsdl:documentation>
<wsdl:input message="tns:GetISDSoapIn" />
<wsdl:output message="tns:GetISDSoapOut" />
</wsdl:operation>
...
<wsdl:portType name="countrySoap”>
....
</wsdl:definitions>
私がやりたいことは、すべてのメッセージの入力メッセージと出力メッセージを交換する簡単で効率的な方法を持つことです。
たとえば、私は欲しい:
<wsdl:operation name="GetCountryByCountryCode">
<wsdl:documentation>Get country name by country code</wsdl:documentation>
<wsdl:input message="tns:GetCountryByCountryCodeSoapOut" />
<wsdl:output message="tns:GetCountryByCountryCodeSoapIn" />
</wsdl:operation>
私が使用している wsdl ファイルの例は、 http ://www.webservicex.net/country.asmx?WSDL にあります。
その他の注意事項:
- これがより効率的であるように思われるため、私はおそらく XSLT ベースのソリューションを探しています。たとえば、私の現在のソリューションは Java ベースですが、思ったほど効率的ではないようです。
- 解決策が任意の名前空間を無視できるとよいでしょう。たとえば、一部の wsdl ファイル
wsdl:definitions
は 、wsdl:portType
、 - として存在し、他のファイルは 、、などでwsdl:operation
ある可能性があります。definitions
portType
operation