Building a JMS Client

To build a client that exchanges messages with a WebLogic Workshop web service over a JMS queue, you need to configure the client so that it can connect to the queue. Import the javax.naming class and create a new InitialContext object with the properties shown in the following table:

Property String Setting
SECURITY_PRINCIPAL User or principal name; default is "system"
SECURITY_CREDENTIALS Principal password; default is "password"
INITIAL_CONTEXT_FACTORY Principal password; default is "password"
PROVIDER_URL Host URL, using the t3 protocol (e.g., "t3://localhost:7001")

The queue name is jws.queue.

The message that you send to the web service must be a TextMessage object containing XML. If the web service is asynchronous, then the XML in the message must be SOAP-formatted and must include the SOAP headers to support conversations. For more information on conversational SOAP headers, see Conversing with Non-Workshop Clients.

The message must also have a String property named URI that points to the web service. For example, if the URL to the web service is t3://localhost:7001/samples/JMSService.jws, set the URI property to /samples/JMSService.jws.

For more information on building a JMS client, see Developing a WebLogic JMS Application on e-docs.bea.com.

Related Topics

Conversing with Non-Workshop Clients

How Do I: Tell Developers of Non-WebLogic Workshop Clients How to Participate in Conversations?