Table of Contents

Weblogic - Creating a Web Service from a WSDL File

About

Creating a Web Service from an existing WSDL File, often referred to as the golden WSDL.

Based on this WSDL file to be able to deploy the web service, you generate with the help of an wsdlc Ant task the following artifacts:

Typically:

After you have coded the JWS implementation file, you run the jwsc Ant task to generate the deployable Web service, using the same steps as described in the preceding sections. The only difference is that you use the compiledWsdl attribute to specify the JAR file (containing the JWS SEI file and data binding artifacts) generated by the wsdlc Ant task.

Sample WSDL File

<?xml version="1.0"?>
<definitions
   name="TemperatureService"
   targetNamespace="http://www.xmethods.net/sd/TemperatureService.wsdl"
   xmlns:tns="http://www.xmethods.net/sd/TemperatureService.wsdl"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns="http://schemas.xmlsoap.org/wsdl/" >
        <message name="getTempRequest">
                <part name="zip" type="xsd:string"/>
        </message>
        <message name="getTempResponse">
                <part name="return" type="xsd:float"/>
        </message>
        <portType name="TemperaturePortType">
                <operation name="getTemp">
                        <input message="tns:getTempRequest"/>
                        <output message="tns:getTempResponse"/>
                </operation>
        </portType>
        <binding name="TemperatureBinding" type="tns:TemperaturePortType">
                <soap:binding style="document" 
                             transport="http://schemas.xmlsoap.org/soap/http"/>
                <operation name="getTemp">
                        <soap:operation soapAction=""/>
                        <input>
                                <soap:body use="literal"
                                 namespace="urn:xmethods-Temperature" />
                        </input>
                        <output>
                                <soap:body use="literal"
                                 namespace="urn:xmethods-Temperature" />
                        </output>
                </operation>
        </binding>
        <service name="TemperatureService">
            <documentation>
                Returns current temperature in a given U.S. zipcode
            </documentation>
            <port name="TemperaturePort" binding="tns:TemperatureBinding">
               <soap:address 
                          location="http://localhost:7001/temp/TemperatureService"/>
            </port>
        </service>
</definitions>

Documentation / Reference

Creating a Web Service from a WSDL File