开发者

Defining common message across wsdls

开发者 https://www.devze.com 2023-03-18 05:06 出处:网络
I\'m writing 开发者_Python百科three different web services in three wsdls. The services all share a common type of generic error message. The three services are defined in three different namespaces b

I'm writing 开发者_Python百科three different web services in three wsdls. The services all share a common type of generic error message. The three services are defined in three different namespaces but I want the error message to be defined in a fourth namespace. Is there a way to "import" or "include" the message-type into the three wsdl-files?


Yes, that should be possible. Use the <import> element to import the shared WSDL, in the portType's operation, you can fully qualify the name of message, i.e. you need to bind the fourth namespace to a prefix (e.g. ns4) and then add a reference like this:

<portType name="MyPortType">
    <operation name="MyOperation">
       <input message="tns:myInput"/>
       <output message="tns:myOutput"/>
       <fault message="ns4:myFault"/>
    </operation>
</portType>

See http://www.w3.org/TR/wsdl#_style for further reference about the import mechanism.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号