Section 10.10. Set the Web Service URL


10.10. Set the Web Service URL

We want to use a meaningful URL that matches our Web Services namespacejbossatwork-ws. So we modify jboss.xml in Example 10-6 (the JBoss-specific EJB deployment descriptor) as follows.

Example 10-6. jboss.xml
 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN"                        "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd"> <jboss>   <enterprise-beans>     ...     <session>       <ejb-name>InventoryFacade</ejb-name>       <port-component>         <port-component-name>Inventory</port-component-name>         <port-component-uri>jbossatwork-ws/InventoryService</port-component-uri>       </port-component>       ...     </session>     ...   </enterprise-beans>   ... </jboss> 

The <port-component>element and its sub-elements tell JBoss to deploy our WSDL to the jbossatwork-ws namespace at the following URL:

http://localhost:8080/jbossatwork-ws/InventoryService?wsdl

Although modifying the jboss.xml file to set the URL is helpful, it is purely optional. You could successfully deploy a Web Service without changing jboss.xml.

At this point we've shown all the Web Services -related deployment descriptors. We now have to upgrade InventoryFacadeBean to expose its findAvailableCars( ) method as a Web Service.



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