axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eran Chinthaka" <eran.chinth...@gmail.com>
Subject Re: [Axis2] valid SOAP operations
Date Sat, 31 May 2008 02:16:28 GMT
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.

HTH
Chinthaka

On Fri, May 30, 2008 at 8:16 AM, Jack Sprat <rexclaimer2@yahoo.com> wrote:

> AxisService service =  messageContext.getAxisService()
>
>
>
> *Jack Sprat <rexclaimer2@yahoo.com>* 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.
>
> Thanks.
> T
>
>
> *Eran Chinthaka <eran.chinthaka@gmail.com>* 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.
>
> HTH,
> Chinthaka
>
> [1] :
> http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/ActionBasedOperationDispatcher.java?view=markup
>
> On Tue, May 27, 2008 at 10:58 AM, Jack Sprat <rexclaimer2@yahoo.com>
> 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.
>>
>>
>> Thanks,
>> T
>>
>>
>> *keith chapman <keithgchapman@gmail.com>* 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.
>>
>> Thanks,
>> Keith.
>>
>> On Tue, May 27, 2008 at 8:33 PM, Jack Sprat <rexclaimer2@yahoo.com>
>> 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.
>>>
>>> Thanks,
>>> T
>>>
>>>
>>>
>>> *keith chapman <keithgchapman@gmail.com>* 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
>>>
>>> Thanks,
>>> Keith.
>>>
>>> On Tue, May 27, 2008 at 7:50 PM, Jack Sprat <rexclaimer2@yahoo.com>
>>> 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.
>>>>
>>>> Thanks,
>>>> T.
>>>>
>>>>   <http://www.keith-chapman.org>
>>
>>
>
>


-- 
With Mettha,
Eran Chinthaka

--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth; trusting is
the best relationship; nirvana is the highest joy. - Dhammapada

Mime
View raw message