Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Nullable boolean true on webservice response comes across as null

10 views
Skip to first unread message

ak

unread,
May 16, 2006, 1:15:02 PM5/16/06
to
Hello all,
I'm working on a web app that we converted over to asp 2.0 recently and
here's the issue I ran into:
We use a java webservice to retrieve data and display this data to the user.
This was working in 1.1 and nothing changed around this particular webservice
call on either side after the switch to 2.0. The webservice response is an
array of value objects and the value object contains a boolean. I intercepted
the response with Fiddler and verified that the boolean was set to either
true or false on all the vo's in the array. But after the response object was
created and I could look at it in the code while debugging, the (nullable)
boolean field in every vo in the array was null.

To fix this temporarily, I had the webservice provider change the boolean
field to a 'NullableBoolean' class that contained a boolean value - this way,
the correct value came across and I could work with it.

I'm not sure if this is helpful, but there's one more detail I noticed -
The xml doc I intercepted with Fiddler looks something like this
('processed' is the boolean variable):

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"...>
<env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
...
<responseVos...>
...
<ResponseVo ...>
...
<processed href="#ID_4"/>
...
</ResponseVo>
...
</responseVos...>
...
<xsd:boolean xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xsi:type="xsd:boolean" id="ID_4">true</xsd:boolean>
...
</env:Body>
</env:Envelope>

This is working for now but I think I shouldn't have to have my webservice
provider fix my problem, right? Any help in solving this problem would be
greatly appreciated.
--
ak

Steven Cheng[MSFT]

unread,
May 17, 2006, 12:20:48 AM5/17/06
to
Hi ak,

Thank you for posting.

From your description, I understand you're using .net framework generated
proxy to consume a java based webservice. This webservice will return an
array of custom object type, and this type contains a boolean field.
However, at runtime, you found the .net client proxy class can not
correctly populate the boolean field of the value object class from SOAP
message(through the boolean value does exists in the SOAP content),
correct? If there is anything I missed, please feel free to let me know.

Based on my experience, such issue is possibly caused by incompatibility of
the server-side service's contract and the client-side platform's support
on the SOAP message data structure. Also, basd on the message snippet you
pasted, the webservice is using RPC/encoded style SOAP message. RPC/encoded
style SOAP message will format class objects or structures based on the
SOAP encoding rule rather than XML schema, generally when're not quite
recommended to use such style. Anyway, since the service is already
constructed under java platform, we may need to concentrate on our .net
client. Would you be able to create a simplified java service which
return a single valueobject(not in array) that can reproduce this problem?
If so, you can provide the WSDL document of that service or some captured
SOAP message of that service so that we can do some further analysis on
them.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


0 new messages