Hello Glenn,
Look at section 10.1.3 (ServletEndpointContext) of the JAX-RPC 1.1 spec
for details.
You implement the ServiceLifeCycle interface, which calls your init
method and passes you an instance of the ServletEndpointContext. Use
this to retrieve the Messagecontext in your business methods.
Regards,
Dies
Glenn Bech wrote:
Version confusion .-) All my fault, as I did not notice the mention of the
axis2.xml file.
Thanks for clearing this up :=) If you have any ideas on how to do this
using axis 1.3.
Please don't hesitate to post :-)
Glenn
________________________________________
From: Thilina Gunarathne [mailto:[EMAIL PROTECTED]
Sent: 29. januar 2006 11:11
To: [email protected]
Subject: Re: Passing properties via MessageContext
It's possible.... You can use MessageContext injection for that. This is the
standard mechanism provided by Axis2 to access MessageContext from service
impl's....
public void init(MessageContext msgcts) {
this.msgcts = msgcts;
}
http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/java/modules/integ
ration/test/org/apache/axis2/swa/EchoSwA.java?view=markup
HTH,
~Thilina
On 1/27/06, glenn bech <[EMAIL PROTECTED]> wrote:
The problem is that it is impossible, to my knowledge, to access the message
context from your service class.
I've seen some pages on the web describing
a way to include the message context in the method signature of the
operation etc, but I remember thinking of it as "hacky" -)
The only way I've been able to do what you describe, is by using a class
with static members. In the handler you invoke a method that modifies
the static members of a class, the Service class can then use "getters"
on that class to retrieve the data put in by the handler..
Now... Im sure some people will call this "hacky" as well... .-)
Hope this helps.
Glenn
-----Original Message-----
From: Denis Goeury [mailto: [EMAIL PROTECTED]
Sent: 27. januar 2006 06:49
To: [email protected]
Subject: Passing properties via MessageContext
Hi,
Is it possible to set MessageContext properties in a handler and
retrieve them from a service class? I have tried with both the module
being referenced in the axis2.xml and later in the service.xml but no
luck.
Thanks in advance,
-denis
--
Dies KOPER <[EMAIL PROTECTED]> (changed on 1 July 2005)
Fujitsu Ltd - MWPF1 (changed from MWPF3 on 21 Nov 2005)
2-15-16, Shin-Yokohama, Kouhoku-ku, Yokohama, 222-0033, Japan
Tel. +81(45)-475-5605 (internal 7181-4217)