JBoss Native WS - problem with Abstract class as output Parameter in WebService
prakash_pethe Jun 23, 2011 7:38 AMI've a problem to use abstract class in a Web Service like WebMethod output parameter.
Environment:
- jboss-5.1.0.GA
- eclipseHelios
-windowsXp- SP3
I'm using JBOSS-5.1.0.GA and java runtime Version 6. It always return emtpry tag for abstract tag.
I have completed below step as wellWhen running under Java 6 you need to manually copy the following libraries from the JBOSS_HOME/client directory to the JBOSS_HOME/lib/endorsed directory, so that the JAX-WS 2.0 apis supported by JBossWS are used:
jbossws-native-saaj.jar
jbossws-native-jaxrpc.jar
jbossws-native-jaxws.jar
jbossws-native-jaxws-ext.jar
for below section of WSDL:
<xsd:complexType name="Personne" abstract="true" />
<xsd:complexType name="PersonnePhysique">
<xsd:complexContent>
<xsd:extension base="Personne">
<xsd:complexType name="PersonnePhysique">
<xsd:complexContent>
<xsd:extension base="Personne">
<xsd:sequence>
<xsd:element name="idFonctionnel" type="IdFonctionnel" maxOccurs="1"
minOccurs="1" />
<xsd:element name="civilite" type="Civilite" maxOccurs="1"
minOccurs="0" />
minOccurs="0" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Below is ant target we are using to generate code.
<target name="consume" depends="init" >
<echo message="Génération des classes à partir du WSDL"/>
<wsconsume
fork="true"
verbose="true"
destdir="${classes.dir}"
sourcedestdir="${srcgen.dir}"
keep="true"
extension ="true"
wsdl="../${wsdl.dir}/${wsdlName}"/>
</target>
We actualy using Personne as response from web service.
Getting below error stack:
javax.xml.ws.WebServiceException: javax.xml.bind.UnmarshalException: Unable to create an instance of com.sfr.sigc.rechercherpersonneetroles.Personne
- with linked exception:
[java.lang.InstantiationException]
at org.jboss.ws.core.jaxws.JAXBDeserializer.handleUnmarshallException(JAXBDeserializer.java:110)
at org.jboss.ws.core.jaxws.JAXBDeserializer.deserialize(JAXBDeserializer.java:78)
at org.jboss.ws.core.binding.DeserializerSupport.deserialize(DeserializerSupport.java:58)
at org.jboss.ws.core.soap.XMLContent.unmarshallObjectContents(XMLContent.java:179)
at org.jboss.ws.core.soap.XMLContent.transitionTo(XMLContent.java:96)
at org.jboss.ws.core.soap.SOAPContentElement.transitionTo(SOAPContentElement.java:140)
at org.jboss.ws.core.soap.SOAPBodyElementDoc.transitionTo(SOAPBodyElementDoc.java:85)
at org.jboss.ws.core.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:172)
at org.jboss.ws.core.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:261)
at org.jboss.ws.core.EndpointInvocation.getReturnValue(EndpointInvocation.java:195)
at org.jboss.ws.core.CommonClient.syncOutputParams(CommonClient.java:511)
at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:397)
at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:290)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:170)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
at $Proxy309.rechercherPersonneEtRoles(Unknown Source)
The same was working fine with CXF stack before. Please suggest solution without changinf WSDL as we can't chnage that.