Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2004

Tip: Looking for answers? Try searching our database.

Overloading SOAP Interpretations for Specific Primitive Types

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
brian.mills - 17 Nov 2004 03:34 GMT
I have a 3rd party web service that is returning non standard primitive
types. IE. instead of returning <att>false</att>, its returning <att></att>.
a similar problem exists for datetime.

Is there anyway to overload how the inbuilt web service services interprets
primitive types?
Dan Rogers - 18 Nov 2004 23:14 GMT
Hi Brian,

Unfortunately what is coming over on the wire is a invalid value for a
value type of type boolean. Without some added behaviors in your code, you
will not get the results you are looking for.  If a <att nill=true/> were
being received, or if the field were omitted totally, you could probably
just attribute a default into the class that you are deserializing into,
but an empty field will not be perceived as nill (*nills on value types are
a different interoperability problem at the moment besides)

First I'd confirm that this bug is not possible to address on the sender's
side.  That example of a "false" is definitely not intuitive, nor XML
compliant for a boolean value set.  The easiest way to support your
position is to validate the data returned as XML against the schema for the
return.  If the return type expected is a boolean, the empty value will
fail validation - and so as a caller you have a solid basis for calling
this a bug.

If you don't have the leverage to get this bug fixed, you probably will
need to intercept the data being returned, check for known problems and fix
the XML before it is sent to the deserialization step.  The simplest way I
know to do this is to create a custom Web Service Extension that modifies
the incoming XML when the right conditions are met.

I hope this helps,

Dan Rogers
Microsoft Corporation
--------------------
>Thread-Topic: Overloading SOAP Interpretations for Specific Primitive Types
>thread-index: AcTMVkjJ7pj37CrRSJO5/fmbEgnuEw==
>X-WBNR-Posting-Host: 210.8.233.77
>From: "=?Utf-8?B?YnJpYW4ubWlsbHM=?="
<brian.mills@discussions.microsoft.com>
>Subject: Overloading SOAP Interpretations for Specific Primitive Types
>Date: Tue, 16 Nov 2004 19:34:03 -0800
[quoted text clipped - 13 lines]
>Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:26654
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
[quoted text clipped - 4 lines]
>Is there anyway to overload how the inbuilt web service services interprets
>primitive types?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.