Re: AW: How to access the SOAPHeader

2006-07-19 Thread Michele Mazzucco
Eran,

maybe I'm wrong, but I think there's a small problem with the Service
interface. The method defined there does not throw any Exception, while
the "common" implementation (this.inMsgCtx =
opctx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE)) does (of
course you can add a try-catch block).

The better solution, should be to remove the throw clause from
OperationContext.getMessageContext() method since this is only a look-up
from a HashMap, which will never throw a AxisFault (furthermore, it will
never throw any exception since HashMap allow both null keys and values).


Regards,
Michele

Eran Chinthaka wrote:
> Ok guys. its implemented and committed to the code base. You may try it now.
> 
> You need to implement org.apache.axis2.Service interface.
> 
> -- Chinthaka
> 
> Davanum Srinivas wrote:
>> +1 from me.
>>
>> On 7/14/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:
>>> so lets go for that , AFAIK we only need to change DependencyManager to
>>> support that.
>>>
>>> Eran Chinthaka wrote:
>>>
 Rodrigo Ruiz wrote:


> Mmm, yes of course. But I guess you are talking about a mandatory
> interface, like Remote. I am talking about an optional one, like
> LifeCycle. For example:
>
> public interface ContextAware {
>  void setOperationContext(OperationContext ctx);
> }
>
> In this case, only those services interested in having this data will
> need to implement it. The rest can work just like now.
>
> Such an interface would make reflection/introspection unnecessary, and
> the relationship with Axis2 more explicit.
>
>
 Hmm, now it makes sense to me :). I can remember there was a discussion
 on the same topic some time back, on this list, but can not remember
 what happened to it.

 What do the others think about this? Can I implement this?

 For the time being, lets leave the dependency injection for the existing
 code to work and implement this as well.

 Comments ?

 -- Chinthaka



>>> -- 
>>> Thanks,
>>> Deepal
>>> 
>>> ~Future is Open~
>>>
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
> 
> 

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



RE: AW: How to access the SOAPHeader

2006-07-14 Thread Derek
+1 from me. Interfaces defined only by implicit signatures and invoked via
reflection scare me, since if I misremember the arguments or names, things
fail to work with no compiler warnings. I much prefer interfaces defined by
actual 'implements' declarations, which my IDE (IntelliJ IDEA) can check at
edit time to warn me if I am doing something wrong.

Derek

> -Original Message-
> From: Davanum Srinivas [mailto:[EMAIL PROTECTED] 
> Sent: Friday, July 14, 2006 5:21 AM
> To: axis-user@ws.apache.org
> Subject: Re: AW: How to access the SOAPHeader
> 
> 
> +1 from me.
> 
> On 7/14/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:
> > so lets go for that , AFAIK we only need to change 
> DependencyManager 
> > to support that.
> >
> > Eran Chinthaka wrote:
> >
> > >Rodrigo Ruiz wrote:
> > >
> > >
> > >>Mmm, yes of course. But I guess you are talking about a mandatory 
> > >>interface, like Remote. I am talking about an optional one, like 
> > >>LifeCycle. For example:
> > >>
> > >>public interface ContextAware {
> > >>  void setOperationContext(OperationContext ctx);
> > >>}
> > >>
> > >>In this case, only those services interested in having this data 
> > >>will need to implement it. The rest can work just like now.
> > >>
> > >>Such an interface would make reflection/introspection 
> unnecessary, 
> > >>and the relationship with Axis2 more explicit.
> > >>
> > >>
> > >
> > >Hmm, now it makes sense to me :). I can remember there was a 
> > >discussion on the same topic some time back, on this list, but can 
> > >not remember what happened to it.
> > >
> > >What do the others think about this? Can I implement this?
> > >
> > >For the time being, lets leave the dependency injection for the 
> > >existing code to work and implement this as well.
> > >
> > >Comments ?
> > >
> > >-- Chinthaka
> > >
> > >
> > >
> >
> > --
> > Thanks,
> > Deepal 
> > 
> > ~Future is Open~
> >
> >
> >
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> -- 
> Davanum Srinivas : http://www.wso2.net (Oxygen for Web 
> Service Developers)
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



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



Re: AW: How to access the SOAPHeader

2006-07-14 Thread Eran Chinthaka
Ok guys. its implemented and committed to the code base. You may try it now.

You need to implement org.apache.axis2.Service interface.

-- Chinthaka

Davanum Srinivas wrote:
> +1 from me.
> 
> On 7/14/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:
>> so lets go for that , AFAIK we only need to change DependencyManager to
>> support that.
>>
>> Eran Chinthaka wrote:
>>
>> >Rodrigo Ruiz wrote:
>> >
>> >
>> >>Mmm, yes of course. But I guess you are talking about a mandatory
>> >>interface, like Remote. I am talking about an optional one, like
>> >>LifeCycle. For example:
>> >>
>> >>public interface ContextAware {
>> >>  void setOperationContext(OperationContext ctx);
>> >>}
>> >>
>> >>In this case, only those services interested in having this data will
>> >>need to implement it. The rest can work just like now.
>> >>
>> >>Such an interface would make reflection/introspection unnecessary, and
>> >>the relationship with Axis2 more explicit.
>> >>
>> >>
>> >
>> >Hmm, now it makes sense to me :). I can remember there was a discussion
>> >on the same topic some time back, on this list, but can not remember
>> >what happened to it.
>> >
>> >What do the others think about this? Can I implement this?
>> >
>> >For the time being, lets leave the dependency injection for the existing
>> >code to work and implement this as well.
>> >
>> >Comments ?
>> >
>> >-- Chinthaka
>> >
>> >
>> >
>>
>> -- 
>> Thanks,
>> Deepal
>> 
>> ~Future is Open~
>>
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 




signature.asc
Description: OpenPGP digital signature


RE: AW: How to access the SOAPHeader

2006-07-14 Thread Tony Dean
This makes perfect sense to me.  This is how I thought it should have been from 
the start.

I started working with service lifecycle from the start and initially all that 
was available was init() and destroy().  If there had been a lifecycle 
interface that I was required to implement, when things changed to 
init(ServiceContext), destroy(ServiceContext), and 
setOperationContext(OperationContext), I would have been warned about it at 
compile time and not wondering why my old init() code wasn't being called at 
runtime.

-Tony

-Original Message-
From: Eran Chinthaka [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 14, 2006 8:06 AM
To: axis-user@ws.apache.org
Subject: Re: AW: How to access the SOAPHeader

Rodrigo Ruiz wrote:
> Mmm, yes of course. But I guess you are talking about a mandatory 
> interface, like Remote. I am talking about an optional one, like 
> LifeCycle. For example:
> 
> public interface ContextAware {
>   void setOperationContext(OperationContext ctx); }
> 
> In this case, only those services interested in having this data will 
> need to implement it. The rest can work just like now.
> 
> Such an interface would make reflection/introspection unnecessary, and 
> the relationship with Axis2 more explicit.

Hmm, now it makes sense to me :). I can remember there was a discussion on the 
same topic some time back, on this list, but can not remember what happened to 
it.

What do the others think about this? Can I implement this?

For the time being, lets leave the dependency injection for the existing code 
to work and implement this as well.

Comments ?

-- Chinthaka


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



Re: AW: How to access the SOAPHeader

2006-07-14 Thread Davanum Srinivas

+1 from me.

On 7/14/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:

so lets go for that , AFAIK we only need to change DependencyManager to
support that.

Eran Chinthaka wrote:

>Rodrigo Ruiz wrote:
>
>
>>Mmm, yes of course. But I guess you are talking about a mandatory
>>interface, like Remote. I am talking about an optional one, like
>>LifeCycle. For example:
>>
>>public interface ContextAware {
>>  void setOperationContext(OperationContext ctx);
>>}
>>
>>In this case, only those services interested in having this data will
>>need to implement it. The rest can work just like now.
>>
>>Such an interface would make reflection/introspection unnecessary, and
>>the relationship with Axis2 more explicit.
>>
>>
>
>Hmm, now it makes sense to me :). I can remember there was a discussion
>on the same topic some time back, on this list, but can not remember
>what happened to it.
>
>What do the others think about this? Can I implement this?
>
>For the time being, lets leave the dependency injection for the existing
>code to work and implement this as well.
>
>Comments ?
>
>-- Chinthaka
>
>
>

--
Thanks,
Deepal

~Future is Open~



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





--
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)

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



Re: AW: How to access the SOAPHeader

2006-07-14 Thread Deepal Jayasinghe
so lets go for that , AFAIK we only need to change DependencyManager to
support that.

Eran Chinthaka wrote:

>Rodrigo Ruiz wrote:
>  
>
>>Mmm, yes of course. But I guess you are talking about a mandatory
>>interface, like Remote. I am talking about an optional one, like
>>LifeCycle. For example:
>>
>>public interface ContextAware {
>>  void setOperationContext(OperationContext ctx);
>>}
>>
>>In this case, only those services interested in having this data will
>>need to implement it. The rest can work just like now.
>>
>>Such an interface would make reflection/introspection unnecessary, and
>>the relationship with Axis2 more explicit.
>>
>>
>
>Hmm, now it makes sense to me :). I can remember there was a discussion
>on the same topic some time back, on this list, but can not remember
>what happened to it.
>
>What do the others think about this? Can I implement this?
>
>For the time being, lets leave the dependency injection for the existing
>code to work and implement this as well.
>
>Comments ?
>
>-- Chinthaka
>
>  
>

-- 
Thanks,
Deepal

~Future is Open~ 



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



Re: AW: How to access the SOAPHeader

2006-07-14 Thread Eran Chinthaka
Rodrigo Ruiz wrote:
> Mmm, yes of course. But I guess you are talking about a mandatory
> interface, like Remote. I am talking about an optional one, like
> LifeCycle. For example:
> 
> public interface ContextAware {
>   void setOperationContext(OperationContext ctx);
> }
> 
> In this case, only those services interested in having this data will
> need to implement it. The rest can work just like now.
> 
> Such an interface would make reflection/introspection unnecessary, and
> the relationship with Axis2 more explicit.

Hmm, now it makes sense to me :). I can remember there was a discussion
on the same topic some time back, on this list, but can not remember
what happened to it.

What do the others think about this? Can I implement this?

For the time being, lets leave the dependency injection for the existing
code to work and implement this as well.

Comments ?

-- Chinthaka



signature.asc
Description: OpenPGP digital signature


Re: AW: How to access the SOAPHeader

2006-07-14 Thread Rodrigo Ruiz
Mmm, yes of course. But I guess you are talking about a mandatory
interface, like Remote. I am talking about an optional one, like
LifeCycle. For example:

public interface ContextAware {
  void setOperationContext(OperationContext ctx);
}

In this case, only those services interested in having this data will
need to implement it. The rest can work just like now.

Such an interface would make reflection/introspection unnecessary, and
the relationship with Axis2 more explicit.

Rodrigo

Eran Chinthaka wrote:
> Hi Rodrigu,
> 
> Rodrigo Ruiz wrote:
>> Eran Chinthaka wrote:
>>> We didn't want to put any restriction on a user who wanna write a simple
>>> java class and expose that as a web service. Thats been the case so far.
>>> I hope you can understand that it will make the most common and simple
>>> case simple.
>>> And I don't see a single reason behind the service impl being dependent
>>> on the web services engine being used. So thats why we didn't wanna
>>> define a contract for the service implementor to implement.
>> Sorry Chintaka, but I think I miss something here. Why does implementing
>> an Axis2 interface makes your service more implementation dependent than
>> adding a method that receives an Axis2 parameter?
>>
>> Once you need to pass an OperationContext instance you are
>> implementation dependent, aren't you?.
> 
> Yes, that will happen iff you, as the service author, wanna get some
> information from the Axis2 environment.
> But, if you wanna deploy a simple service which does an xslt
> transformation on the recd xml, you don't wanna know what is happening
> in Axis2. Isn't it?
> 
> -- Chinthaka
> 
> 

-- 
---
GRIDSYSTEMSRodrigo Ruiz Aguayo
Parc Bit - Son Espanyol
07120 Palma de Mallorcamailto:[EMAIL PROTECTED]
Baleares - España  Tel:+34-971435085 Fax:+34-971435082
http://www.gridsystems.com
---


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.0/388 - Release Date: 13/07/2006


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



Re: AW: How to access the SOAPHeader

2006-07-14 Thread Eran Chinthaka
Hi Rodrigu,

Rodrigo Ruiz wrote:
> 
> Eran Chinthaka wrote:
>> We didn't want to put any restriction on a user who wanna write a simple
>> java class and expose that as a web service. Thats been the case so far.
>> I hope you can understand that it will make the most common and simple
>> case simple.
>> And I don't see a single reason behind the service impl being dependent
>> on the web services engine being used. So thats why we didn't wanna
>> define a contract for the service implementor to implement.
> 
> Sorry Chintaka, but I think I miss something here. Why does implementing
> an Axis2 interface makes your service more implementation dependent than
> adding a method that receives an Axis2 parameter?
> 
> Once you need to pass an OperationContext instance you are
> implementation dependent, aren't you?.

Yes, that will happen iff you, as the service author, wanna get some
information from the Axis2 environment.
But, if you wanna deploy a simple service which does an xslt
transformation on the recd xml, you don't wanna know what is happening
in Axis2. Isn't it?

-- Chinthaka




signature.asc
Description: OpenPGP digital signature


Re: AW: How to access the SOAPHeader

2006-07-14 Thread Rodrigo Ruiz


Eran Chinthaka wrote:
> We didn't want to put any restriction on a user who wanna write a simple
> java class and expose that as a web service. Thats been the case so far.
> I hope you can understand that it will make the most common and simple
> case simple.
> And I don't see a single reason behind the service impl being dependent
> on the web services engine being used. So thats why we didn't wanna
> define a contract for the service implementor to implement.

Sorry Chintaka, but I think I miss something here. Why does implementing
an Axis2 interface makes your service more implementation dependent than
adding a method that receives an Axis2 parameter?

Once you need to pass an OperationContext instance you are
implementation dependent, aren't you?.

Regards,
Rodrigo Ruiz

-- 
---
GRIDSYSTEMSRodrigo Ruiz Aguayo
Parc Bit - Son Espanyol
07120 Palma de Mallorcamailto:[EMAIL PROTECTED]
Baleares - España  Tel:+34-971435085 Fax:+34-971435082
http://www.gridsystems.com
---



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



Re: AW: How to access the SOAPHeader

2006-07-14 Thread Eran Chinthaka
Hi Thomas,

Haug, Thomas wrote:
> Hi Chinthaka,
> 
> Thank you for the quick answer.
> So if I got it right: the Axis2 framework inspects the service class (via 
> reflection?), if the service class provides a  
> setOperationContext(OperationContext opContext) method. Are there any other 
> operation which can be 'magically' called ?
> 
>>From a design perspective this looks a bit awkward, because there is no 
>>interface which mandates that my service class has to implement the 
>>corresponding method(s). Instead the contract between my class and Axis2 is 
>>done implicitly and I have to mention it at least at 'JavaDoc level' 
>>otherwise nobody of my developers whould know. I would rather like to see an 
>>approach similar as in Axis 1 (which is similar to the CORBA Current object 
>>approach).But this is only my opinion ... ;-)

Good point. Let me ask explain a bit on this and ask a question from
you. I'd like to see your approach to this problem.

We didn't want to put any restriction on a user who wanna write a simple
java class and expose that as a web service. Thats been the case so far.
I hope you can understand that it will make the most common and simple
case simple.
And I don't see a single reason behind the service impl being dependent
on the web services engine being used. So thats why we didn't wanna
define a contract for the service implementor to implement.

But at the same time, there are situations where the service author
needs to get some information from the framework. That needs the
framework requires a method in the service to invoke.
Our approach to this was to use IOC concepts as used heavily in
Geronimo. So thats why through a dependency manager, we have a mechanism
to inject operation context to the service implementation class.

IMO, this is the ideal compromise we can get to make the simple case
simple and get to other cases also work.

If you have any other approach for this problem, we are happy to hear that.

Note : this dependency injection will happen iff, you use an in-built
message receiver that comes with Axis2. That won't work with the
generated or custom message receivers.



> 
> Nevertheless, thanks for the hint. At least I am now able to get the 
> SOAPHeader.

np.

-- Chinthaka



signature.asc
Description: OpenPGP digital signature