Doing this yourself will give you insight into how a WSDL is structured and how it gets your job done. It is a good learning opportunity. This can be done using soapUI, if you only have the URL of the WSDL. (I'm using soapUI 5.2.1) If you actually have the complete WSDL as a file available to you, you don't even need soapUI. The title of the question says "Request & Response XML" while the question body says "Request & Response XML formats" which I interpret as the schema of the request and response. At any rate, the following will give you the schema which you can use on XSD2XML to generate sample XML.
- Start a "New Soap Project", enter a project name and WSDL location;
choose to "Create Requests", unselect the other options and click
OK.
- Under the "Project" tree on the left side, right-click an interface
and choose "Show Interface Viewer".
- Select the "WSDL Content" tab.
- You should see the WSDL text on the right hand side; look for the block starting with "wsdl:types" below which are the schema for the input and output messages.
- Each schema definition starts with something like
and ends with .
- Copy out the block into a text editor; above this block add:
- Below the block of copied XML, add
- Decide if you need "UTF-16" instead of "UTF-8"
- The "s:" and the "xmlns:s" should match the block you copied (step
5)
- Save this file with ".xsd" extension; if you have "XML Copy
Editor" or some such tool (XML Spy, may be) you should check that
this is well-formed XML and valid schema.
- Repeat for all "element" items in the right hand pane of soapUI
until you reach
- This way you'll get some type definitions you might not be
interested in. If you want to pick and choose, use the following
method:
Look through the "wsdl:operation" items under "wsdl:portType" in the WSDL text below the type definitions. They will have "wsdl:input" and "wsdl:output". Take the message names from "wsdl:input" and "wsdl:output". Match them against "wsdl:message" names which will likely be above the "wsdl:portType" entries in the WSDL. Get the "wsdl:part" element name from "wsdl:message" item and look for that name as element name under "wsdl:types". Those will be the schema of interest to you.
You can try above procedure out using the WSDL at http://www.webservicex.com/globalweather.asmx?wsdl