Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 13th, 2006, 11:44 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default Casting XML Generated Class

I have generated a class using XSD.EXE as per http://dotnetjunkies.com/QuickStartv.../XSDToCls.aspx .

This has all worked well, and I inherrited this class into a new object on the web service where I have placed the methods to work with the data.

My intention was to cast the incomming xml object into my new inheritted class and work on it from there.

However I am getting a cast error when trying to cast to the inherrited class.

quote:Unable to cast object of type 'RioInBound.ShipmentManifest' to type 'B2B.Rio.ShipmentManifest'.
Am I correct that I should be able to complete this cast.
Class Dog: Animal{}
public void test(Animal animal)
Dog d = (Dog) animal;
And is there any reason why it wont work with XSD.EXE generated classes.

Many thanks in advance for any assistance

They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
"They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad."

Similar Threads
Thread Thread Starter Forum Replies Last Post
apply css class to dynamically generated table row nikeshkm Javascript 2 September 28th, 2006 03:52 AM
xml and class properties sushma.varala XML 0 July 14th, 2006 07:59 AM
xml or class properties sushma.varala Classic ASP Components 0 July 14th, 2006 07:52 AM
setting content type of asp generated xml whyulil Classic ASP XML 0 July 15th, 2005 04:50 AM
Parsing Microsoft generated XML Richard Lightfoot Pro PHP 3 September 16th, 2004 06:11 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.