With 2.4.x, the WSDL and schema requests are also routed onto the interceptor 
chain as GET requests to allow the chain and interceptors to participate in 
various parts of the WSDL requests.

The best option is to add:
        String method = (String)message.get(Message.HTTP_REQUEST_METHOD);
        if ("GET".equals(method)) {
            return;
         }

to the start of your handle method.  

Dan


On Thursday, August 25, 2011 11:15:10 AM suryavikas wrote:
> Hi,
> 
> I had been using CXF 2.2.9 without any issues, and after reading the
> advisory on the CXF site, I have upgraded to CXF 2.4.1. After the upgrade I
> have been dealing with issues w.r.t the interceptors.
> 
> With version 2.2.9 this code used to work just fine
> public SessionInterceptor() {
>               super(Phase.RECEIVE);
>       }
> 
>       public void handleMessage(Message message) throws Fault {
>               System.out.println(message.getContextualProperty("sessionId"));
>               // Get the supplied SOAP envelope in the form of an InputStream
>               InputStream inputStream = message.getContent(InputStream.class);
>                 .....
>         }
> And used to give me an entire SOAP envelope like this
> [08-25 23:25:48] DEBUG SessionInterceptor [http-8080-2]: <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:dbs="http://dbsync.webservices.backend.local.com";>
>    <soapenv:Header>
>       <sessionId>123</sessionId>
>    </soapenv:Header>
>    <soapenv:Body>
>       <dbs:dbsync>
>          <lastSyncId>11</lastSyncId>
>          <userUuid>22</userUuid>
>       </dbs:dbsync>
>    </soapenv:Body>
> </soapenv:Envelope>
> 
> Now after the upgrade the none of the clients are able to see the wsdls in
> the browser or SOAP client as the request triggers the interceptor on any
> requests it receives and it expects client to pass the SESSION ID, when not
> found it just gives them HTTP 500 error.
> 
> I have tried with different phases to sort this issue out, but in all other
> phases other than RECEIVE, I do not get the SOAP envelope in my code.
> I have disabled the inInterceptor & loaded the wsdl in SOAP UI and later
> enabled back the inInterceptor & the old code was working as expected.
> Now when I change the phase to any thing else clients are able to see the
> wsdls, but my session checking doesn't work.
> 
> Any suggestion or documentation about the changes in the Phase
> implementation compared to 2.2.9 would really help.
> 
> Thanks
> Surya
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/CXF-2-4-1-Interceptor-tp4735473p4735473.htm
> l Sent from the cxf-user mailing list archive at Nabble.com.
-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com

Reply via email to