You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by eirmag <ei...@himail.fr> on 2012/07/13 17:28:56 UTC

Calls to multiple web service provider within Activiti fail with a Marshalling Error

First of all, I would like to apologize if people consider I'm cross posting.
I already created a post entry in the Activiti forum, but I still create
this post to have a better understanding on how CXF handles requests.

The initial problem (that I also describe in
http://forums.activiti.org/en/viewtopic.php?f=6&t=4245) :
I would like to achieve a "simple" thing with activiti: call several service
providers sequentially. But so far I'm unable to do so! I've created a
testcase project to understand exactly what is wrong, with different tests.
The test case creates two service provider, deployed in virtually different
locations
* A counter service provider, that exposes one method with one parameter.
The service is deployed on endpoint http://127.0.0.1:63081/counter
* An echo service provider, that exposes one method with one parameter. The
service is deployed on endpoint http://127.0.0.1:63082/echo

Now, the problem I face is "simple" but I'm unable to find the root cause:
Whenever I call a service task from one endpoint, I'm not able to call the
other service. For instance, if the first service that I call is the counter
service, I'm unable to contact the echo server. The reverse (echo server
contacted first -> unable to contact the counter service) produces the same
result. 

The exception produced when calling the second service provider is attached
to this entry, and is my main concern. I don't understand why CXF is not
able to retrieve the generated object in the context of the second service
provider. There is something that I miss, and I don't know where it comes
from. For this exception, it occurs when I first launch the business process
to contact the Echo server, then when activiti tries to access the second
service provider (the counter service), the big CXF exception is displayed
(cannot find the Inc class generated by CXF even though in the 2nd line of
the listing, the log says the class is created).

I've re-created a small eclipse project, that you can test if you want to
observe/debug/test, at the following location: 
http://nunix.fr/ComplexServiceProblem.zip. You'll probably have to add your
CXF runtime to the eclipse project. Mine was 2.6.1, with sun (oracle) jdk
1.7. Once open, you can directly launch the unit test suite in
/ComplexServiceProblem/src/test/java/test/scenario/ScenarioCounterServiceFirst.java 

Let me know if you have some ideas, and thanks a lot for your help,
Best regards,

Gabriel

PS: raw exception, as displayed in the activiti post. You can have the
complete listing at the root of the archive.




--
View this message in context: http://cxf.547215.n5.nabble.com/Calls-to-multiple-web-service-provider-within-Activiti-fail-with-a-Marshalling-Error-tp5711059.html
Sent from the cxf-issues mailing list archive at Nabble.com.

Re: Calls to multiple web service provider within Activiti fail with a Marshalling Error

Posted by eirmag <ei...@himail.fr>.
Hi all,

I follow-up post to let you know the development of the problem, and a way
to circumvent it. The problem is related to JAXB context and the exception
occurs when the services are located in the same package, therefore share
the same namespace, and are used to share similar objects.

Below are two way of consuming services, taken from CXF website, that lead
to different results. The first method is to use dynamic client to consume
services, but it results in the exceptions displayed in the previous post
(org.apache.cxf.interceptor.Fault: Marshalling Error:
org.activiti.engine.impl.webservice.Inc is not known to this context).
Basically, jaxb is unable to access the generated classes during the second
call.
The second method is to use the JAX-WS Proxy that do not throw an exception
(is it using jaxb somehow?).

Please look at javacode for other details.



Then the second consumption that do not trigger execptions (with services
located in the same package)




So I've partially resolved my problem by using the JAX-WS proxy method
instead of the dynamic client generation, but I still don't understand how
to create a correct service definition to use the dynamic client. 
Let me know if you have some ideas on how to create two services that will
run in separate administrative domain, sharing the exact same object
definition (I mean data types that are shared by the services: same name,
namespace, same contract, etc.) and then consume them (in POJO or via
activiti ;))




--
View this message in context: http://cxf.547215.n5.nabble.com/Calls-to-multiple-web-service-provider-within-Activiti-fail-with-a-Marshalling-Error-tp5711059p5711346.html
Sent from the cxf-issues mailing list archive at Nabble.com.