9.4 Development guidelines

 < Day Day Up > 



9.4 Development guidelines

In this section we describe:

  • How to enable an EJB target application as a document style Web service provider.

  • How to enable a Web source application as a document style Web service client.

We are using the Web Services for J2EE support provided with WebSphere V5.0.2 to implement our solution, which includes command line tools to generate the Web services classes and deployment descriptors. IBM WebSphere Studio Application Developer V5.1 also provides full support for the creation of Web services for J2EE.

9.4.1 Web service enabling the target application

See Figure 8-9 on page 161 for an overview of the Web service development process for a target application. Let's walk through this process for our target application.

We have already created a simple EJB application using WebSphere Studio Application Developer. We can create a document style Web service using this EJB as follows:

  1. Create a service endpoint interface for the Web service:

    1. Using WebSphere Studio, switch to the J2EE Perspective and click the Project Navigator tab.

    2. Navigate to the ITSOTargetAppEJB ejbModule folder ejbModule folder.

    3. Create the service endpoint interface by copying the Inventory EJB Remote Interface, Inventory.java, from the com.ibm.itso.ejb.inventory package to InventoryDoc.java in the com.ibm.itso.ws.inventory package.

    4. Edit the new InventoryDoc.java file so that it extends java.rmi.Remote, as shown in Example 9-1.

      Example 9-1: InventoryDoc service endpoint interface

      start example
       package com.ibm.itso.ws.inventory; public interface InventoryDoc extends java.rmi.Remote {    public void updateInventory(String partNo)       throws java.rmi.RemoteException;    public String getDeliveryDate(String partNo)       throws java.rmi.RemoteException; } 
      end example

  2. Open a command window.

  3. Generate a Web Services Description Language (WSDL) file from the service endpoint interface. We used the command shown in Example 9-2.

    Example 9-2: Generating WSDL using Java2WSDL

    start example
     C:\WebSphere\AppServer\bin\Java2WSDL -verbose    -implClass com.ibm.itso.ejb.inventory.InventoryBean    -location http://target.itso.ral.ibm.com:9080/ITSOTargetApp/services/InventoryDoc    -output C:\workspace\ITSOTargetAppEJB\ejbModule\META-INF\wsdl\InventoryDoc.wsdl    -style document -use literal -voidReturn ONEWAY com.ibm.itso.ws.inventory.InventoryDoc WSWS3010I: Info: Generating portType {http://inventory.ws.itso.ibm.com}InventoryDoc WSWS3010I: Info: Generating message {http://inventory.ws.itso.ibm.com}getDeliveryDateRequest WSWS3010I: Info: Generating message {http://inventory.ws.itso.ibm.com}getDeliveryDateResponse WSWS3010I: Info: Generating message {http://inventory.ws.itso.ibm.com}updateInventoryRequest WSWS3010I: Info: Generating message {http://inventory.ws.itso.ibm.com}updateInventoryResponse WSWS3010I: Info: Generating binding {http://inventory.ws.itso.ibm.com}InventoryDocSoapBinding WSWS3010I: Info: Generating service {http://inventory.ws.itso.ibm.com}InventoryDocService WSWS3010I: Info: Generating port InventoryDoc 
    end example

    Note the -style document option. It specifies that we want to generate WSDL for a document style Web service.

  4. Create XML schemas defining the required messages structures. We created two XML schemas:

    • InventoryRequest.xsd as the request message for both updateInventory and getDeliveryDate

    • InventoryReply.xsd as the reply message for getDeliveryDate

    See Example 9-3 for the listing of InventoryReply.xsd. InventoryRequest.xsd is the same except it doesn't have the DeliveryDate element. We placed both schema files in the ITSOTargetAppEJB\ejbModule\META-INF\wsdl folder along with the WSDL file.

    Example 9-3: InventoryReply.xsd

    start example
     <?xml version="1.0" encoding="UTF-8"?> <xsd:schema targetNamespace="http://reply.inventory.ws.itso.ibm.com"       xmlns:reply="http://reply.inventory.ws.itso.ibm.com"       xmlns:xsd="http://www.w3.org/2001/XMLSchema">     <xsd:complexType name="InventoryReply">         <xsd:sequence>             <xsd:element name="Header">                 <xsd:complexType>                     <xsd:sequence>                         <xsd:element name="SourceName" type="xsd:string"/>                         <xsd:element name="Version" type="xsd:int"/>                         <xsd:element name="CreateDate" type="xsd:dateTime"/>                     </xsd:sequence>                 </xsd:complexType>             </xsd:element>             <xsd:element name="Body">                 <xsd:complexType>                     <xsd:sequence>                         <xsd:element name="PartNumber" type="xsd:string"/>                         <xsd:element name="DeliveryDate" type="xsd:date"/>                     </xsd:sequence>                 </xsd:complexType>             </xsd:element>         </xsd:sequence>     </xsd:complexType> </xsd:schema> 
    end example

  5. Edit the generated WSDL file so it imports the required XML schemas into the WSDL types element.

    Example 9-4 shows the WSDL types definitions in the generated WSDL file before editing.

    Example 9-4: Generated WSDL types from InventoryDoc.wsdl

    start example
     ... <wsdl:types>  <schema elementFormDefault="qualified"    targetNamespace="http://inventory.ws.itso.ibm.com"    xmlns="http://www.w3.org/2001/XMLSchema">   <element name="getDeliveryDate">    <complexType>     <sequence>      <element name="partNo" nillable="true" type="xsd:string"/>     </sequence>    </complexType>   </element>   <element name="getDeliveryDateResponse">    <complexType>     <sequence>      <element name="getDeliveryDateReturn" nillable="true" type="xsd:string"/>     </sequence>    </complexType>   </element>   <element name="updateInventory">    <complexType>     <sequence>      <element name="partNo" nillable="true" type="xsd:string"/>     </sequence>    </complexType>   </element>  </schema> </wsdl:types> ... 
    end example

    Looking at Example 9-5, you can see that we have imported the InventoryRequest.xsd and InventoryReply.xsd XML schemas. The getDeliveryDate and updateInventory elements now reference InventoryRequest rather than string. The getDeliveryDateResponse element references InventoryReply rather than string. Our XML types will now be used in the WSDL message definitions, instead of string types.

    Example 9-5: Imported WSDL types from InventoryDoc.wsdl

    start example
     ... <wsdl:types>  <xsd:schema elementFormDefault="qualified"    targetNamespace="http://inventory.ws.itso.ibm.com"    xmlns:reply="http://reply.inventory.ws.itso.ibm.com"    xmlns:request="http://request.inventory.ws.itso.ibm.com">   <xsd:import namespace="http://reply.inventory.ws.itso.ibm.com"    schemaLocation="InventoryReply.xsd"/>   <xsd:import namespace="http://request.inventory.ws.itso.ibm.com"    schemaLocation="InventoryRequest.xsd"/>   <xsd:element name="getDeliveryDate">    <xsd:complexType>     <xsd:sequence>      <xsd:element name="InventoryRequest" type="request:InventoryRequest"/>     </xsd:sequence>    </xsd:complexType>   </xsd:element>   <xsd:element name="getDeliveryDateResponse">    <xsd:complexType>     <xsd:sequence>      <xsd:element name="InventoryReply" type="reply:InventoryReply"/>     </xsd:sequence>    </xsd:complexType>   </xsd:element>   <xsd:element name="updateInventory">    <xsd:complexType>     <xsd:sequence>      <xsd:element name="InventoryRequest" type="request:InventoryRequest"/>     </xsd:sequence>    </xsd:complexType>   </xsd:element>  </xsd:schema> </wsdl:types> ... 
    end example

  6. Delete the service endpoint interface we created previously, com.ibm.itso.ws.inventory.InventoryDoc in ITSOTargetAppEJB\ejbModule. We have changed the WSDL for our service so it is no longer valid.

  7. Using the WSDL file we just created, generate the Web services deployment descriptors and classes using the WSDL2Java tool. We used the command shown in Example 9-6.

    Example 9-6: Generating server deployment descriptors and classes using WSDL2Java

    start example
     C:\WebSphere\AppServer\bin\WSDL2Java -verbose -role server -container ejb    -output C:\workspace\ITSOTargetAppEJB\ejbModule    C:\workspace\ITSOTargetAppEJB\ejbModule\META-INF\wsdl\InventoryDoc.wsdl WSWS3185I: Info: Parsing XML file: C:\...\wsdl\InventoryDoc.wsdl WSWS3282I: Info: Generating C:\...\itso\ws\inventory\UpdateInventory.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\UpdateInventory_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\UpdateInventory_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\UpdateInventory_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\InventoryReply.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\InventoryReply_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\InventoryReply_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\InventoryReply_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Header.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Header_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Header_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Header_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Body.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Body_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Body_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Body_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\InventoryRequest.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\InventoryRequest_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\InventoryRequest_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\InventoryRequest_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Header.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Header_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Header_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Header_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Body.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Body_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Body_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Body_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\InventoryDoc.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\InventoryDocSoapBindingImpl.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\InventoryDoc_RI.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\InventoryDocHome.java. WSWS3282I: Info: Generating C:\...\META-INF\webservices.xml. WSWS3282I: Info: Generating C:\...\META-INF\ibm-webservices-bnd.xmi. WSWS3282I: Info: Generating C:\...\META-INF\ibm-webservices-ext.xmi. WSWS3282I: Info: Generating C:\...\META-INF\InventoryDoc_mapping.xml. 
    end example

    Note 

    The deployment descriptors and class files will not be regenerated when the tool is re-run, unless the existing files have been removed first.

  8. Right-click the ITSOTargetAppEJB project and select Refresh. You should see the generated files shown in Figure 9-5.

    click to expand
    Figure 9-5: WSDL2Java generated files

    The webservices.xml deployment descriptor defines the set of Web services that are being deployed in the Web service-enabled J2EE container.

    Attention: 

    We found an error in the InventoryDoc_mapping.xml file generated by the WSDL2Java tool that resulted in the following exception when starting the application server hosting the Web service:

        java.io.IOException: WSWS3097E: Error: Emitter failure.  All input parts    must be listed in the parameterOrder attribute of updateInventory 

    To correct this problem, we added the following line to the mapping file to identify the updateInventory operation as wrapped:

        ...    <wsdl-operation>updateInventory</wsdl-operation>    <wrapped-element></wrapped-element>    <method-param-parts-mapping >    ... 

    Contact WebSphere technical support for details on P169766.

  9. Navigate to ITSOTargetAppEJB ejbModule folder ejbModule ejbModule folder META-INF and edit webservices.xml. Set the ejb-link element to Inventory, as shown in Example 9-7.

    Example 9-7: Updating webservices.xml

    start example
     ... <service-impl-bean>    <ejb-link>Inventory</ejb-link> </service-impl-bean> ... 
    end example

    The ejb-link element corresponds to the ejb-name element of the required EJB, as defined in ejb-jar.xml.

    Next we need to add methods to the EJB in our target application that will process the document style Web service requests.

  10. Open the generated service endpoint interface, com.ibm.itso.ws.inventory.InventoryDoc in the ITSOTargetAppEJB\ejbModule folder.

    Notice that the input parameter of the getDeliveryDate and updateInventory methods is now type InventoryRequest, and getDeliveryDate returns type InventoryReply, as shown in Example 9-8.

    Example 9-8: Generated InventoryDoc.java

    start example
     package com.ibm.itso.ws.inventory; import com.ibm.itso.ws.inventory.reply.InventoryReply; import com.ibm.itso.ws.inventory.request.InventoryRequest; public interface InventoryDoc extends java.rmi.Remote {    public InventoryReply getDeliveryDate(InventoryRequest inventoryRequest)       throws java.rmi.RemoteException;    public void updateInventory(InventoryRequest inventoryRequest)       throws java.rmi.RemoteException; } 
    end example

    The WSDL2Java tool has generated the InventoryRequest and InventoryReply classes so our application can access the XML request and reply documents.

    We also developed two additional classes, InventoryRequestBuilder and InventoryReplyBuilder, as constructor helpers for request and reply messages. See Example 9-9 for the source listing for InventoryRequestBuilder. These classes provide a reusable and streamlined interface for creating InventoryRequest and InventoryReply messages.

    Example 9-9: InventoryReplyBuilder.java

    start example
     package com.ibm.itso.ws.inventory; import com.ibm.itso.ws.inventory.reply.InventoryReply; import java.util.Calendar; import java.util.Date; public class InventoryReplyBuilder extends InventoryReply {    // message version number for Version element    private final int VERSION = 1;    public InventoryReplyBuilder(       String msgSource, String msgPartNumber, Date msgDeliveryDate) {       super();       com.ibm.itso.ws.inventory.reply.Header header =          new com.ibm.itso.ws.inventory.reply.Header();       header.setSourceName(msgSource);       header.setVersion(VERSION);       // set create date to the current date       header.setCreateDate(Calendar.getInstance());       super.setHeader(header);       com.ibm.itso.ws.inventory.reply.Body body =          new com.ibm.itso.ws.inventory.reply.Body();       body.setPartNumber(msgPartNumber);       body.setDeliveryDate(msgDeliveryDate);       super.setBody(body);    } } 
    end example

  11. Add the new getDeliveryDate and updateInventory methods from com.ibm.itso.ws.inventory.InventoryDoc to our target application EJB, com.ibm.itso.ejb.inventory.InventoryBean. See Example 9-10 for the source listing for getDeliveryDate.

    Example 9-10: Document style Web service server code for getDeliveryDate

    start example
     public InventoryReply getDeliveryDate(InventoryRequest reqMsg) {    InventoryReply repMsg = null;    String partNo = (reqMsg.getBody()).getPartNumber();    Date deliveryDate = getDeliveryDateObject(partNo);    repMsg = new InventoryReplyBuilder(APP_NAME, partNo, deliveryDate);    return repMsg; } 
    end example

  12. Promote the new EJB methods to the EJB Remote interface and regenerate the EJB deployment code.

  13. Export the ITSOTargetApp project to an EAR file, then run the endptEnabler command line tool to add an HTTP router module to the EAR file.

    You can use the same procedure we used for our RPC style Web service. See step 7 on page 165 to export the EAR file and step 8 on page 165 to run the endptEnabler tool.

  14. The HTTP router module also needs access to the XML schemas used, so add InventoryReply.xsd and InventoryRequest.xsd to the WEB-INF/wsdl folder in the ITSOTargetAppWeb module. You can do this using WebSphere Studio or the WebSphere Application Assembly Tool.

The EAR file is now ready to deploy in the IBM WebSphere Application Server V5.0.2 runtime.

Note 

The WebSphere V5.0.2 Web service deployment tools will not append new Web services to existing Web services deployment descriptors. If you need to deploy more than one Web service in a module, you will need to manually merge the Web service deployment descriptors.

9.4.2 Web service enabling the source application

See Figure 8-11 on page 167 for an overview of the Web service development process for a source application. Let's walk through this process for our source application.

Web service-enabling our source application is simply a matter of obtaining the WSDL and XML schema files for the target Web service, and running the WSDL2Java tool to generate the required deployment descriptors and proxy classes:

  1. Copy the target application WSDL and XML schema files to the source application Web module:

    1. Using WebSphere Studio, switch to the J2EE Perspective and click the Project Navigator tab.

    2. Copy the target application WSDL and XML schema files, InventoryDoc.wsdl, InventoryReply.xsd, and InventoryRequest.xsd from the ITSOTargetAppEJB/ejbModule/META-INF/wsdl folder to the ITSOSourceAppWeb/WebContent/WEB-INF/wsdl folder.

  2. Open a command window.

  3. Using the WSDL file created in step 1, generate the Web service client deployment descriptors and classes using the WSDL2Java tool. We used the command shown in Example 9-11.

    Example 9-11: Generating client deployment descriptors and classes using WSDL2Java

    start example
     C:\WebSphere\AppServer\bin\WSDL2Java -verbose -role client -container web    -output C:\workspace\ITSOSourceAppWeb\WebContent    C:\workspace\ITSOSourceAppWeb\WebContent\WEB-INF\wsdl\InventoryDoc.wsdl WSWS3185I: Info: Parsing XML file: C:\...\wsdl\InventoryDoc.wsdl WSWS3282I: Info: Generating C:\...\itso\ws\inventory\UpdateInventory.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\UpdateInventory_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\UpdateInventory_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\UpdateInventory_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\InventoryReply.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\InventoryReply_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\InventoryReply_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\InventoryReply_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Header.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Header_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Header_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Header_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Body.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Body_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Body_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\reply\Body_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\InventoryRequest.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\InventoryRequest_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\InventoryRequest_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\InventoryRequest_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Header.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Header_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Header_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Header_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Body.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Body_Helper.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Body_Ser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\request\Body_Deser.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\InventoryDocService.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\InventoryDocServiceLocator.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\InventoryDoc.java. WSWS3282I: Info: Generating C:\...\itso\ws\inventory\InventoryDocSoapBindingStub.java. WSWS3282I: Info: Generating C:\...\WEB-INF\webservicesclient.xml. WSWS3282I: Info: Generating C:\...\WEB-INF\ibm-webservicesclient-bnd.xmi. WSWS3282I: Info: Generating C:\...\WEB-INF\ibm-webservicesclient-ext.xmi. WSWS3282I: Info: Generating C:\...\WEB-INF\InventoryDoc_mapping.xml. 
    end example

  4. In WebSphere Studio, move the generated Java source files from the Web module's WebContent folder to its JavaSource folder:

    1. Right-click the ITSOSourceAppWeb project and select Refresh from the pop-up menu. The generated files should now appear in the Studio workspace.

    2. Move the com.ibm.itso.ws.inventory package in the ITSOSourceAppWeb\WebContent folder to the ITSOSourceAppWeb\JavaSource folder.

    The generated files are highlighted in Figure 9-6.

    click to expand
    Figure 9-6: Generated client binding files and deployment descriptors

    The webservicesclient.xml deployment descriptor defines the JNDI name for accessing the Web service and the associated service endpoint interface to be used.

  5. Add client application code to invoke the Web service on the target application.

    To invoke getDeliveryDate on the target application, we added the code shown in Example 9-12. We added this code to the com.ibm.itso.command. WebServiceDocBean command bean in our ITSOSourceAppWeb module.

    Example 9-12: Web service client code for getDeliveryDate

    start example
     public String getDeliveryDate(String partNumber) throws Exception {    String deliveryDate = null;    try {       Context ctx = new InitialContext();       InventoryDocService service = (InventoryDocService) ctx.lookup(          "java:comp/env/service/InventoryDocService");       // Request the Service Endpoint from the Service       InventoryDoc port = service.getInventoryDoc();       // Generate XML document for update inventory request       InventoryRequest reqMsg =          new InventoryRequestBuilder(APP_NAME, partNumber);       // Get the quote       InventoryReply repMsg = port.getDeliveryDate(reqMsg);       // Get the delivery date from the XML reply document       Date date = (repMsg.getBody()).getDeliveryDate();       SimpleDateFormat dateFormatter = new SimpleDateFormat(DATE_PATTERN);       deliveryDate = dateFormatter.format(date);    } catch (Exception e) {       //...    }    return deliveryDate; } 
    end example

  6. Test the source and target applications in the IBM WebSphere Studio Application Developer V5.1 test environment.

  7. Deploy the source and target applications in your IBM WebSphere Application Server V5.0.2 runtime environment to try the applications on separate machines.

The document style SOAP request for getDeliveryDate is shown in Example 9-13.

Example 9-13: SOAP request for getDeliveryDate

start example
 POST /ITSOTargetApp/services/InventoryDoc HTTP/1.0 Content-Type: text/xml; charset=utf-8 Accept: application/soap+xml, application/dime, multipart/related, text/* User-Agent: IBM WebServices/1.0 Host: localhost Cache-Control: no-cache Pragma: no-cache SOAPAction: "" Content-Length: 649 <?xml version="1.0" encoding="UTF-8"?>    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"       xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"       xmlns:xsd="http://www.w3.org/2001/XMLSchema"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">       <soapenv:Body>          <getDeliveryDate xmlns="http://inventory.ws.itso.ibm.com">             <InventoryRequest xmlns="http://request.inventory.ws.itso.ibm.com">                <Header>                   <SourceName>ITSOSourceApp</SourceName>                   <Version>1</Version>                   <CreateDate>2003-09-07T22:26:19.113Z</CreateDate>                </Header>                <Body>                   <PartNumber>12345</PartNumber>                </Body>             </InventoryRequest>          </getDeliveryDate>       </soapenv:Body>    </soapenv:Envelope> 
end example

The SOAP response for getDeliveryDate is shown in Example 9-14.

Example 9-14: SOAP response for getDeliveryDate

start example
 HTTP/1.1 200 OK Server: WebSphere Application Server/5.0 Content-Type: text/xml; charset=utf-8 Content-Language: en-US Connection: close <?xml version="1.0" encoding="UTF-8"?>    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"       xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"       xmlns:xsd="http://www.w3.org/2001/XMLSchema"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">       <soapenv:Body>          <getDeliveryDateResponse xmlns="http://inventory.ws.itso.ibm.com">             <InventoryReply xmlns="http://reply.inventory.ws.itso.ibm.com">                <Header>                   <SourceName>ITSOTargetApp</SourceName>                   <Version>1</Version>                   <CreateDate>2003-09-07T22:26:20.946Z</CreateDate>                </Header>                <Body>                   <PartNumber>12345</PartNumber>                   <DeliveryDate>2003-09-14</DeliveryDate>                </Body>             </InventoryReply>          </getDeliveryDateResponse>       </soapenv:Body>    </soapenv:Envelope> 
end example



 < Day Day Up > 



Patterns Direct Connections for Intra- And Inter-Enterprise. Direct Connections for Intra- And Inter-Enterprise (IBM Redbook) (Paperback)
Patterns Direct Connections for Intra- And Inter-Enterprise. Direct Connections for Intra- And Inter-Enterprise (IBM Redbook) (Paperback)
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 139

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net