What about to look into the implementation of the generated class and change it to the behavior you want?

Regards,

Oliver

-----Ursprüngliche Nachricht----- From: Andreas Veithen
Sent: Wednesday, July 01, 2015 9:17 PM
To: java-user
Subject: Re: Formatting BigDecimal element in response

I doubt that there is any Web service framework that supports this use
case. The reason is that the XML schema spec clearly specifies that
"enumeration constrains the value space to a specified set of values."
[1] What you are asking for is to restrict the lexical space instead,
and there is no good reason for that.

Andreas

[1] http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#dt-enumeration

On Wed, Jul 1, 2015 at 2:55 PM, T. Allen <b...@verizon.net> wrote:
I have an element defined as:

<xsd:simpleType name="ShipmentType">
<xsd:restriction base="decimal">
<xsd:enumeration value="50" />
<xsd:enumeration value="60" />
<xsd:enumeration value="77.5" />
</xsd:restriction>
</xsd:simpleType>

The class generated by the wsdl2java tool expects a BigDecimal parameter:

public void setShipment(java.math.BigDecimal ship)

The problem is that passing a value of 50 to the method produces a value of "50.0" (no quotes) in the response. How can I get the value formatted as in
the enumeration?  I want the values to appear as 50, 60 or 77.5.

Any advice or tips are much appreciated!

Thanks,
T


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
For additional commands, e-mail: java-user-h...@axis.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
For additional commands, e-mail: java-user-h...@axis.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
For additional commands, e-mail: java-user-h...@axis.apache.org

Reply via email to