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).
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).
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 red below; fill in a start date that is the current date or one within the next week):
<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">2019-12-10</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.