You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by Lowry <lc...@iona.com> on 2009/10/20 21:48:00 UTC

trying to access SOAP Header in interceptor of cxfse

I've deployed a cxfbc/cxfse to handle incoming web service requests. I'd like
to configure a CXF Interceptor to access the SOAP Header of the incoming
request. 
When configured as an inInterceptor on cxfse:endpoint and run inside
servicemix, the header obtained from getHeaders() is null.
I've included source for interceptor along with cxf-se xbean.xml. 
I have not specified anything inside WSDL to indicate a SOAP Header is
required/optional. Is it required that i specify SOAP Header in WSDL?
Thanks,
-Lowry 


// here is interceptor source

public class SoapHeaderAuthorizationHandler extends
AbstractPhaseInterceptor<SoapMessage>{

	public SoapHeaderAuthorizationHandler(){
		super(Phase.PRE_PROTOCOL);
	}
	
	public void handleMessage(SoapMessage message) throws Fault {
		List<Header> headers = message.getHeaders();
		for(Header header : headers){
			System.err.println("header : "+header.getName());
		}
	}
}


// Here is bean.xml from cxf-se

<beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0">

	<cxfse:endpoint useJBIWrapper="false">
		<cxfse:pojo>
			<bean class="org.apache.servicemix.samples.wsdl_first.PersonImpl" />
		</cxfse:pojo>
		<cxfse:inInterceptors>
			<bean
class="org.apache.servicemix.samples.wsdl_first.interceptors.SoapHeaderAuthorizationHandler"
/>
		</cxfse:inInterceptors>
	</cxfse:endpoint>
</beans>
 
-- 
View this message in context: http://www.nabble.com/trying-to-access-SOAP-Header-in-interceptor-of-cxfse-tp25981313p25981313.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.