The Temperature Conversion Web Services Description Language (WSDL) document is provided
for you. The WSDL code that you use in this tutorial converts temperature from Fahrenheit to Celsius
and Celsius to Fahrenheit.
About this task
You can create a new WSDL document or copy an existing one. The Temperature Conversion WSDL
document that is used in this tutorial is provided for you in a simple project. Complete the
following steps to copy the Temperature Conversion WSDL document into the workbench:
Procedure
-
In the Enterprise Explorer view, expand TempEJB, right-click, and select to create a folder that is called wsdl. Click
Finish.
-
Select the WSDL folder, right-click, and select New File.
-
Name the file ConvertTemperature.wsdl.
-
Click Finish.
-
Copy and paste the following code to add the contents to the new file:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://sample" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://sample" xmlns:intf="http://sample" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://sample" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="fahrenheitToCelsius">
<complexType>
<sequence>
<element name="fahrenheitValue" type="xsd:double"/>
</sequence>
</complexType>
</element>
<element name="fahrenheitToCelsiusResponse">
<complexType>
<sequence>
<element name="fahrenheitToCelsiusReturn" type="xsd:double"/>
</sequence>
</complexType>
</element>
<element name="celsiusToFahrenheit">
<complexType>
<sequence>
<element name="celsiusValue" type="xsd:double"/>
</sequence>
</complexType>
</element>
<element name="celsiusToFahrenheitResponse">
<complexType>
<sequence>
<element name="celsiusToFahrenheitReturn" type="xsd:double"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="celsiusToFahrenheitRequest">
<wsdl:part element="intf:celsiusToFahrenheit" name="parameters"/>
</wsdl:message>
<wsdl:message name="fahrenheitToCelsiusResponse">
<wsdl:part element="intf:fahrenheitToCelsiusResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="fahrenheitToCelsiusRequest">
<wsdl:part element="intf:fahrenheitToCelsius" name="parameters"/>
</wsdl:message>
<wsdl:message name="celsiusToFahrenheitResponse">
<wsdl:part element="intf:celsiusToFahrenheitResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="ConvertTemperature">
<wsdl:operation name="fahrenheitToCelsius">
<wsdl:input message="intf:fahrenheitToCelsiusRequest" name="fahrenheitToCelsiusRequest"/>
<wsdl:output message="intf:fahrenheitToCelsiusResponse" name="fahrenheitToCelsiusResponse"/>
</wsdl:operation>
<wsdl:operation name="celsiusToFahrenheit">
<wsdl:input message="intf:celsiusToFahrenheitRequest" name="celsiusToFahrenheitRequest"/>
<wsdl:output message="intf:celsiusToFahrenheitResponse" name="celsiusToFahrenheitResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ConvertTemperatureSoapBinding" type="intf:ConvertTemperature">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="fahrenheitToCelsius">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="fahrenheitToCelsiusRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="fahrenheitToCelsiusResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="celsiusToFahrenheit">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="celsiusToFahrenheitRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="celsiusToFahrenheitResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ConvertTemperatureService">
<wsdl:port binding="intf:ConvertTemperatureSoapBinding" name="ConvertTemperature">
<wsdlsoap:address location="http://localhost:9080/temperatureProject/services/ConvertTemperature"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
-
Save the WSDL file.