RE: [Axis2] How to get MessageContext
Hi Tony, It may be WSDLConstants.MESSAGE_LABEL_IN_VALUE for example. Here is the code I use to get both input and output message context. Note that output context is available only if WSDL contains output message for the operation. private MessageContext inMsgCtx, outMsgCtx; ... public void setOperationContext(OperationContext opctx) throws AxisFault { inMsgCtx = opctx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE); outMsgCtx = opctx.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE); } ... Hope this helps. Ali Sadik Kumlali --- Tony Dean <[EMAIL PROTECTED]> wrote: > If you use > > public void setOperationContext(OperationContext opctx) { > } > > in your impl class to get the OperationContext, how do you get the > messageContext from it? > > HashMap messageContexts = opctx.getMessageContexts() - explain more > than one message context? > MessageContext messageContext = opctx.getMessageContext(String) - > explain what input string is? > > Thanks. > > -Original Message- > From: Ali Sadik Kumlali [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 03, 2006 1:45 PM > To: axis-user@ws.apache.org > Subject: RE: [Axis2] How to get MessageContext > > Hi Michael, > > Depends. It works with 0.95 and does not work with RC1 and later > releases. > > I'm sure, Axis2 Team is going to update the document with the > announcement of 1.0 release (if it's not updated for RCx releases > yet). > > Regards, > > Ali Sadik Kumlali > > --- Michael Robinson <[EMAIL PROTECTED]> wrote: > > > Does this mean that the example at > > http://ws.apache.org/axis2/0_95/mtom-guide.html does not work? The > > section titled "SOAP with Attachments (SwA) with Axis2" has a code > > fragment that seems to use an init method to set the MessageContext > > > instead of a setter method. Is this incorrect? > > > > -----Original Message- > > From: Ruchith Fernando [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, May 03, 2006 7:47 AM > > To: axis-user@ws.apache.org > > Subject: Re: [Axis2] How to get MessageContext > > > > An example for such a service impl class is here : [1] > > > > Thanks, > > Ruchith > > > > [1] > > > https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/se > > curity/interop/org/apache/axis2/oasis/ping/PingPortSkeleton.java > > > > On 5/3/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote: > > > ya , just add that method in to service impl class and that > method > > will > > > be called using java reflection. So you can keep a ref to > > > operatoionConetx in side your class instance. And when you get > the > > > actual method call you can access that. > > > > > > Michele Mazzucco wrote: > > > > > > >Hi Deepal, > > > > > > > >could you be more explicit please? Do you mean > > > > > > > >public void setOperationContext(OperationContext opctx) { > > > > // empty content > > > >} > > > > > > > >(and I don't need to call it)? > > > > > > > > > > > >Michele > > > > > > > >Deepal Jayasinghe wrote: > > > > > > > > > > > >>you have to add a method called > > > >>setOperationContext(OperationContext opctx) { } > > > >> > > > >>in to your sevrice impl class , and that method will be called > > whenever > > > >>you get a req . Using opctx you can get the messagecontext > > > >> > > > >> > > > >>Michele Mazzucco wrote: > > > >> > > > >> > > > >> > > > >>>Hi all, > > > >>> > > > >>>how can I get the MessageContext from a OMelement? > > > >>>(I'm using the primary interface APIs, that is my methods have > > the > > > >>>following signature: > > > >>> > > > >>>OMelement operation(OMElement arg1, OMElelent arg2,..., > > OMElement > > argN) { > > > >>> ... > > > >>>} > > > >>> > > > >>>) > > > >>> > > > >>> > > > >>> > > > >>>Thanks, > > > >>>Michele > >
RE: [Axis2] How to get MessageContext
If you use public void setOperationContext(OperationContext opctx) { } in your impl class to get the OperationContext, how do you get the messageContext from it? HashMap messageContexts = opctx.getMessageContexts() - explain more than one message context? MessageContext messageContext = opctx.getMessageContext(String) - explain what input string is? Thanks. -Original Message- From: Ali Sadik Kumlali [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 1:45 PM To: axis-user@ws.apache.org Subject: RE: [Axis2] How to get MessageContext Hi Michael, Depends. It works with 0.95 and does not work with RC1 and later releases. I'm sure, Axis2 Team is going to update the document with the announcement of 1.0 release (if it's not updated for RCx releases yet). Regards, Ali Sadik Kumlali --- Michael Robinson <[EMAIL PROTECTED]> wrote: > Does this mean that the example at > http://ws.apache.org/axis2/0_95/mtom-guide.html does not work? The > section titled "SOAP with Attachments (SwA) with Axis2" has a code > fragment that seems to use an init method to set the MessageContext > instead of a setter method. Is this incorrect? > > -Original Message- > From: Ruchith Fernando [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 03, 2006 7:47 AM > To: axis-user@ws.apache.org > Subject: Re: [Axis2] How to get MessageContext > > An example for such a service impl class is here : [1] > > Thanks, > Ruchith > > [1] > https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/se > curity/interop/org/apache/axis2/oasis/ping/PingPortSkeleton.java > > On 5/3/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote: > > ya , just add that method in to service impl class and that method > will > > be called using java reflection. So you can keep a ref to > > operatoionConetx in side your class instance. And when you get the > > actual method call you can access that. > > > > Michele Mazzucco wrote: > > > > >Hi Deepal, > > > > > >could you be more explicit please? Do you mean > > > > > >public void setOperationContext(OperationContext opctx) { > > > // empty content > > >} > > > > > >(and I don't need to call it)? > > > > > > > > >Michele > > > > > >Deepal Jayasinghe wrote: > > > > > > > > >>you have to add a method called > > >>setOperationContext(OperationContext opctx) { } > > >> > > >>in to your sevrice impl class , and that method will be called > whenever > > >>you get a req . Using opctx you can get the messagecontext > > >> > > >> > > >>Michele Mazzucco wrote: > > >> > > >> > > >> > > >>>Hi all, > > >>> > > >>>how can I get the MessageContext from a OMelement? > > >>>(I'm using the primary interface APIs, that is my methods have > the > > >>>following signature: > > >>> > > >>>OMelement operation(OMElement arg1, OMElelent arg2,..., > OMElement > argN) { > > >>> ... > > >>>} > > >>> > > >>>) > > >>> > > >>> > > >>> > > >>>Thanks, > > >>>Michele > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > > > > > > > > > > > > > > > > -- > > Thanks, > > Deepal > > > > ~Future is Open~ > > > > > > > > - > This e-mail and any files transmitted with it are intended solely for > the use of the entity or individual(s) to whom they are addressed and > not for reliance upon by unintended recipients. If you are not the > intended recipient or the person responsible for delivering the e-mail > to the intended recipient be advised that you have received this > e-mail in error and that any use, dissemination, forwarding, printing, > or copying of this e-mail and any files transmitted are strictly > prohibited. If you have received this e-mail in error please delete > the entire email and immediately notify us by email to the sender or > by telephone to the AOC main office number, (404) 656-5171. Thank you. > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
RE: [Axis2] How to get MessageContext
Hi Michael, Depends. It works with 0.95 and does not work with RC1 and later releases. I'm sure, Axis2 Team is going to update the document with the announcement of 1.0 release (if it's not updated for RCx releases yet). Regards, Ali Sadik Kumlali --- Michael Robinson <[EMAIL PROTECTED]> wrote: > Does this mean that the example at > http://ws.apache.org/axis2/0_95/mtom-guide.html does not work? The > section titled "SOAP with Attachments (SwA) with Axis2" has a code > fragment that seems to use an init method to set the MessageContext > instead of a setter method. Is this incorrect? > > -Original Message- > From: Ruchith Fernando [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 03, 2006 7:47 AM > To: axis-user@ws.apache.org > Subject: Re: [Axis2] How to get MessageContext > > An example for such a service impl class is here : [1] > > Thanks, > Ruchith > > [1] > https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/se > curity/interop/org/apache/axis2/oasis/ping/PingPortSkeleton.java > > On 5/3/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote: > > ya , just add that method in to service impl class and that method > will > > be called using java reflection. So you can keep a ref to > > operatoionConetx in side your class instance. And when you get the > > actual method call you can access that. > > > > Michele Mazzucco wrote: > > > > >Hi Deepal, > > > > > >could you be more explicit please? Do you mean > > > > > >public void setOperationContext(OperationContext opctx) { > > > // empty content > > >} > > > > > >(and I don't need to call it)? > > > > > > > > >Michele > > > > > >Deepal Jayasinghe wrote: > > > > > > > > >>you have to add a method called > > >>setOperationContext(OperationContext opctx) { > > >>} > > >> > > >>in to your sevrice impl class , and that method will be called > whenever > > >>you get a req . Using opctx you can get the messagecontext > > >> > > >> > > >>Michele Mazzucco wrote: > > >> > > >> > > >> > > >>>Hi all, > > >>> > > >>>how can I get the MessageContext from a OMelement? > > >>>(I'm using the primary interface APIs, that is my methods have > the > > >>>following signature: > > >>> > > >>>OMelement operation(OMElement arg1, OMElelent arg2,..., > OMElement > argN) { > > >>> ... > > >>>} > > >>> > > >>>) > > >>> > > >>> > > >>> > > >>>Thanks, > > >>>Michele > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> > > > > > > > > > > > > > > > > -- > > Thanks, > > Deepal > > > > ~Future is Open~ > > > > > > > > - > This e-mail and any files transmitted with it are intended solely > for the use of the entity or individual(s) to whom they are > addressed and not for reliance upon by unintended recipients. If > you are not the intended recipient or the person responsible for > delivering the e-mail to the intended recipient be advised that you > have received this e-mail in error and that any use, dissemination, > forwarding, printing, or copying of this e-mail and any files > transmitted are strictly prohibited. If you have received this > e-mail in error please delete the entire email and immediately > notify us by email to the sender or by telephone to the AOC main > office number, (404) 656-5171. Thank you. > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
RE: [Axis2] How to get MessageContext
Does this mean that the example at http://ws.apache.org/axis2/0_95/mtom-guide.html does not work? The section titled "SOAP with Attachments (SwA) with Axis2" has a code fragment that seems to use an init method to set the MessageContext instead of a setter method. Is this incorrect? -Original Message- From: Ruchith Fernando [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 7:47 AM To: axis-user@ws.apache.org Subject: Re: [Axis2] How to get MessageContext An example for such a service impl class is here : [1] Thanks, Ruchith [1] https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/se curity/interop/org/apache/axis2/oasis/ping/PingPortSkeleton.java On 5/3/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote: > ya , just add that method in to service impl class and that method will > be called using java reflection. So you can keep a ref to > operatoionConetx in side your class instance. And when you get the > actual method call you can access that. > > Michele Mazzucco wrote: > > >Hi Deepal, > > > >could you be more explicit please? Do you mean > > > >public void setOperationContext(OperationContext opctx) { > > // empty content > >} > > > >(and I don't need to call it)? > > > > > >Michele > > > >Deepal Jayasinghe wrote: > > > > > >>you have to add a method called > >>setOperationContext(OperationContext opctx) { > >>} > >> > >>in to your sevrice impl class , and that method will be called whenever > >>you get a req . Using opctx you can get the messagecontext > >> > >> > >>Michele Mazzucco wrote: > >> > >> > >> > >>>Hi all, > >>> > >>>how can I get the MessageContext from a OMelement? > >>>(I'm using the primary interface APIs, that is my methods have the > >>>following signature: > >>> > >>>OMelement operation(OMElement arg1, OMElelent arg2,..., OMElement argN) { > >>> ... > >>>} > >>> > >>>) > >>> > >>> > >>> > >>>Thanks, > >>>Michele > >>> > >>> > >>> > >>> > >>> > >>> > > > > > > > > > > -- > Thanks, > Deepal > > ~Future is Open~ > > > - This e-mail and any files transmitted with it are intended solely for the use of the entity or individual(s) to whom they are addressed and not for reliance upon by unintended recipients. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing, or copying of this e-mail and any files transmitted are strictly prohibited. If you have received this e-mail in error please delete the entire email and immediately notify us by email to the sender or by telephone to the AOC main office number, (404) 656-5171. Thank you.
Re: [Axis2] How to get MessageContext
An example for such a service impl class is here : [1] Thanks, Ruchith [1] https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/oasis/ping/PingPortSkeleton.java On 5/3/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote: ya , just add that method in to service impl class and that method will be called using java reflection. So you can keep a ref to operatoionConetx in side your class instance. And when you get the actual method call you can access that. Michele Mazzucco wrote: >Hi Deepal, > >could you be more explicit please? Do you mean > >public void setOperationContext(OperationContext opctx) { > // empty content >} > >(and I don't need to call it)? > > >Michele > >Deepal Jayasinghe wrote: > > >>you have to add a method called >>setOperationContext(OperationContext opctx) { >>} >> >>in to your sevrice impl class , and that method will be called whenever >>you get a req . Using opctx you can get the messagecontext >> >> >>Michele Mazzucco wrote: >> >> >> >>>Hi all, >>> >>>how can I get the MessageContext from a OMelement? >>>(I'm using the primary interface APIs, that is my methods have the >>>following signature: >>> >>>OMelement operation(OMElement arg1, OMElelent arg2,..., OMElement argN) { >>> ... >>>} >>> >>>) >>> >>> >>> >>>Thanks, >>>Michele >>> >>> >>> >>> >>> >>> > > > > -- Thanks, Deepal ~Future is Open~
Re: [Axis2] How to get MessageContext
Hi, this is called dependency injection. The Axis2 runtime will call the method and pump in the correct opContext. You'll have to grab the needed message context when that happens so you better have some code that assigns the needed message context to a private variable inside that method! Note that this method is called before your business methods so it is safe to assume that opcontext will be presented to you before anything else On 5/3/06, Michele Mazzucco <[EMAIL PROTECTED]> wrote: Hi Deepal, could you be more explicit please? Do you mean public void setOperationContext(OperationContext opctx) { // empty content } (and I don't need to call it)? Michele Deepal Jayasinghe wrote: > you have to add a method called > setOperationContext(OperationContext opctx) { > } > > in to your sevrice impl class , and that method will be called whenever > you get a req . Using opctx you can get the messagecontext > > > Michele Mazzucco wrote: > >> Hi all, >> >> how can I get the MessageContext from a OMelement? >> (I'm using the primary interface APIs, that is my methods have the >> following signature: >> >> OMelement operation(OMElement arg1, OMElelent arg2,..., OMElement argN) { >> ... >> } >> >> ) >> >> >> >> Thanks, >> Michele >> >> >> >> > -- Ajith Ranabahu
Re: [Axis2] How to get MessageContext
ya , just add that method in to service impl class and that method will be called using java reflection. So you can keep a ref to operatoionConetx in side your class instance. And when you get the actual method call you can access that. Michele Mazzucco wrote: >Hi Deepal, > >could you be more explicit please? Do you mean > >public void setOperationContext(OperationContext opctx) { > // empty content >} > >(and I don't need to call it)? > > >Michele > >Deepal Jayasinghe wrote: > > >>you have to add a method called >>setOperationContext(OperationContext opctx) { >>} >> >>in to your sevrice impl class , and that method will be called whenever >>you get a req . Using opctx you can get the messagecontext >> >> >>Michele Mazzucco wrote: >> >> >> >>>Hi all, >>> >>>how can I get the MessageContext from a OMelement? >>>(I'm using the primary interface APIs, that is my methods have the >>>following signature: >>> >>>OMelement operation(OMElement arg1, OMElelent arg2,..., OMElement argN) { >>> ... >>>} >>> >>>) >>> >>> >>> >>>Thanks, >>>Michele >>> >>> >>> >>> >>> >>> > > > > -- Thanks, Deepal ~Future is Open~
Re: [Axis2] How to get MessageContext
Hi Deepal, could you be more explicit please? Do you mean public void setOperationContext(OperationContext opctx) { // empty content } (and I don't need to call it)? Michele Deepal Jayasinghe wrote: > you have to add a method called > setOperationContext(OperationContext opctx) { > } > > in to your sevrice impl class , and that method will be called whenever > you get a req . Using opctx you can get the messagecontext > > > Michele Mazzucco wrote: > >> Hi all, >> >> how can I get the MessageContext from a OMelement? >> (I'm using the primary interface APIs, that is my methods have the >> following signature: >> >> OMelement operation(OMElement arg1, OMElelent arg2,..., OMElement argN) { >> ... >> } >> >> ) >> >> >> >> Thanks, >> Michele >> >> >> >> >
Re: [Axis2] How to get MessageContext
you have to add a method called setOperationContext(OperationContext opctx) { } in to your sevrice impl class , and that method will be called whenever you get a req . Using opctx you can get the messagecontext Michele Mazzucco wrote: >Hi all, > >how can I get the MessageContext from a OMelement? >(I'm using the primary interface APIs, that is my methods have the >following signature: > >OMelement operation(OMElement arg1, OMElelent arg2,..., OMElement argN) { > ... >} > >) > > > >Thanks, >Michele > > > > -- Thanks, Deepal ~Future is Open~
Re: [Axis2] How to get MessageContext
Hi Eran, please read the thread about "asynchronous messaging" between me and Deepal. Maybe I miss the point. Thanks in advance, Michele Eran Chinthaka wrote: > OMElement is just a representation of an XML fragment. There is no > connection in that to the message context. > > BTW, from where you wanna do this ? > > Michele Mazzucco wrote: >> Hi all, >> >> how can I get the MessageContext from a OMelement? >> (I'm using the primary interface APIs, that is my methods have the >> following signature: >> >> OMelement operation(OMElement arg1, OMElelent arg2,..., OMElement argN) { >> ... >> } >> >> ) >> >> >> >> Thanks, >> Michele >> > >
Re: [Axis2] How to get MessageContext
OMElement is just a representation of an XML fragment. There is no connection in that to the message context. BTW, from where you wanna do this ? Michele Mazzucco wrote: > Hi all, > > how can I get the MessageContext from a OMelement? > (I'm using the primary interface APIs, that is my methods have the > following signature: > > OMelement operation(OMElement arg1, OMElelent arg2,..., OMElement argN) { > ... > } > > ) > > > > Thanks, > Michele > signature.asc Description: OpenPGP digital signature