Create New SOAP Request

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  User Guide and Reference > Menu Commands > SOAP Menu >

Create New SOAP Request

This command creates a new SOAP request document. It involves the following steps:

 

1.Enter the WSDL file location and connect to the SOAP server.
2.The server responds with a list of operations. Select the SOAP operation you want.
3.The server responds with a SOAP Request form in XML format. Define the SOAP Request form.

 

We demonstrate the process below by creating a SOAP request for the US National Digital Forecast Database (NDFD) SOAP Service (http://www.nws.noaa.gov/xml/).

 

Connecting to the SOAP server

The connection is made via a WSDL file. In our example, the URI of the WSDL file is: http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl. To make the connection, click the Create New SOAP Request command, and enter the file URI in the dialog that appears (screenshot below).

SOAPRequestNDFD1

Click OK to confirm the selection.

 

Select the required SOAP operation

The server responds with a list of operation which are displayed in a dialog (screenshot below).

SOAPSelectOperationNDFD2

Select an operation and click OK. We selected the NDFDgenByDay operation.

 

Define the SOAP Request

The server responds by sending an XML file, which is displayed in the Text View of XMLSpy. For the operation we selected, we received the following XML file.

 

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:m0="http://www.weather.gov/forecasts/xml/DWMLgen/schema/DWML.xsd">

 <SOAP-ENV:Body>

         <m:NDFDgenByDay xmlns:m="http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl"

         SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

                 <latitude xsi:type="xsd:decimal">0.0</latitude>

                 <longitude xsi:type="xsd:decimal">0.0</longitude>

                 <startDate xsi:type="xsd:date">1967-08-13</startDate>

                 <numDays xsi:type="xsd:integer">0</numDays>

                 <format xsi:type="m0:formatType">String</format>

         </m:NDFDgenByDay>

 </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

We filled in the parameters as required by the XML (in bold below):

 

<SOAP-ENV:Body>

 <m:NDFDgenByDay xmlns:m="http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl" 

 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

         <latitude xsi:type="xsd:decimal">45</latitude>

         <longitude xsi:type="xsd:decimal">-90</longitude>

         <startDate xsi:type="xsd:date">2009-10-13</startDate>

         <numDays xsi:type="xsd:integer">1</numDays>

         <format xsi:type="m0:formatType">24 hourly</format>

 </m:NDFDgenByDay>

</SOAP-ENV:Body>

 

This completes the definition of this SOAP request. In the next step, we shall send the request.

 


© 2019 Altova GmbH