cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Clark <jecl...@gmail.com>
Subject AbstractSoapInterceptor can't access Addressing Properties
Date Wed, 11 Nov 2009 18:14:34 GMT
Hello all,

I'm trying to create an Interceptor that is setup under the following
method:

    public void getStudy(int studyId) {
        try
        {
            MyInterceptor myInterceptor = new MyInterceptor();
            ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
            factory.setServiceClass(OrderServiceSoap.class);
            factory.setAddress("
https://uatwebservice.jcorp.com/OrderService.asmx");
            factory.getFeatures().add(new WSAddressingFeature());
            factory.getOutInterceptors().add( myInterceptor );

            OrderServiceSoap os = (OrderServiceSoap) factory.create();
            os.getStudy( studyid );
        } catch(Exception e) {
            e.printStackTrace();
        }
    }


Below is the code for my Interceptor:

public class MyInterceptor extends AbstractSoapInterceptor {
   public MyInterceptor() {
           super(Phase.PRE_LOGICAL);
           addAfter(MAPAggregator.class.getName());
      }
    public void handleMessage(SoapMessage arg0) throws Fault
    {
        Message message = arg0.getMessage();
        if (ContextUtils.isOutbound(message))
        {
           AddressingPropertiesImpl outMaps =
ContextUtils.retrieveMAPs(message, true, true);
           if (outMaps != null)
           {

outMaps.exposeAs(VersionTransformer.Names200408.WSA_NAMESPACE_NAME);
           }
        }
    }
}

The problem I've encountered is that ContextUtils.retrieveMAPs(message,
true, true) is returning null.

Aside from adding the the WSaddressFeature to to my ClientProxyFactoryBean,
what else do I need to ensure that the address properties are populated when
the interceptor runs?

Cheers,
Jason.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message