Workbook 15 delta

Exercise 19.1: Exposing a Stateless Bean

Instead of using the complete client side wrapper of the application server I decided to make the client more detached from the application server. In case very tight coupling is desirable it would make more sense to use @Remote interfaces instead of a webservice (the CORBA interface would be needed for the JNDI coupling in any case).

In order to perform the exercise first the webservice must be deployed. After deployment the webservice interface can be viewed by going to the wsdl file located at. http://localhost:8020/TravelAgentService/TravelAgent?WSDL

After the wsdl file becomes available the client stubs can be generated. The client stubs are generated using thw wsimport / wsimport.bat scripts. Now the client can be compiled and run.

In order to view the arguments and return types one has to open the xsd file mentioned in the wsdl file. When looking at the generated wsdl one major difference shows. While in the jboss generated wsdl the parameters that can be null have a nillable=”true” attribute, the parameters that can be null in the xsd file as generated by Glassfish have a minOccurs=”0”.

<xs:complexType name="createCabin">


<xs:element name="Cabin" type="tns:cabin" minOccurs="0"/>



As can be seen in the adapted client, the client is now actually simpler than the original client in chapter 4. In case the client must be run on a different computer than the localhost (or more general, the webservice is at another URL than the URL as provided when creating the client stubs) the other TravelAgentService Constructor using the URL and the QName need to be used. The URL must point to the new webservice url, the QName should still have the same vale. As opposed to the example in the book, no client side deployment descriptors are necessary.

Exercise 19.2: Using a .NET Client

In this exercise the webservice is actually identical to the webservice in Exercise 19.1. Still the webservice needs to be undeployed and redeployed to clear the database.

The client binding for the WSDL is generated using the .net wsdl command with as argument the url of the wsdl file. (in this case wsdl http://localhost:8020/TravelAgentService/TravelAgent?WSDL). Then the files are compiled and the client application is run.

Back to the index Further to found bugs and features.

UUIDs and information about UUIDs
If you have improvements, contact information on the homepage of this host.
The uptime of this host

Search for more information :