axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chathura Herath" <>
Subject RE: [Axis2] Deploying MessageReceivers per Operation
Date Mon, 25 Apr 2005 03:20:08 GMT
Hi Jaliya, Deepal, all

Its exactly my point, the MessgeReceiver is per MEP not per operation as the heading of this
thread implies(nor its per service). MEP is a real pain and there is an unprecedented need
for properly handling it. 

You are right about there is a need of a MessageReciever per given MEP and the fact that given
service can have operations with different MEP can be resolved making sure we select the right
receiver in the Dispatch phase. Anyway we are doing it now but apparently we have only the
IN_OUT MEP Receiver and infact we are in the process of writing a general framework for MEPs.
I.e. Proper figuring out of MEP aware receives and MEP aware MEPContexts.
So we are converging I think....

Btw any thought of my use case stated in the earlier mail. Restating.. If both the ping operation
and the echo operation requires to use the same transport (e.g. HTTP would be a likely) due
to some external constraint like RM, we ll have to get the engine to reuse same transport
for two or more different MEP.

Is this a valid use case??



From: Jaliya Ekanayake [] 
Sent: Thursday, April 21, 2005 5:22 PM
Subject: RE: [Axis2] Deploying MessageReceivers per Operation

Hi Chathura, Deepal and All,

I would like to pay your attention to the following class.

public class MyService {
    public void ping(String pingStr){
        //Ping implementation
    public String echo(String echoStr){
       //Echo String implementatino
        return echoStr;

Now if we need to deploy this as a web service containing two operations (one with IN-ONLY
MEP and the other with IN-OUT MEP) we are in trouble if we just allow the user to mention
one message receiver per service.

Further, I am referring to the following lines( in the Axis 1.2 JavaProvider)


if (operation != null &&   operation.getMep() == OperationType.ONE_WAY) {
            } else {
                Message        resMsg  = msgContext.getResponseMessage();


Now in our MessageReceiver we don’t need to check the operation type, since we have some
special MEP aware MessageReceivers. Only problem is that we may have many operations in one
service with different MEPs




From: Chathura Herath [] 
Sent: Thursday, April 21, 2005 2:48 PM
Subject: RE: [Axis2] Deploying MessageReceivers per Operation

Hi Jaliya, Deepal, all

I think we haven’t looked at the problem in the correct angle. MEP and Operation have a
one to many relation ship so it will not be right to say we let each operation have its own
message receiver, neither it is correct to say we should have a message receivers per service
because the MEP is defined per operation.

Many Operation → use→ One MEP

The problem that jaliya has pointed out is very valid and believe we need to give proper attention.
But we have missed out one salient point here. The original MEP was an IN_ONLY MEP but since
the operation requires secure conversation the security module need to send out a message
 and get a message back.
The point in that in this case the security module has created a new MEP(OUT_IN if you consider
this EPR to be a server or it’s the client side of the IN_OUT MEP ) which is orthogonal
to the original MEP IN_ONLY. Further more now the endpoint has two parallel MEP’s running

1) Original IN_ONLY MEP :- This will have a receiver – a InOnlyReceiver
2) OUT_IN MEP created by the security module :- This will have its own receiver. (Like a normal

Now I believe there are no misunderstanding of having MessageReceivers because above two message
receivers will be provided and this operation and the security module can use them. And any
other service who has IN_ONLY MEP can use the above message receiver. Am I right?

Complications come when you want to use the same transport to get everything done. That we
have to figure out a way to get the engine to reuse our old same transport. 



From: Deepal Jayasinghe [] 
Sent: Thursday, April 21, 2005 10:30 AM
Subject: Re: [Axis2] Deploying MessageReceivers per Operation

Hi Jaliya;
I think we can handle operation basic receivers inside Message receiver , that is because
when some one implement a service he has to write a MessageReciver for his service  , so inside
the messagereciver he can write all the logic he needs to handle operation basis reciever
, that is inside messagereciver.recive() he can implement those logic.
as an example
MyReciver extends MessageReciver {
 public void recieve(MessageContext context){
    MyOperationReciever myop = new MyOperationReciever();
so if we do that in this way I think we do not need to define per operation basis receivers.

Comments ....  

Hi All,

According the current implementation of Axis2, when we deploy a service, we can specify one
MessageReceiver (InOnlyMessageReceiver, InOutMessageReceiver etc..) per service. According
to my understanding we should let the user to register one MessageReceiver per operation basis.
Possible example would be as follows.

We have a web service with IN-ONLY operation. However we need to let the service to implement
the RequestSecurityToken operation according to the WS-SecCon. This operation is an IN-OUT
operation. In this situation we have to register two message receivers to these two operations.
In addition, the MEP is bind to an operation and the MessageReceiver is the one who is driving
the MEP. So I think we have let each operation to have its own message receiver. 

thoughts ??



View raw message