Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > XmlReturnReader in 2.0 does not support custom types?

Thread Tools

XmlReturnReader in 2.0 does not support custom types?

Posts: n/a
Hello All,

I noticed that System.Web.Services.Protocols.XmlReturnReader in .NET
Framework 2.0 (v2.0.50727) no longer capable of de-serializing custom
data types. This is vital capability for non-SOAP based web services
(REST, etc).

It appears that now set of supported types is limited to types
supported by System.Web.Services.Protocols.ScalarFormatter (such as:
int, long, double, string, and few other predefined types).

This new feature results in internal exception on attempt to use web
service with method returning custom type:

[HttpMethodAttribute(typeof(XmlReturnReader), ...)]
public MyCustomResult foo (...) { ... }

Here is the exception stack trace:

System.IndexOutOfRangeException: Index was outside the bounds of the
at System.Web.Services.Protocols.HttpClientType..ctor (Type type)
at System.Web.Services.Protocols.HttpSimpleClientProt ocol..ctor()
at System.Web.Services.Protocols.HttpPostClientProtoc ol..ctor()
at MyNS.MyServiceClient..ctor()

The same code worked fine with version 1.1.

There is a workarond - Extend XmlReturnReader and override
GetInitializers() method to return XmlSerializer according to resulting

P.S. God bless Lutz Roeder and his .NET Reflector

All the Best,

Reply With Quote

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
What does "driver does not support your hardware" mean? John Ritchie Computer Information 2 08-04-2007 04:59 AM
PC does not start and does not turn off sean Computer Support 3 12-28-2006 10:37 AM
Power button does not turn OFF? New power supply does not help! win2k lbbss Computer Support 0 01-06-2005 04:03 PM
pywin32 custom i/f COM servers do not support variable or optional args Philip Rittenhouse Python 0 06-30-2004 07:25 PM
ControlDesigner not invoked on custom control when control is rendered within another custom control Matt Sokol ASP .Net Building Controls 2 08-07-2003 07:13 AM