Let me know if you would like change/add something that will attract responses.
Hello all, I am using Camel 2.9.2 & CXF 2.6.2 versions and trying to send a MTOM attachment to a webservice using CXF endpoint. Deploying as a war on Tomcat 7.0.40 I followed sample code for Payload mode provided in http://camel.apache.org/cxf.html#CXF-AttachmentSupport I see the request and response being sent and received in the tomcat console. The webservice received & saved the attachment fine as well. But getting an error after response is received by the route. See error below org.apache.cxf.interceptor.Fault: Unexpected element {http://model.webservices.ihe.adapters.ccg.dataexchange.hcit.ge.com/CcdaXdrService}ccdaResponse found. Expected {http://camel.apache.org/cxf/jaxws/dispatch}InvokeResponse. at org.apache.cxf.interceptor.DocLiteralInInterceptor.validatePart(DocLiteralInInterceptor.java:258) at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:200) Looks like there is an interceptor that is validating the response. Is there a way to disable this interceptor? Do I need the response class extend out of some base class such as InvokeResponse? Any ideas what else to try. Camel route: from("direct:webServiceProcessor") .process { logger.debug("Inside CCG Web Service Processor") } //.to("cxf://localhost:9003/"); .process(new WSProcessor()) .to("cxf:bean:xdrReceiverEndpoint") .to("mock:result"); CcdaResponse.java @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ccdaResponse", propOrder = { "ccdaAcknowledgement" }) public class CcdaResponse { @XmlElement(required = true) private CcdaAcknowledgement ccdaAcknowledgement; Processor code: static final String REQ_DOC_CID ="1340070774847"; static final String REQ_MESSAGE="<ccdaRequest xmlns=\"http://model.webservices.ihe.adapters.ccg.dataexchange.hcit.ge.com/CcdaXdrService\<http://model.webservices.ihe.adapters.ccg.dataexchange.hcit.ge.com/CcdaXdrService/>">" +"<clinicalDocument>" +"<ccDocument>" +"<xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\<http://www.w3.org/2004/08/xop/include/>"" + " href=\"cid:" + REQ_DOC_CID + "\"/>" +"</ccDocument>" +"</clinicalDocument>" +"</ccdaRequest>"; public void process(Exchange exchange) throws Exception { logger.debug("in WSProcessor"); List<Source> elements = new ArrayList<Source>(); elements.add(new DOMSource(DOMUtils.readXml(new StringReader(REQ_MESSAGE)).getDocumentElement())); CxfPayload<SoapHeader> body = new CxfPayload<SoapHeader>(new ArrayList<SoapHeader>(), elements, null); logger.debug("constructed cxfpayload"); exchange.getIn().setBody(body); logger.debug("set body in exchange"); File file = new File("c:\\temp\\test.xml"); exchange.getIn().addAttachment(REQ_DOC_CID, new DataHandler(new FileDataSource(file))); logger.debug("added attachment to exchange"); } Spring config: <cxf:cxfEndpoint id="xdrReceiverEndpoint" address="http://localhost:8088/mockCcdaXdrServiceSoapBinding"> <cxf:properties> <entry key="mtom-enabled" value="true"/> <entry key="dataFormat" value="PAYLOAD"/> </cxf:properties> <cxf:outInterceptors> <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> </cxf:outInterceptors> <cxf:inInterceptors> <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/> </cxf:inInterceptors> </cxf:cxfEndpoint> Error in my log file: 2013-05-30 09:07:22 DEBUG "Inside CCG Web Service Processor" [com.ge.hcit.pil.xdrreceiverimpl.routebuilder.XDRReceiverRouteBuilder] 2013-05-30 09:07:22 DEBUG "in WSProcessor" [com.ge.hcit.pil.xdrreceiverimpl.processor.XDRReceiverProcessor] 2013-05-30 09:07:22 DEBUG "constructed cxfpayload" [com.ge.hcit.pil.xdrreceiverimpl.processor.XDRReceiverProcessor] 2013-05-30 09:07:22 DEBUG "set body in exchange" [com.ge.hcit.pil.xdrreceiverimpl.processor.XDRReceiverProcessor] 2013-05-30 09:07:22 DEBUG "added attachment to exchange" [com.ge.hcit.pil.xdrreceiverimpl.processor.XDRReceiverProcessor] 2013-05-30 09:07:23 DEBUG "Inside Exception Block : XDRReceiverRouteBuilder" [com.ge.hcit.pil.xdrreceiverimpl.routebuilder.XDRReceiverRouteBuilder] 2013-05-30 09:07:23 ERROR "Exception in route: " [com.ge.hcit.pil.xdrreceiverimpl.routebuilder.XDRReceiverRouteBuilder] org.apache.cxf.interceptor.Fault: Unexpected element {http://model.webservices.ihe.adapters.ccg.dataexchange.hcit.ge.com/CcdaXdrService}ccdaResponse found. Expected {http://camel.apache.org/cxf/jaxws/dispatch}InvokeResponse. at org.apache.cxf.interceptor.DocLiteralInInterceptor.validatePart(DocLiteralInInterceptor.java:258) at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:200) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:783) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1694) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1535) at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:426) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:351) at java.lang.Thread.run(Thread.java:722) 2013-05-30 09:07:23 ERROR "Missing WS-Addressing headers" [org.openehealth.ipf.commons.ihe.ws.cxf.audit.AbstractAuditInterceptor] Logs in Tomcat console ID: 1 Address: http://localhost:8088/mockCcdaXdrServiceSoapBinding Encoding: UTF-8 Content-Type: multipart/related; type="application/xop+xml"; boundary="uuid:a8c1 1997-373b-4f85-b03e-44f3a9b1201f"; start="<root.mess...@cxf.apache.org<mailto:root.mess...@cxf.apache.org>>"; start- info="text/xml" Headers: {Accept=[*/*], breadcrumbId=[ID-HCU-1B6D2Q1-54228-1369922780484-0-1], o rg.openehealth.ipf.platform.camel.ihe.ws.AbstractWsEndpoint.INCOMING_HTTP_HEADER S=[{content-type=application/soap+xml;charset=UTF-8, connection=Keep-Alive, host =localhost:8080, Content-Length=209479, user-agent=Apache-HttpClient/4.1.1 (java 1.5), accept-encoding=gzip,deflate}], org.openehealth.ipf.platform.camel.ihe.ws .AbstractWsEndpoint.INCOMING_SOAP_HEADERS=[{}], SOAPAction=[""]} Payload: --uuid:a8c11997-373b-4f85-b03e-44f3a9b1201f Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"; Content-Transfer-Encoding: binary Content-ID: <root.mess...@cxf.apache.org<mailto:root.mess...@cxf.apache.org>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body ><ccdaRequest >xmlns="http://model.webservices.ihe.adapters.ccg.dataexchange.hcit .ge.com/CcdaXdrService"><clinicalDocument><ccDocument><xop:Include xmlns:xop="ht tp://www.w3.org/2004/08/xop/include" href="cid:1340070774847"/></ccDocument></cl inicalDocument></ccdaRequest></soap:Body></soap:Envelope> --uuid:a8c11997-373b-4f85-b03e-44f3a9b1201f Content-Type: application/octet-stream Content-Transfer-Encoding: binary Content-ID: <1340070774847> --uuid:a8c11997-373b-4f85-b03e-44f3a9b1201f-- -------------------------------------- 64851 [default-workqueue-1] INFO org.apache.cxf.services.DefaultSEIService.Defau ltSEIPort.DefaultSEI - Inbound Message ---------------------------- ID: 1 Response-Code: 200 Encoding: UTF-8 Content-Type: text/xml; charset=utf-8 Headers: {content-type=[text/xml; charset=utf-8], Server=[Jetty(6.1.x)], transfe r-encoding=[chunked]} Payload: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelo pe/" xmlns:ccd="http://model.webservices.ihe.adapters.ccg.dataexchange.hcit.ge.c om/CcdaXdrService"> <soapenv:Header/> <soapenv:Body> <ccd:ccdaResponse> <!--Optional:--> <ccdaAcknowledgement> <!--Optional:--> <statusCode>0</statusCode> <!--Optional:--> <statusDesc>Success</statusDesc> </ccdaAcknowledgement> </ccd:ccdaResponse> </soapenv:Body> </soapenv:Envelope> -------------------------------------- 64856 [default-workqueue-1] WARN org.apache.cxf.phase.PhaseInterceptorChain - In terceptor for {http://camel.apache.org/cxf/jaxws/dispatch}DefaultSEIService#{htt p://camel.apache.org/cxf/jaxws/dispatch}Invoke has thrown exception, unwinding n ow org.apache.cxf.interceptor.Fault: Unexpected element {http://model.webservices.i he.adapters.ccg.dataexchange.hcit.ge.com/CcdaXdrService}ccdaResponse found. Ex pected {http://camel.apache.org/cxf/jaxws/dispatch}InvokeResponse. at org.apache.cxf.interceptor.DocLiteralInInterceptor.validatePart(DocLi teralInInterceptor.java:258) at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocL iteralInInterceptor.java:200) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept orChain.java:262) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:783) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleR esponseInternal(HTTPConduit.java:1694) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(H TTPConduit.java:1535) at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQu eueImpl.java:426) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:603) at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.ru n(AutomaticWorkQueueImpl.java:351) at java.lang.Thread.run(Thread.java:722) 64931 [http-bio-8080-exec-5] WARN org.apache.cxf.ws.addressing.ContextUtils - WS -Addressing - failed to retrieve Message Addressing Properties from context 64931 [http-bio-8080-exec-5] WARN org.apache.cxf.ws.addressing.ContextUtils - WS -Addressing - failed to retrieve Message Addressing Properties from context 64971 [http-bio-8080-exec-5] WARN org.apache.cxf.ws.addressing.ContextUtils - WS -Addressing - failed to retrieve Message Addressing Properties from context