Sorry for the newbie question, but I have been searching and reading the docs and cannot seem to locate the source of the problem. I am attempting to read a message from a file (containing XML) and then invoke a service with the contents. I am working with the Bookstore example as a starting point.
My flow is:
<flow name="test-service">
<file:inbound-endpoint path="C:/TEMP" connector-ref="inbox">
<file:filename-wildcard-filter pattern="order.xml"/>
</file:inbound-endpoint>
<cxf:jaxws-client
serviceClass="org.mule.example.bookstore.OrderService"
port="OrderServiceImplPort"
operation="orderBook"/>
<outbound-endpoint address="http://localhost:8777/services/order"/>
</flow>
I have unsucessfully tried to have the order.xml file contain just an orderBook element as follows:
<?xml version="1.0" encoding="UTF-8"?>
<ns2:orderBook xmlns:ns2="http://bookstore.example.mule.org/">
<book>
<author>J.R.R. Tolkien</author>
<id>1</id>
<price>8.0</price>
<title>The Fellowship of the Ring</title>
</book>
<quantity>4</quantity>
<address>Someplace, Somewhere</address>
<email>m...@my-mail.com</email>
</ns2:orderBook>
ans also tried to with it as a full SOAP message as follows:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:orderBook xmlns:ns2="http://bookstore.example.mule.org/">
<book>
<author>J.R.R. Tolkien</author>
<id>1</id>
<price>8.0</price>
<title>The Fellowship of the Ring</title>
</book>
<quantity>4</quantity>
<address>Someplace, Somewhere</address>
<email>m...@my-mail.com</email>
</ns2:orderBook>
</soap:Body>
</soap:Envelope>
Either way, I end up getting errors such as:
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.cxf.databinding.AbstractWrapperHelper.createWrapperObject(AbstractWrapperHelpe
r.java:99)
at org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOu
tInterceptor.java:103)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:471)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:310)
at org.mule.module.cxf.CxfOutboundMessageProcessor.doSendWithClient(CxfOutboundMessageProces
sor.java:231)
at org.mule.module.cxf.CxfOutboundMessageProcessor.process(CxfOutboundMessageProcessor.java:
125)
at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingM
essageProcessor.java:57)
at org.mule.processor.builder.InterceptingChainMessageProcessorBuilder$InterceptingMessagePr
ocessorAdapter.process(InterceptingChainMessageProcessorBuilder.java:188)
at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingM
essageProcessor.java:57)
at org.mule.processor.builder.InterceptingChainMessageProcessorBuilder$InterceptingMessagePr
ocessorAdapter.process(InterceptingChainMessageProcessorBuilder.java:188)
at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingM
essageProcessor.java:57)
at org.mule.processor.builder.InterceptingChainMessageProcessorBuilder$InterceptingMessagePr
ocessorAdapter.process(InterceptingChainMessageProcessorBuilder.java:188)
at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingM
essageProcessor.java:57)
at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(As
yncInterceptingMessageProcessor.java:184)
at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:41)
at org.mule.work.WorkerContext.run(WorkerContext.java:309)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExe
cutor.java:1061)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolEx
ecutor.java:575)
at java.lang.Thread.run(Unknown Source)
INFO 2011-10-21 11:36:54,213 [[default].flow.test-service.1] org.apache.cxf.phase.PhaseInterceptorC
hain: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault
at org.apache.cxf.databinding.AbstractWrapperHelper.createWrapperObject(AbstractWrapperHelpe
r.java:107)
at org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOu
tInterceptor.java:103)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:471)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:310)
at org.mule.module.cxf.CxfOutboundMessageProcessor.doSendWithClient(CxfOutboundMessageProces
sor.java:231)
at org.mule.module.cxf.CxfOutboundMessageProcessor.process(CxfOutboundMessageProcessor.java:
125)
at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingM
essageProcessor.java:57)
at org.mule.processor.builder.InterceptingChainMessageProcessorBuilder$InterceptingMessagePr
ocessorAdapter.process(InterceptingChainMessageProcessorBuilder.java:188)
at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingM
essageProcessor.java:57)
at org.mule.processor.builder.InterceptingChainMessageProcessorBuilder$InterceptingMessagePr
ocessorAdapter.process(InterceptingChainMessageProcessorBuilder.java:188)
at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingM
essageProcessor.java:57)
at org.mule.processor.builder.InterceptingChainMessageProcessorBuilder$InterceptingMessagePr
ocessorAdapter.process(InterceptingChainMessageProcessorBuilder.java:188)
at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingM
essageProcessor.java:57)
at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(As
yncInterceptingMessageProcessor.java:184)
at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:41)
at org.mule.work.WorkerContext.run(WorkerContext.java:309)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExe
cutor.java:1061)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolEx
ecutor.java:575)
at java.lang.Thread.run(Unknown Source)
ERROR 2011-10-21 11:36:54,260 [[default].flow.test-service.1] org.mule.exception.DefaultServiceExcep
tionStrategy:
********************************************************************************
Message : null (org.apache.cxf.interceptor.Fault)
Type : org.mule.api.DefaultMuleException
Code : MULE_ERROR-10999
JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/DefaultMuleE
xception.html
********************************************************************************
Exception stack is:
1. null (org.apache.cxf.interceptor.Fault)
org.apache.cxf.databinding.AbstractWrapperHelper:107 (null)
2. null (org.apache.cxf.interceptor.Fault) (org.mule.api.DefaultMuleException)
org.mule.module.cxf.CxfOutboundMessageProcessor:139 (http://www.mulesoft.org/docs/site/current3/ap
idocs/org/mule/api/DefaultMuleException.html)
********************************************************************************
Root Exception stack trace:
org.apache.cxf.interceptor.Fault
at org.apache.cxf.databinding.AbstractWrapperHelper.createWrapperObject(AbstractWrapperHelpe
r.java:107)
at org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOu
tInterceptor.java:103)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:471)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:310)
at org.mule.module.cxf.CxfOutboundMessageProcessor.doSendWithClient(CxfOutboundMessageProces
sor.java:231)
at org.mule.module.cxf.CxfOutboundMessageProcessor.process(CxfOutboundMessageProcessor.java:
125)
at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(As
yncInterceptingMessageProcessor.java:184)
at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:41)
at org.mule.work.WorkerContext.run(WorkerContext.java:309)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExe
cutor.java:1061)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolEx
ecutor.java:575)
at java.lang.Thread.run(Unknown Source)
********************************************************************************
What am I missing/doing wrong?
TIA!
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Sorry for the newbie question, but I have been searching and reading the
docs and cannot seem to locate the source of the problem. I am
attempting to read a message from a file (containing XML) and then
invoke a service with the contents. I am working with the Bookstore
example as a starting point.
My flow is:
<flow name="test-service">
<file:inbound-endpoint path="C:/TEMP" connector-ref="inbox">
<file:filename-wildcard-filter pattern="order.xml"/>
</file:inbound-endpoint>
<cxf:jaxws-client
serviceClass="org.mule.example.bookstore.OrderService"
port="OrderServiceImplPort"
operation="orderBook"/>
<outbound-endpoint address="http://localhost:8777/services/order"/>
</flow>
I have unsucessfully tried to have the order.xml file contain just an orderBook element as follows:
<?xml version="1.0" encoding="UTF-8"?>
<ns2:orderBook xmlns:ns2="http://bookstore.example.mule.org/">
<book>
<author>J.R.R. Tolkien</author>
<id>1</id>
<price>8.0</price>
<title>The Fellowship of the Ring</title>
</book>
<quantity>4</quantity>
<address>Someplace, Somewhere</address>
<email>m...@my-mail.com</email>
</ns2:orderBook>
ans also tried to with it as a full SOAP message as follows:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:orderBook xmlns:ns2="http://bookstore.example.mule.org/">
<book>
<author>J.R.R. Tolkien</author>
<id>1</id>
<price>8.0</price>
<title>The Fellowship of the Ring</title>
</book>
<quantity>4</quantity>
<address>Someplace, Somewhere</address>
<email>m...@my-mail.com</email>
</ns2:orderBook>
</soap:Body>
</soap:Envelope>
INFO 2011-10-21 11:36:54,213 [[http://default].flow.test-service.1|http://default].flow.test-service.1/] org.apache.cxf.phase.PhaseInterceptorC
ERROR 2011-10-21 11:36:54,260 [[http://default].flow.test-service.1|http://default].flow.test-service.1/] org.mule.exception.DefaultServiceExcep
tionStrategy:
********************************************************************************
Message : null (org.apache.cxf.interceptor.Fault)
Type : org.mule.api.DefaultMuleException
Code : MULE_ERROR-10999
JavaDoc : [http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/DefaultMuleE]
xception.html
********************************************************************************
Exception stack is:
1. null (org.apache.cxf.interceptor.Fault)
org.apache.cxf.databinding.AbstractWrapperHelper:107 (null)
2. null (org.apache.cxf.interceptor.Fault) (org.mule.api.DefaultMuleException)
org.mule.module.cxf.CxfOutboundMessageProcessor:139 ([http://www.mulesoft.org/docs/site/current3/ap]
Thanks again!
thanks again for your help. I am trying to get the XML unmarshalled into the objects needed for cxf:jaxws-client
with the <xm:xml-to-object-transformer name="XmlToObject" />. However, the transformer does not seem to know what classes to use (and I'm not sure how to tell it which classes to use, etc as the documentation does not show any other available options). So I am now seeing errors like: Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: ns2:orderBook : ns2:orderBook
at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:49)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:26)
at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:76
)
How can I get the XML orderBook unmarshalled into the Java objects needed for cxf:jaxws-client?
How can I get the XML orderBook unmarshalled into the Java objects needed for cxf:jaxws-client?
You are correct. I loading the orderBook object from
order.xml. Since you asked how the object was marshalled in an earlier post, I was looking at the order.jsp (which invokes the OrderService) to see how it marshalled it. (I captured the contents of order.xml by inserting a <logging-interceptor/> into the bookstore-config.xml) - this is where the contents of that file originated from. So, I'm still stuck as to know how they got from the Java objects I see used near the bottom of order.jsp to the marshalled XML that I see from the logging-interceptor just before invoking the OrderService?
I hopeful to be able to unmrshall the XML and invoke the OrderService myself as a simple starting point ... Hence this thread of discussion. HTH.
I loading the orderBook object from order.xml. Since you asked how the object was marshalled in an earlier post, I was looking at the order.jsp (which invokes the OrderService) to see how it marshalled it. (I captured the contents of order.xml by inserting a <logging-interceptor/> into the bookstore-config.xml) - this is where the contents of that file originated from.
So, I'm still stuck as to know how they got from the Java objects I see used near the bottom of order.jsp to the marshalled XML that I see from the logging-interceptor just before invoking the OrderService?
I hopeful to be able to unmrshall the XML and invoke the OrderService myself as a simple starting point ... Hence this thread of discussion. HTH.
Ultimately, I will have XML on the inbound side. I'll process the XML via various XSLT and/or Java based tranforms and then deliver it to service on the outbound side. So starting from the sample was hoped to be both an expidicuous and low-risk way of developing a proof of concept as well as providing well-know to the community areas if we ran into troubles/questions. As an aside, while working in parallel here, I have gotten this desired flow to work as desired via the proxying method you suggested - thanks.
This will work just fine for the XSLT only tranforms. In those cases where I need to unmarshall to objects and apply some sort of Java based transform, it makes the most sense to ultimately use the cxf:jaxws-client ... hence the continued desired to find a way to make that approach workable.