CXF 2.2.5 client call web service operation from ear that deployed to
webphere application server v6.1. It works fine untill a SOAP header is
added as:

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document d = db.newDocument();
Element dummy = d.createElement("dummy");
dummy.setTextContent("Dummy Header");
Header dummyHeader = new Header(new QName("urn:dummySpace", "dummyHeader"),
dummy); 
List<Header> headersList = new ArrayList<Header>(); 
headersList.add(dummyHeader); 
bindingProvider.getRequestContext().put(Header.HEADER_LIST, headersList);

Then get error:

PhaseIntercep W org.apache.cxf.phase.PhaseInterceptorChain doIntercept
Interceptor has thrown exception, unwinding now
                                 java.lang.ClassCastException:
org.apache.cxf.headers.Header incompatible with
org.apache.cxf.headers.Header
        at
org.apache.cxf.binding.soap.interceptor.SoapHeaderOutFilterInterceptor.handleMessage(SoapHeaderOutFilterInterceptor.java:40)
        at
org.apache.cxf.binding.soap.interceptor.SoapHeaderOutFilterInterceptor.handleMessage(SoapHeaderOutFilterInterceptor.java:29)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:483)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:309)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:261)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
        at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
        at $Proxy290.createProgram100(Unknown Source)

I can't find any other cxf jars except cxf-2.2.5.jar.
Also can't change class loader to "PARENT_LAST" because the app
infrastructure requires "PAREAN_FIRST".
Any suggstion to work around it?

--
View this message in context: 
http://cxf.547215.n5.nabble.com/cxf-2-2-5-ws-client-in-websphere-v6-1-got-ClassCastException-error-tp5551164p5551164.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to