cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maharajapuram Ramchandran <me.ramchand...@gmail.com>
Subject wsdl2java data type mapping discrepancy
Date Thu, 20 May 2010 17:45:32 GMT
Hello,

We are using CXF 2.2.2 to write a webservice and I'm running into this
issue:

I have 2 operations in the service and for a particular node this is what I
have in the XSD. As you can see, the only difference that I have is that the
ID is an optional element in the second operation.

*Operation1:*

<xs:element name="ID" type="ID1"/>

<xs:simpleType name="ID1">

<xs:restriction base="xs:int">

<xs:pattern value="[0-9]{9}"/>

</xs:restriction>


*Operation2*

<xs:element name="ID" type="ID1" minOccurs="0"/>

<xs:simpleType name="ID1">

<xs:restriction base="xs:int">

<xs:pattern value="[0-9]{9}"/>

</xs:restriction>

</xs:simpleType>



When we generate the stubs using wsdl2java, the first one is getting
generated as


protected int ID;

and the second one is

protected Integer requestorID;

I did go through the Aegis default mapping details (
http://cxf.apache.org/docs/aegis-theory-of-operation.html) and it says that
xs:int can be mapped to int or Integer, but I'm curious to know why is this
behaving differently. Is there a reason behind this or it is just random? If
not, Is there a way to get this generated as an Integer. Or should we change
the code manually? Is it a good practice to do that?

Would like to know if someone has faced this discrepancy before! Thanks..

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message