Weblogic - Creating a Web Service from a WSDL File

> (Weblogic|Fusion Middelware|FMW)

1 - 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:

  • JWS service endpoint interface (SEI) that implements the Web service described by the WSDL file.
  • JWS implementation file that contains a partial (stubbed-out) implementation of the generated JWS SEI. This file must be customized by the developer.
  • JAXB data binding artifacts.
  • Optional Javadocs for the generated JWS SEI.

Typically:

  • you run the wsdlc Ant task one time to generate a JAR file that contains the generated JWS SEI file and data binding artifacts,
  • then code the generated JWS file that implements the interface, adding the business logic of your Web service to the methods that implement the Web service operations and add additional JWS annotations if needed

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.

3 - 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>

4 - Documentation / Reference

Advertising
weblogic/web_service_wsdl.txt · Last modified: 2019/02/16 17:49 by gerardnico