WCF client to Java service hosted by WebSphere Application Server sample
Sample client applications and sample service proxy applications are supplied for WebSphere® Application Server 6. A request-response service is also provided.
Before you begin
| Object | Required name |
|---|---|
| Queue manager | QM1 |
| Local queue | HelloWorld |
| Local queue | HelloWorldReply |
After the WAS environment is configured, the following additional configuration steps must be completed:
- Create the following JNDI objects in the WebSphere Application Server JNDI repository:
- A JMS queue destination called HelloWorld
- Set the JNDI name to jms/HelloWorld
- Set the queue name to HelloWorld
- A JMS queue connection factory called HelloWorldQCF
- Set the JNDI name to jms/HelloWorldQCF
- Set the queue manager name to QM1
- A JMS queue connection factory called WebServicesReplyQCF
- Set the JNDI name to jms/WebServicesReplyQCF
- Set the queue manager name to QM1
- A JMS queue destination called HelloWorld
- Create a Message Listener Port called HelloWorldPort in WebSphere Application Server
with the following configuration:
- Set the connection factory JNDI name to jms/HelloWorldQCF
- Set the destination JNDI name to jms/HelloWorld
- Install the web service HelloWorldEJBEAR.ear application
to your WebSphere Application
Server as follows:
- Click .
- Navigate to MQ_INSTALLATION_PATH\tools\wcf\samples\WAS\HelloWorldsEJBEAR.ear where MQ_INSTALLATION_PATH is the installation directory of IBM MQ.
- Do not change any of the default option in the wizard, and restart the application server after the application has been installed.
- Navigate to your Soap over JMS working directory.
- Enter this command to run the sample: MQ_INSTALLATION_PATH \tools\wcf\samples\WAS\TestClient.exe where MQ_INSTALLATION_PATH is the installation directory of IBM MQ.
About this task
The client has been generated by using the svcutil tool to retrieve the service metadata from a separately exposed HTTP endpoint as described in Generating a WCF client proxy and application configuration files using the svcutil tool with metadata from a running service
The sample has been configured with specific resource names as described in the following procedure. If you need to change the resource names, then you must also change the corresponding value on the client application in the MQ_INSTALLATION_PATH \tools\wcf\samples\WAS\default\client\app.config file, and on the service application in the MQ_INSTALLATION_PATH \tools\wcf\samples\WAS\HelloWorldsEJBEAR.ear where MQ_INSTALLATION_PATH is the installation directory of IBM MQ.
The service and client are based upon the service and client outlined in the IBM Developer article Building a JMS web service using SOAP over JMS and WebSphere Studio. For more information about developing SOAP over JMS web services that are compatible with the IBM MQ WCF custom channel, see https://www.ibm.com/developerworks/websphere/library/techarticles/0402_du/0402_du.html.