You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ali Sadik Kumlali <as...@yahoo.com> on 2006/04/11 00:01:50 UTC

[Axis2][0.95] How can I know before sending it?

Hi all,

At the service side, I can get MessageID that is sent by the client by
invoking ctx.getMessageID(). What I need is to be able to know
MessageID that my service is going to send as a response. Actually,
what I need is a method like ctx.getMessageIDToBeSent(). 

AFAIK, it is not produced until it enters into the WSA module.
Therefore, in my service, I do not have the MessageID yet. Am I wrong?
If no, is there a way to do this? 

Thanks a lot,

Ali Sadik Kumlali

P.S.: Apologies for my previous HTML posts. I hadn't seen Mail
Guideline found in http://ws.apache.org/axis2/guidelines.html

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: [Axis2][0.95] How can I know before sending it?

Posted by Ali Sadik Kumlali <as...@yahoo.com>.
Thanks Eran. It has worked perfectly for 0.95.

Ali Sadik Kumlali

--- Eran Chinthaka <ch...@opensource.lk> wrote:

> Hi Ali,
> 
> Ali Sadik Kumlali wrote:
> > Hi all,
> > 
> > At the service side, I can get MessageID that is sent by the client
> by
> > invoking ctx.getMessageID(). What I need is to be able to know
> > MessageID that my service is going to send as a response. Actually,
> > what I need is a method like ctx.getMessageIDToBeSent(). 
> > AFAIK, it is not produced until it enters into the WSA module.
> > Therefore, in my service, I do not have the MessageID yet. Am I
> wrong?
> > If no, is there a way to do this? 
> 
> Nope, the message id is set to the out message context, inside the
> message receiver. And then that message context *may* be passed in to
> the service implementation class.
> 
> If you wanna know the sending messageId, get access to the out
> message
> context, within the service class and override the messageId value.
> 
> How to get access to the out message context ?
> 
> In 0.95, introduce a method in ur service implementation class
> 
> public void init(MessageContext inMsgCtxt, MessageContext inMsgCtxt){
>  // ur code here
> }
> 
> In 1.0 RC1, introduce a method in ur service implementation class
> 
> public void setOperationContext(OperationContext opCtxt){
>   MessageContext outMsgCtxt =
> opCtxt.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
> 
> // your code here
> }
> 
> 
> -- Chinthaka
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: [Axis2][0.95] How can I know before sending it?

Posted by Eran Chinthaka <ch...@opensource.lk>.
Hi Ali,

Ali Sadik Kumlali wrote:
> Hi all,
> 
> At the service side, I can get MessageID that is sent by the client by
> invoking ctx.getMessageID(). What I need is to be able to know
> MessageID that my service is going to send as a response. Actually,
> what I need is a method like ctx.getMessageIDToBeSent(). 
> AFAIK, it is not produced until it enters into the WSA module.
> Therefore, in my service, I do not have the MessageID yet. Am I wrong?
> If no, is there a way to do this? 

Nope, the message id is set to the out message context, inside the
message receiver. And then that message context *may* be passed in to
the service implementation class.

If you wanna know the sending messageId, get access to the out message
context, within the service class and override the messageId value.

How to get access to the out message context ?

In 0.95, introduce a method in ur service implementation class

public void init(MessageContext inMsgCtxt, MessageContext inMsgCtxt){
 // ur code here
}

In 1.0 RC1, introduce a method in ur service implementation class

public void setOperationContext(OperationContext opCtxt){
  MessageContext outMsgCtxt =
opCtxt.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);

// your code here
}


-- Chinthaka