SOAP: marshalling SmallIntegers as xsd:short's

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SOAP: marshalling SmallIntegers as xsd:short's

Randy Coulman
We're running into a problem with our WS server (in VW 7.4).  If we try to return an integer value >32767, but < SmallInteger maxVal, we end up with an error on the (non-VW) client side, because SmallIntegers get marshaled as xsd:short's, which are considered to be 16-bit signed integers.  So, we're essentially marshaling invalid values.

If we were to change the type mapping so that SmallIntegers marshal as xsd:ints instead, then we might run into the opposite problem, which is being sent a value that's too big for a SmallInteger.  I don't think this is a big problem, because VW will automatically promote those values to a larger integral type, which should be fine.

I have two questions:

1. Should the default mapping in XMLObjectBinding class>>defaultSmalltalk2XMLMap be changed?

2. If not, is there a way I can change it for my server?

Thanks,
Randy
--
Randy Coulman
[hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: SOAP: marshalling SmallIntegers as xsd:short's

Kogan, Tamara
> We're running into a problem with our WS server (in VW 7.4).  If we
try to
> return an integer value >32767, but < SmallInteger maxVal, we end up
with
> an error on the (non-VW) client side, because SmallIntegers get
marshaled
> as xsd:short's, which are considered to be 16-bit signed integers.
So,
> we're essentially marshaling invalid values.
>
> If we were to change the type mapping so that SmallIntegers marshal as
> xsd:ints instead, then we might run into the opposite problem, which
is
> being sent a value that's too big for a SmallInteger.  I don't think
this
> is a big problem, because VW will automatically promote those values
to a
> larger integral type, which should be fine.
>
> I have two questions:
>
> 1. Should the default mapping in XMLObjectBinding
> class>>defaultSmalltalk2XMLMap be changed?
>
> 2. If not, is there a way I can change it for my server?

The only way to handle this is to change the type description to xsd:int
in the wsdl schema. You will need to change the type description in XML
to Object binding also. Don't forget to remove the old X2O binding from
XMLObjectBinding registry before you load the updated binding.
There is an open AR to provide XML simple type validation. When we
finish there will be some notification raised if a small integer exceeds
maximum for "xml:short".

Tamara