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.
精彩评论