Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Overloading SOAP Interpretations for Specific Primitive Types

Reply
Thread Tools

Overloading SOAP Interpretations for Specific Primitive Types

 
 
brian.mills
Guest
Posts: n/a
 
      11-17-2004
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?
 
Reply With Quote
 
 
 
 
Dan Rogers
Guest
Posts: n/a
 
      11-18-2004
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=?="

<>
>Subject: Overloading SOAP Interpretations for Specific Primitive Types
>Date: Tue, 16 Nov 2004 19:34:03 -0800
>Lines: 6
>Message-ID: <B90F31E6-0D9A-4677-A597->
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
>Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: cpmsftngxa10.phx.gbl

microsoft.public.dotnet.framework.aspnet.webservic es:26654
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
>
>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?
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default primitive values from primitive Class<?> object. Daniel Pitts Java 7 10-23-2008 04:30 PM
setting a specific range for primitive value for the compiler marcwentink@hotmail.com Java 7 06-09-2007 06:37 PM
YAML for Ruby: How to turn off the boolean interpretations? mikshir Ruby 6 12-16-2005 11:06 PM
Primitive vs. non-primitive l-value richardclay09@yahoo.co.uk C++ 7 05-09-2005 02:52 PM
Collections API for primitive types =?ISO-8859-1?Q?S=F8ren_Bak?= Java 0 08-27-2003 06:59 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57