Discussion:
Setting default value for WSDL element
(too old to reply)
a***@gmail.com
2007-11-02 14:26:31 UTC
Permalink
Greetings,

I am encountering a strange issue with my Webservices. I am tryting to set a default value for a wrapper type (Integer). I tried with primitive type int as well. Here is what I am doing in the wsdl

<element name="someValue" type="xsd:int" nillable="true" default="20"/>

When message is going across wire from client to server, my stubs do not send out the default value. Through tcpmon I see the following:

<someValue xmlns="http://somenamespace">0</someValue>

Ofcourse Server is not picking up the default value when it's de-serializing the soap request. My online research tells me that this is the standard way to set a default value. Any chance this needs to be set in a different way for WAS 6.0/6.1?

Awaiting your response. With regards.
Dan Zrobok
2007-11-02 19:49:06 UTC
Permalink
No, you'd find that if you SET the value to 20, it would also not get
serialized. You've defined the constant at the WSDL level. The parser is
smart enough to realise that it doesn't need to be sent over the wire.
--
Dan Zrobok
Technical Architect
Perficient - www.perficient.com
"Experts in delivering business-driven technology solutions."
Post by a***@gmail.com
Greetings,
I am encountering a strange issue with my Webservices. I am tryting to set
a default value for a wrapper type (Integer). I tried with primitive type
int as well. Here is what I am doing in the wsdl
<element name="someValue" type="xsd:int" nillable="true" default="20"/>
When message is going across wire from client to server, my stubs do not
<someValue xmlns="http://somenamespace">0</someValue>
Ofcourse Server is not picking up the default value when it's
de-serializing the soap request. My online research tells me that this is
the standard way to set a default value. Any chance this needs to be set
in a different way for WAS 6.0/6.1?
Awaiting your response. With regards.
Loading...