Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » JAX-WS and type substitution
JAX-WS and type substitution [message #990642] Thu, 13 December 2012 14:56 Go to next message
Daniel Mühlemann is currently offline Daniel MühlemannFriend
Messages: 2
Registered: December 2012
Junior Member
Dear all

I generated a WebService consumer from WSDL in Scout. The WebMethod I call returns a list of "Vehicle"-objects. When I iterate over the result list and try to cast its elements to the subclass "Car" I get a ClassCastException. I can't even check the type with instanceof.

I could solve the problem in adding the annotation @XmlSeeAlso({Car.class}) to the generated WebService Stub. Unfortunately I lose my changes when I rebuild the WebService Stub.

Is it possible to handle this type substitution automatically?

Best Regards
Daniel
Re: JAX-WS and type substitution [message #990978 is a reply to message #990642] Sun, 16 December 2012 00:42 Go to previous messageGo to next message
Daniel Wiehl is currently offline Daniel WiehlFriend
Messages: 1
Registered: May 2016
Junior Member
Your are right, the annotation @XmlSeeAlso allows you type substitution for types that are neither directly nor indirectly referenced by the service endpoint.

As this annotation is on only available from JAX-WS 2.1 compliance level and by default Scout SDK generates 2.0 JAX-WS artifacts (meaning that the generated code is compliant for JAX-WS 2.0 specification), you are missing this annotation in your webservice stub.

You can change this version easily on the webservice node in Scout SDK. Simply click on your webservice consumer or provider and open the link 'Edit build properties' in the 'Stub properties' section of your service property page.
There you find the option 'target' with the default value '2.0'. Change this to 2.1 and the @XmlSeeAlso annotation will be generated the next time you rebuild your webservice stub. By the way, those properties directly correspond to the WsImport options used to generate the webservice stub and are stored in the build-jaxws.xml file. So the next time you generate your stub, those options are remembered and you do not have to set them again.
Re: JAX-WS and type substitution [message #991029 is a reply to message #990978] Mon, 17 December 2012 06:30 Go to previous message
Daniel Mühlemann is currently offline Daniel MühlemannFriend
Messages: 2
Registered: December 2012
Junior Member
Thank you for your reply, it works!
Previous Topic:AbstractSqlService.getSequenceNextval() specific to Oracle
Next Topic:ScoutInfoForm
Goto Forum:
  


Current Time: Fri Apr 19 23:20:00 GMT 2024

Powered by FUDForum. Page generated in 0.02612 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top