You can pass information in the MessageContext itself using
the MessageContext.setProperty(String, Object) in the handler and then
using
the MessageContext.getProperty(String) in the Service or Client.
// Example Handler Code
public void invoke(MessageContext msgContext) throws AxisFault
{
System.out.println("Inside Handler");
msgContext.setProperty("SomeReference", "Some Text if String");
// Could be any object not just string
}
// Example Service Code
MessageContext ctx = MessageContext.getCurrentContext();
String SomeReference = (String) ctx.getProperty("SomeReference");
System.out.println("SomeReference = " + SomeReference); // You
should get 'Some Text if String'
I've only tested this server side, but it should work client side as well.
Hope this helps,
Mark A. Malinoski
AES/PHEAA
Technical Coordinator/Web Development
717-720-2413
[EMAIL PROTECTED]
Robert Gombotz
<[EMAIL PROTECTED]
mail.com> To
[email protected], Mik
04/21/2005 09:34 Goodhelp <[EMAIL PROTECTED]>
AM cc
Subject
Please respond to Re: How to pass information between
[EMAIL PROTECTED] handlers and services.
he.org
as far as I know there is no way for a handler to talk to a WS
directly. but you can get the message inside your WS implementation:
in your WS you can get the soap message using
org.apache.axis.MessageContext.getCurrentContext() which gives you an
object of type MessageContext. that you can use just like in your
handlers, so just retrieve any info fram the message you want.
hope I could be of help.
Rob
On 4/21/05, Mik Goodhelp <[EMAIL PROTECTED]> wrote:
> I am trying to implement an application that does the following.
> Assume we have a client :
>
> startSomething(XMLFLAG)
> call.invoke(EndpointReference_1)
> call.invoke(EndpointReference_2)
> call.invoke(EndpointReference_3)
>
> An Handler has to intercept the different calls and put the XMLFLAG in
> the SOAPHeader of all the calls.
>
> On the Provider side an Handler has to intercept the call, get the
> XMLFLAG from the SOAPHeader and pass it to the provider service.
>
> In simple words there is a way to directly pass information between
> Client-Services and Client-Handlers and between Provider-Handlers and
> Provider-Services
> ???
> Thanks in advance.
>