2) Service Blueprint.xml* ( fix mistyped )* <camelContext xmlns="http://camel.apache.org/schema/blueprint"> <route id="getBInfo" trace="true"> <from uri="direct-vm:getBInfo" /> <log message="########## Camel SOAP Service - Blueprint Route getBInfo. Body : ${body}" /> <log message="########## Camel SOAP Service - Blueprint Route getBInfo. Body : ${body[0]}" /> <log message="########## Camel SOAP Service - Blueprint Route getBInfo. Body : ${body[1]}" /> <bean method="*getBinfo*" ref="serviceHandler" /> </route> <route id="createBInfo" trace="true"> <from uri="direct-vm:createBInfo" /> <log message="########## Camel SOAP Service - Blueprint Route createBInfo. Body : ${body[0]}" /> <log message="########## Camel SOAP Service - Blueprint Route createBInfo. Body : ${body[1]}" /> <bean method="createBInfo" ref="serviceHandler" /> </route> </camelContext>
*When I remove SOAP Header Param, It's success ServiceHandler's Body value is normal state.* *How Can I use SOAP Header Param in ServiceHander?* public class ServiceHandler { public Bundle getBInfo( @Body String bInfoId, Exchange exchange) { LOGGER.info("########## Camel SOAP Service - ServiceHandler getBundle. bInfoId : " + bInfoId); return badaSoapClient.getBInfo(bdHeader, bInfoId); } public Bundle createBInfo( BInfo bInfo, Exchange exchange) { LOGGER.info("########## Camel SOAP Service - ServiceHandler getBundle. BInfo : " + BInfo.getBInfoId() ); return badaSoapClient.createBInfo(bdHeader, bInfo); } } 2015-06-24 15:46 GMT+09:00 이듀이 <dewey94...@gmail.com>: > I having been testing SOAP Route and Service in ServiceMix 5.4.0 using > Camel > > I have modified example source ( SOAP Route and Service at > /examples/camel/camel-cxf-soap), I have added SoapHeader ( > *javax.xml.ws.Holder*) > > I think that Maybe ServiceHadler have some problem. > > Route CamelContext's Body value is normal state, > Service CamelContext's Body value is normal state, > > but ServiceHandler's Body value is Null > > How can I fix this problem? > > > 1) Route Blueprint.xml > > <camelContext xmlns="http://camel.apache.org/schema/blueprint"> > <route id="camelSoapServiceRoute"> > <from uri="cxf:bean:bInfoProvider" /> > <log message="########## Camel SOAP Route - Blueprint Route - > camelSoapServiceRoute. Body : ${body}" /> > <recipientList> > <simple>direct-vm:${header.operationName}</simple> > </recipientList> > </route> > </camelContext> > > 2) Service Blueprint.xml > > <camelContext xmlns="http://camel.apache.org/schema/blueprint"> > <route id="getBInfo" trace="true"> > <from uri="direct-vm:getBInfo" /> > <log message="########## Camel SOAP Service - Blueprint Route getBInfo. > Body : ${body}" /> > <log message="########## Camel SOAP Service - Blueprint Route getBInfo. > Body : ${body[0]}" /> > <log message="########## Camel SOAP Service - Blueprint Route getBInfo. > Body : ${body[1]}" /> > <bean method="getBundle" ref="serviceHandler" /> > </route> > <route id="createBInfo" trace="true"> > <from uri="direct-vm:createBInfo" /> > <log message="########## Camel SOAP Service - Blueprint Route createBInfo. > Body : ${body[0]}" /> > <log message="########## Camel SOAP Service - Blueprint Route createBInfo. > Body : ${body[1]}" /> > <bean method="createBInfo" ref="serviceHandler" /> > </route> > </camelContext> > > > > 3) ServiceHandler > > public class ServiceHandler { > > public Bundle getBInfo( javax.xml.ws.Holder<BdHeader> bdHeader, @Body > String bInfoId, Exchange exchange) { > > LOGGER.info("########## Camel SOAP Service - ServiceHandler > getBundle. bInfoId : " + bInfoId); > return badaSoapClient.getBInfo(bdHeader, bInfoId); > > } > > public Bundle createBInfo( javax.xml.ws.Holder<BdHeader> bdHeader, BInfo > bInfo, Exchange exchange) { > > LOGGER.info("########## Camel SOAP Service - ServiceHandler > getBundle. BInfo : " + BInfo.getBInfoId() ); > return badaSoapClient.createBInfo(bdHeader, bInfo); > > } > > } > > > 4) Logs > > *************************** Route Log *************************** > 2015-06-24 14:56:26,321 | INFO | qtp731662293-92 | camelSoapServiceRoute > | 191 - org.apache.camel.camel-core - 2.14.1 |* ########## > Camel SOAP Route - Blueprint Route camelSoapServiceRoute. Body : 1* > > *************************** Service CamelContest Log > *************************** > 2015-06-24 14:56:26,326 | INFO | qtp731662293-92 | getBInfo > | 191 - org.apache.camel.camel-core - 2.14.1 | *########## > Camel SOAP Service - Blueprint Route getBInfo. Body : 1* > 2015-06-24 14:56:26,363 | INFO | qtp731662293-92 | getBInfo > | 191 - org.apache.camel.camel-core - 2.14.1 | *########## > Camel SOAP Service의 Blueprint Route getBInfo. Body : > javax.xml.ws.Holder@7fb43f0f* > 2015-06-24 14:56:26,364 | INFO | qtp731662293-92 | getBInfo > | 191 - org.apache.camel.camel-core - 2.14.1 |* ########## > Camel SOAP Service의 Blueprint Route getBInfo. Body : 1* > > > *************************** Service ServiceHandler log > *************************** > 2015-06-24 14:56:26,365 | INFO | qtp731662293-92 | ServiceHandler > | 310 - bada-demos-camel-soap-service - 1.0.0 | *########## > Camel SOAP Service의 ServiceHandler getBInfo. bInfoId : null* > > > > *************************** Thirty Bart WebService log > *************************** > 2015-06-24 14:56:26,376 | INFO | qtp1822026333-74 | bInfo > | 130 - org.apache.cxf.cxf-core - 3.0.2 | Inbound Message > ---------------------------- > ID: 7 > Address: http://0.0.0.0:8181/bdService/blueprint/BInfo > Encoding: UTF-8 > Http-Method: POST > Content-Type: text/xml; charset=UTF-8 > Headers: {Accept=[*/*], Cache-Control=[no-cache], connection=[keep-alive], > Content-Length=[255], content-type=[text/xml; charset=UTF-8], Host=[ > 0.0.0.0:8181], Pragma=[no-cache], SOAPAction=[""], User-Agent=[Apache CXF > 3.0.2]} > Payload: <soap:Envelope xmlns:soap=" > http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:getBInfo > xmlns:ns2="http://bd.sgoft" xmlns:ns3=" > http://bd.sgoft/sgsoft.bd/demos/cxf/jaxws/blueprint/vo > "/></soap:Body></soap:Envelope> > -------------------------------------- > 2015-06-24 14:56:26,377 | INFO | qtp1822026333-74 | BundleInfoImpl > | 283 - bada-demos-cxf-jaxws-blueprint - 1.0.0 | ########## > Bada :: BInfoImpl :: getBundle . , bInfoId : null > 2015-06-24 14:56:26,378 | WARN | qtp1822026333-74 | PhaseInterceptorChain > | 130 - org.apache.cxf.cxf-core - 3.0.2 | Application { > http://bd.sgoftr}BInfoBPService#{http://bada.sogomsoft.co.kr}getBInfo has > thrown exception, unwinding now > org.apache.cxf.interceptor.Fault: null > at > org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:163)[130:org.apache.cxf.cxf-core:3.0.2] > at > org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:267)[140:org.apache.cxf.cxf-rt-frontend-jaxws:3.0.2] > at > org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:129)[130:org.apache.cxf.cxf-core:3.0.2] > at > org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:232)[140:org.apache.cxf.cxf-rt-frontend-jaxws:3.0.2] > at > org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:69)[140:org.apache.cxf.cxf-rt-frontend-jaxws:3.0.2] > at > org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)[130:org.apache.cxf.cxf-core:3.0.2] > at > org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)[130:org.apache.cxf.cxf-core:3.0.2] > at java.util.concurrent.Executors$RunnableAdapter.call(Unknown > Source)[:1.6.0_45] > at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)[:1.6.0_45] > at java.util.concurrent.FutureTask.run(Unknown Source)[:1.6.0_45] > at > org.apache.cxf.interceptor.ServiceInvokerInterceptor$2.run(ServiceInvokerInterceptor.java:126)[130:org.apache.cxf.cxf-core:3.0.2] > at > org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)[130:org.apache.cxf.cxf-core:3.0.2] > at > org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:131)[130:org.apache.cxf.cxf-core:3.0.2] > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)[130:org.apache.cxf.cxf-core:3.0.2] > at > org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)[130:org.apache.cxf.cxf-core:3.0.2] > at > org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:243)[138:org.apache.cxf.cxf-rt-transports-http:3.0.2] > at > org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)[138:org.apache.cxf.cxf-rt-transports-http:3.0.2] > at > org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:197)[138:org.apache.cxf.cxf-rt-transports-http:3.0.2] > at > org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:149)[138:org.apache.cxf.cxf-rt-transports-http:3.0.2] > at > org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)[138:org.apache.cxf.cxf-rt-transports-http:3.0.2] > at > org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:290)[138:org.apache.cxf.cxf-rt-transports-http:3.0.2] > at > org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:209)[138:org.apache.cxf.cxf-rt-transports-http:3.0.2] > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:595)[76:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0.0] > at > org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:265)[138:org.apache.cxf.cxf-rt-transports-http:3.0.2] > at > org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)[81:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] > at > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)[81:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] > at > org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)[90:org.ops4j.pax.web.pax-web-jetty:3.1.2] > at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[81:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] > at > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)[81:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] > at > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)[81:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] > at > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)[81:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] > at > org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)[90:org.ops4j.pax.web.pax-web-jetty:3.1.2] > at > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)[81:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] > at > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)[81:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411] > > > > > >