OK, so I'm a little familiar with this code and there are a couple of
relevant things:

1. it should be init(ServiceContext sc) not MessageContext which may
be why init isn't being called. You may be able to get what you want
from the ServiceContext depending on what you're looking for.

2. DependencyManager.configureBusinessLogicProvider causes
setOperationContext(OperationContext oc) to be called on the
implementation class if it exists. From this you gan get the
associated MessageContext(s).

Hope that helps,
David

On 01/08/06, Nirmit Desai <[EMAIL PROTECTED]> wrote:

Hi all,

I have generated my implementation class from a WSDL and added the
following method:

private MessageContext msgCtx=null;

public void init(MessageContext ctx){
      msgCtx=ctx;
      System.out.println("init called..context:"+ctx);
}

But, the init method is never called!! (I checked the service logs for
output, and I see other System outs). Due to that the service methods throw
a null pointer exception when trying to access msgCtx.

I read somewhere that a MessageReceiver is supposed to call the init
method. WSDL2Java generates a custom message receiver for every service
(Axis Data binding). I looked inside my message receiver and it does not
seem to be making any calls before calling the service methods except this
one:

//Inject the Message Context if it is asked for
org.apache.axis2.engine.DependencyManager.configureBusinessLogicProvider
(obj, msgContext.getOperationContext());

Any clues why init is not being called?

Thanks,

-Nirmit


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
David Illsley - IBM Web Services Development

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to