Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 556603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:56:14+00:00 2026-05-13T11:56:14+00:00

I have a WSE 3.0 based web service, and a WinForms client application that

  • 0

I have a WSE 3.0 based web service, and a WinForms client application that makes use of the types defined in that service’s References.cs, but subclasses them to provide some additional functionality required by the client.

However, when I pass an instance of the subclass back to the web service, even though I explicitly cast back to the original type, I get the dreaded:

Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.

in reference to my derived type.

Code summary:

public class DefinedInReferenceCs
{ 
    // ... 
}

public class ClientSubclass : DefinedInReferenceCs
{
    // My extra stuff
}

public class MyClient
{
    public CallTheWebService(ClientSubclass  obj)
    {
        // obj is an instance of ClientSubclass,  cast as DefinedInReferenceCs
        svc.MyMethod((DefinedInReferenceCs)obj); 
        // Throws an exception complaining that ClientSubclass is not statically known
    }
}

I can get around this by explicitly creating a DefinedInReferenceCs instance and performing a deep copy of the relevant fields. Is there a better way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:56:14+00:00Added an answer on May 13, 2026 at 11:56 am

    Since the XML Serializer uses Reflection to work with objects, there is no way to keep it from seeing that your base class reference references an instance of your derived class. Yes, you must use XmlInclude.

    OTOH, have you considered using partial classes to add functionality to the original proxy classes? That way, you would not need a derived class at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .NET 2.0 application that uses WSE 3.0 to make web service
I have a WSE web service that returns a list of items in a
I have a WCF client connecting to a Java based Axis2 web service (outside
I have a WSE 3.0 based web service running in Windows Server 2003 under
I have a c# client application calling java web services. Everything works great but
For historical reasons, I have some WSE 3.0 web services that I cannot upgrade
I need to integrate with a legacy .NET Web Service that uses WSE 2.0
Despite enabling WSE 3.0 on client projects in Visual Studio 2005, web references I
I have a web service I'm trying to use on one of my sites.
I am creating a web service that will be consumed by a single client

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.