• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

WSDL: How to put common messages in one file?

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am creating few WSDLs and I want to share the error messages across these WSDL. Currently I am repeating the error messages in all the WSDL files. Is there a way to put all the common messages and re-use it in different WSDL. Please assist.

Thanks
Loganathan
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Move all the common elements to .xsd file (for example common.xsd) and import that common.xsd file into each individual wsdl files.

Example: In wsdl as below
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="your name space">
<include schemaLocation="common.xsd"/> // put common.xsd in the same folder as wsdl.
</schema>
</types>

You can also extend the common element (in this case your error message element) to add more info, like

<element name="CustomErrorMessage">
<complexType>
<complexContent>
<extension base="tns:ErrorMessage"> // this is your common error message element
<sequence>
<element name="AdditionalInfo" type="tns:AdditionalInfo" minOccurs="0" nillable="true"/>
.. you can add more elements here ..
</sequence>
</extension>
</complexContent>
</complexType>
</element>
 
reply
    Bookmark Topic Watch Topic
  • New Topic