You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Stadelmann Josef <jo...@axa-winterthur.ch> on 2010/07/01 19:07:06 UTC

AW: Cannot intercept soap headers in Axis2

Hi Fabian,

I. when a request arrives at Axis2 WS you wrote the engine has stripped of the header already. 
   So you receive the payload, the letter in the envelop, but not the header.

II. i.e. a module like ws-addressing deals with a part of a header

III. i.e. given your working in scope=soapsession then specific logic of your axis2 engine 
deals with a ServiceGroupId in a header to be able to reach your instance of your server object 
and not only a method of it,. But a real state full object.

IV. if you have rampart stuff in your header this will be treated by a rampart module.

Suggestion: 
as you say : I would like to intercept soap header of my request before executing my WS on Axis2. " 

The only way from an good axis2-architectural point is by adding a module to the Inflow after Dispatcher Phase.

Try to take the module examples, maybe better have a look how the soap monitor module .mar is engineered.
Then play with the soap monitor module. 

And basically each module is a message interceptor. And you can configure axis2 modules and define at which user defined phase and at which flow it has to take an action. 

Sepp





-----Ursprüngliche Nachricht-----
Von: karoudja [mailto:karoudja@hotmail.com] 
Gesendet: Montag, 28. Juni 2010 15:29
An: axis-user@ws.apache.org
Betreff: Cannot intercept soap headers in Axis2


Hi all,
I would like to intercept soap header of my request before executing my WS
on Axis2.
So I succeed to sent to Axis2 a request with header but the problem is that
Axis2 cannot get the headers from my request.
To get the header I have build a handler. This handler is activated each
time I receive a request but never I can reach the headers I sent...
This is my invoke method of my handler:

public InvocationResponse invoke(MessageContext msgContext) throws AxisFault
{

        Iterator itHeader =
msgContext.getAxisMessage().getSoapHeaders().iterator();
        while(itHeader.hasNext()){
            System.out.println(itHeader.next().toString());
        }
        System.out.println("Service Invoked : " +
msgContext.getAxisService().getName());
        System.out.println("Operation Invoked : " +
msgContext.getAxisOperation().getName().getLocalPart());
        return InvocationResponse.CONTINUE;
    }

I can see without proble the "Service Invoked" and the "Operation Invoked"
but I never pass in my loop "While"

here is the request I make:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header>
      <geolocalisation xmlns="http://services.wsaxis.wwwsa.be">europa</pass>
   </SOAP-ENV:Header>
   <SOAP-ENV:Body>
      <tns:hello xmlns:tns="http://services.wsaxis.wwwsa.be">
         <name>dummy</name>
      </tns:hello>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Any idea?? Maybe the fault of my WSDL? Must I change the WSDL to allow
header?
Thanks a lot,
Fabian.
-- 
View this message in context: http://old.nabble.com/Cannot-intercept-soap-headers-in-Axis2-tp29008562p29008562.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org