Issue in using responseXStreamConfig with SOAPClient respons
evanyang Jun 19, 2008 3:49 PMI have a program that use jBossESB to hide 3 external web services with SOAPClient actions, jBossESB provides the CBR/transformation etc. while a client program simply sending a serialized Java message to the esb.
Initially I use the responseAsOgnlMap=true on the SOAPClient which then I search for the value from the map and update the java object in the response actions (btw, is there a tutorial of how to use OGNL to reconstruct data object?), so the client will receive updated info in the end.
But then I want to try the responseXStreamConfig, so I used the Sun's schemagen to create a xsd for my data objects, and deployed with the war that contains all the web services to jBossAS. The following is the example in the jboss-esb.xml
<property name="responseXStreamConfig"> <alias name="user" class="com.j2.soa.signup.data.User" namespace="http://127.0.0.1:8080/signupWAR-1.0-SNAPSHOT/SignupDataSchema.xsd" /> <alias name="paymentMethod" class="com.j2.soa.signup.data.PaymentMethod" namespace="http://127.0.0.1:8080/signupWAR-1.0-SNAPSHOT/SignupDataSchema.xsd" /> <alias name="service" class="com.j2.soa.signup.data.Service" namespace="http://127.0.0.1:8080/signupWAR-1.0-SNAPSHOT/SignupDataSchema.xsd" /> <alias name="contactInfo" class="com.j2.soa.signup.data.ContactInfo" namespace="http://127.0.0.1:8080/signupWAR-1.0-SNAPSHOT/SignupDataSchema.xsd" /> </property>
How ever, the wsdl wrap the return data of the web service in a response, something like:
<message name="SignupProcessor_allocatServiceResponse"> <part name="return" type="tns:user"/> </message>
And I got this exception in jBossESB:
com.thoughtworks.xstream.mapper.CannotResolveClassException: allocatServiceResponse : No ClassLoaders found for: allocatServiceResponse
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(ClassAl
iasingMapper.java:76)
....
So am I using it correctly? or do I need to provide an alias for the allocatServiceResponse? but where I can get it, since I no longer need a true web service client.
Please help.