[esb-issues] [JBoss JIRA] Commented: (JBESB-1334) responseXStreamConfig issue

Kevin Conner (JIRA) jira-events at lists.jboss.org
Fri Jan 18 11:33:26 EST 2008


    [ http://jira.jboss.com/jira/browse/JBESB-1334?page=comments#action_12395692 ] 
            
Kevin Conner commented on JBESB-1334:
-------------------------------------

Hiya Jirka.

I have had a look at your examples and it looks like neither have been configured correctly.

Even after correcting the last example (didn't fix the first) there is still an issue which we have to address.

The webservice_consumer1 WSDL specifies the response as

   <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
   ...
   <xs:complexType name="sayHelloResponse">
    <xs:sequence>
     <xs:element minOccurs="0" name="return" type="xs:string"/>
    </xs:sequence>
   </xs:complexType>

So the structure of the response is actually

<tns:sayHelloResponse>
  <return>The response from the webservice</return>
</tns:sayHelloResponse>

As a consequence you need to define a class reflecting this structure to contain the response.

Now the issue that needs to be addressed is how the inner elements are mapped onto the fields.
By default the reflection converter uses the name of the element as the field name, in this case
it is a java reserved word (return) so it will never be present.  In order to handle these cases we
need to take advantage of the xstream field mappings *or* enable the annotated classes.

Both of these are a simple addition to the current codebase and will solve the real underlying issue.

> responseXStreamConfig issue
> ---------------------------
>
>                 Key: JBESB-1334
>                 URL: http://jira.jboss.com/jira/browse/JBESB-1334
>             Project: JBoss ESB
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Web Services
>    Affects Versions: 4.2.1
>            Reporter: Jaroslaw Kijanowski
>         Assigned To: Kevin Conner
>             Fix For: 4.2.1 CP1
>
>         Attachments: webservice_consumer1_using_responseXStreamConfig.tar.gz, webservice_drools_intg-UPDATED.tar, webservice_drools_intg.tar
>
>
> To reproduce:
> download attached QS
> ant deploy
> ant runtest
> I have a webservice and try to consume it via SOAPClient.
> message.getBody().get() has following entry:
> <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:getCustomerResponse xmlns:ns2="http://webservice_drools_intg/droolsws"><return><birthDate>1980</birthDate><group>0</group><license>3</license></return></ns2:getCustomerResponse></env:Body></env:Envelope>
> This webservice returns a POJO, so I tried to use the responseXStreamConfig property to populate a bean:
> <property name="responseXStreamConfig">
> <alias name="return" class="org.jboss.soa.esb.samples.quickstart.webservice_drools_intg.Customer" namespace="http://webservice_drools_intg/droolsws" />
> </property>
> Here's the output:
> com.thoughtworks.xstream.converters.ConversionException: return : No ClassLoaders found for: return
> ---- Debugging information ----
> required-type       : org.jboss.soa.esb.samples.quickstart.webservice_drools_intg.Customer 
> cause-message       : return : No ClassLoaders found for: return 
> class               : org.jboss.soa.esb.samples.quickstart.webservice_drools_intg.Customer 
> message             : return : No ClassLoaders found for: return 
> line number         : 1 
> path                : /org.jboss.soa.esb.samples.quickstart.webservice_drools_intg.Customer/return 
> cause-exception     : com.thoughtworks.xstream.alias.CannotResolveClassException 
> -------------------------------
>         at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:45)
>         at com.thoughtworks.xstream.core.ReferenceByXPathUnmarshaller.convertAnother(ReferenceByXPathUnmarshaller.java:39)
>         at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:99)
>         at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:12)
>         at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:552)
>         at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:531)
>         at org.jboss.soa.esb.actions.soap.SOAPClient.applyXStreamResponseDeserializer(SOAPClient.java:425)
>         at org.jboss.soa.esb.actions.soap.SOAPClient.processResponse(SOAPClient.java:398)
>         at org.jboss.soa.esb.actions.soap.SOAPClient.process(SOAPClient.java:341)
>         at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
>         at org.jboss.soa.esb.listeners.message.MessageAwareListener$1.run(MessageAwareListener.java:303)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: com.thoughtworks.xstream.alias.CannotResolveClassException: return : No ClassLoaders found for: return
>         at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:35)
>         at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
>         at com.thoughtworks.xstream.mapper.XmlFriendlyMapper.realClass(XmlFriendlyMapper.java:44)
>         at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
>         at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:49)
>         at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
>         at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
>         at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
>         at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:46)
>         at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
>         at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
>         at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
>         at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:70)
>         at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
>         at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
>         at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
>         at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:27)
>         at com.thoughtworks.xstream.converters.reflection.ReflectionConverter.determineType(ReflectionConverter.java:179)
>         at com.thoughtworks.xstream.converters.reflection.ReflectionConverter.unmarshal(ReflectionConverter.java:102)
>         at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:38)
>         ... 13 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the esb-issues mailing list