|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.test.echomessageservice.ejb20.EchoMessageWSBean
public class EchoMessageWSBean
EchoMessageWSBean stateless session bean is configured as a test web service with the following methods:
| Field Summary | |
|---|---|
protected java.text.SimpleDateFormat |
sdf
|
| Constructor Summary | |
|---|---|
EchoMessageWSBean()
|
|
| Method Summary | |
|---|---|
void |
consumeMessage(java.lang.String xmlMessageText)
Consume a message - no reply. |
java.lang.String |
echoMessage(java.lang.String xmlMessageText)
Echo message to the caller. |
java.lang.String |
echoMessageWithAttachments(java.lang.String xmlMessageText)
Echo message and attachments to the caller. |
java.lang.String |
echoMessageWithSecurity(java.lang.String xmlMessageText)
Echo message to the caller. |
void |
echoMessageWithWSAddressingReplyTo(java.lang.String xmlMessageText)
Send the received message to a web service identified by a ReplyTo, ws-addresssing, EndpointReference in the SOAPHeader. |
void |
ejbActivate()
|
void |
ejbCreate()
ejbCreate(). |
void |
ejbPassivate()
|
void |
ejbRemove()
|
javax.ejb.SessionContext |
getSessionContext()
|
void |
receiveWSReplyMessage(java.lang.String xmlMessageText)
receiveWSReplyMessage() is exposed as a web service to receive the message sent by echoMessageWithWSAddressingReplyTo(). |
void |
setSessionContext(javax.ejb.SessionContext sessionContext)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.text.SimpleDateFormat sdf
| Constructor Detail |
|---|
public EchoMessageWSBean()
| Method Detail |
|---|
public java.lang.String echoMessage(java.lang.String xmlMessageText)
throws java.lang.Exception
xmlMessageText - The received XML message.
java.lang.Exception - if called with empty messageText.
public void consumeMessage(java.lang.String xmlMessageText)
throws java.lang.Exception
xmlMessageText - The received XML message.
java.lang.Exception - if called with empty messageText.
public java.lang.String echoMessageWithSecurity(java.lang.String xmlMessageText)
throws java.lang.Exception
xmlMessageText - The received XML message.
java.lang.Exception - if called with empty xmlMessageText or if there
is an error during the security processing.
public void echoMessageWithWSAddressingReplyTo(java.lang.String xmlMessageText)
throws java.lang.Exception
<ReplyTo
EndpointReference that is part of the jaxrpcWSAddressingConfiguration.
There are two ways to construct and send a message to the <wsa:ReplyTo>
destination, depending on the entries in the <MetaData> tag of the
<wsa:ReplyTo> EndpointReference:
<MetaData> tag of the <wsa:ReplyTo> EndpointReference
to carry JAXRPCConfiguration, which is used to construct a JAXRPCDynamicClient
to send the reply. The problem with this approach is that JAXRPCDynamicClient
sets properties on the jax-rpc Call object and some SOAP engines, like
WLS 8.1.x, do not support programmer-defined Call object properties. So in
order to use this approach in WLS 8.1.x, Axis has to be configured as the
SOAP client and this involves the adding Axis jars to the front of
the class path that WLS is loaded with. This effects all applications in
that server instance and is unacceptable solution for WLS 8.1.x. The
advantages to this approach are 1) the WSDL of the target end point is
used to send the reply, 2) JAXRPCDynamicClient(s) can be pooled
and 3) the jax-rpc client pool configurations can include jax-rpc handlers.<operationName> and <targetNamespace> elements
in the <wsa:MetaData> tag of the <wsa:ReplyTo> content
model to construct the reply SOAPMessage using rpc-style invocation.
Then use a SOAPConnectionFactory to create a SOAPConnection and invoke
the call() method passing the address and the reply SOAPMessage. The advantage
to this approach is that it does not require any special features and should
be universally supported by SOAP engines.
xmlMessageText - The received XML message.
java.lang.Exception - if called with empty xmlMessageText or if there
is an error during the ws-addressing processing.
public void receiveWSReplyMessage(java.lang.String xmlMessageText)
throws java.lang.Exception
xmlMessageText - The received XML message.
java.lang.Exception - if called with empty xmlMessageText.
public java.lang.String echoMessageWithAttachments(java.lang.String xmlMessageText)
throws java.lang.Exception
xmlMessageText - The received XML message.
java.lang.Exception - if called with empty xmlMessageText or if there
is an error during attachment processing.
public void ejbCreate()
throws javax.ejb.CreateException
javax.ejb.CreateExceptionpublic void ejbRemove()
ejbRemove in interface javax.ejb.SessionBeanpublic void ejbActivate()
ejbActivate in interface javax.ejb.SessionBeanpublic void ejbPassivate()
ejbPassivate in interface javax.ejb.SessionBeanpublic javax.ejb.SessionContext getSessionContext()
public void setSessionContext(javax.ejb.SessionContext sessionContext)
setSessionContext in interface javax.ejb.SessionBean
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||