Section 10.4. Implementing J2EE 1.4 Web Services


10.4. Implementing J2EE 1.4 Web Services

To expose the InventoryFacadeBean's findAvailableCars( ) method as a J2EE 1.4-compliant Web Service, we need to do the following:

  • Create a Service Endpoint Interface (SEI ) to expose EJB methods as Web Service operations.

  • Add a <service-endpoint> element to ejb-jar.xml to tell JBoss that the InventoryFacadeBean EJB implements the InventoryEndpoint Service Endpoint Interface.

  • Generate the webservices.xml to register the Web Service and tie the InventoryEndpoint Service Endpoint Interface to an implementation the InventoryFacadeBean.

  • Create the JAX-RPC Mapping File to define JAX-RPC type mappings for the parameters and return values for the InventoryEndpoint's methods.

  • Generate the WSDL to define the Web Service and tie it to XML Schema data types.

  • Set the Web Service URL by modifying jboss.xml with the Inventory Web Service URL.

  • Modify the InventoryFacadeBean:

    • Add Web Services-related XDoclet tags.

    • Add the findAvailableCars( ) method and use an XML Schema-compatible data type.%

  • Upgrade Deployment by modifying the Ant build script:

    • Fix XDoclet-generated descriptors.

    • Modify the Web Service URL in jboss.xml.

    • Use JWSDP to generate the JAX-RPC and WSDL files.

As you'll see in the upcoming sections, the extra interface and descriptors required to deploy a Web Service are tedious and would be almost impossible to develop by hand. But don't lose heartwe can automate Web Service deployment with a combination of Ant, XDoclet, and JWSDP. However, before we show our new deployment process, it's important to know what we're automatinglet's start with the Service Endpoint Interface.



JBoss at Work. A Practical Guide
JBoss at Work: A Practical Guide
ISBN: 0596007345
EAN: 2147483647
Year: 2004
Pages: 197

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