axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Sprat <>
Subject Re: [Axis2] valid SOAP operations
Date Sat, 31 May 2008 05:12:27 GMT
It's not quite as simple as that. In this case, I was to bypass the authentication if a simple
echo request is received.  So I need to ensure the SOAPAction is valid and then check whether
it is an echo request.  If it is an echo then continue. If not, then authenticate the user
in the SOAP header.


Eran Chinthaka <> wrote: Ok now I am getting the picture here.

Are you trying to make sure the SOAP message that is just received has a proper operation
name in it. If that is the case, don't worry about that, we are already doing that for you
within dispatch phase. Dispatching is all about finding the correct service and operation.
If we can not find it, we will send an error to the user, before the end of the dispatch phase.
So your handler will be redundant if you put it. 

On Fri, May 30, 2008 at 8:16 AM, Jack Sprat <> wrote:
 AxisService service =  messageContext.getAxisService()

Jack Sprat <> wrote:  Where/how do I get the AxisService object
in the code sample below?
 The code will be in the invoke method of my handler class that is invoked in the InFlow phase.

Eran Chinthaka <> wrote:  

AxisService service; // your axis service
String action = messageContext.getSoapAction();

AxisOperation op = service.getOperationBySOAPAction(action);

if (op ==
 null) {
   op = service.getOperationByAction(action);

Please see [1] for more details. 

[1] :
On Tue, May 27, 2008 at 10:58 AM, Jack Sprat <> wrote:
  I think I've made the question more complicated than it needed to be.
All I really need to know is whether the valid SOAP operations for a service are available
in an Axis2  class somewhere?
Something like getValidSOAPOpeations() that returns a list would be ideal.  Otherwise I'll
need to hard-code constants for each operation in the WSDL and compare the results of  getSOAPAction
to each one.  


keith chapman <> wrote:   Why not write a custom dispatcher that
does this. After all this is what your trying to do (Dispatch to an operation using some custom
information).  You can have a look at the inbuilt dispatchers tp get an idea. Its pretty simple
to write a new one.

On Tue, May 27, 2008 at 8:33 PM, Jack Sprat <>  wrote:
  What I am trying to do is validate the SOAP operation invoked in the  handler class so I
can take the appropriate action.
 I've found that many clients trying to consume the service don't know much about web services
so they may send a request with no SOAPAction header or an invalid one.
  For example, my valid operations may be echo and calculate.  Can these 2 operations be determined
programatically somehow?  I'd like to get the valid operations this way and compare what I
got from the getSOAPAction() method to see if I got a valid operation.  Basically, I'm trying
to avoid hard-coding the operations in my Java code.

keith chapman <> wrote:    Hi Jack,

Can you state your requirement more clearly, that should help us provide you with a clear
answer too. I couldn't   understand what you are intending to do


   On Tue, May 27, 2008 at 7:50 PM, Jack Sprat <> wrote:
    I have a service that invokes a handler at the InFlow phase. Is there a way to programatically
determine the valid SOAP operations at this point? I'd like to compare the value from getSOAPAction()
to ensure a valid operation was requested.
    I'm open to a better way of doing this.







View raw message