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 91413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:01:34+00:00 2026-05-10T23:01:34+00:00

Background I have made a Web Service in Visual Studio, and I’m trying to

  • 0

Background

I have made a Web Service in Visual Studio, and I’m trying to consume it using the automatically generated proxy class. The Web Service returns a class that I have implemented, containing a List.

Question

The proxy class has automatically generated methods to send the SOAP to the web service. It uses the Invoke() method to execute the call, and then casts the result as a DataSet. How can I get this object back into the class I know it is?

I know that I can hand-edit the auto-generated file, but that’s not very maintainable, so I don’t want to go down that route (any time the Web Service is rebuilt, the changes would have to be made again).

Is there a way to tell the generated class to be more specific, and actually use the correct data type? Or do I have to write a clunky set of deserialisers to get my data back into the correct shape?

Example

One method in my Web Service class:

[WebMethod] public UpdateList RetrieveUpdates(long sessionID, string configurationVersion, string coreVersion, string researcherDBVersion) { ... } 

Adding the class as a Web Reference generates the following proxy method:

public DataSet RetrieveUpdates(long sessionID, string configurationVersion, string coreVersion, string researcherDBVersion) {     object[] results = this.Invoke('RetrieveUpdates', new object[] {         sessionID,         configurationVersion,         coreVersion,         researcherDBVersion});    return ((DataSet)(results[0])); } 

The DataSet I receive from this method is always empty (because you can’t cast from my class to a DataSet).

Thanks in advance

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T23:01:34+00:00Added an answer on May 10, 2026 at 11:01 pm

    Since Web References generate partial classes, you should be able to add to your project a partial class extension to the proxy class that reimplements just the method in question (just copy and paste it) but changes the return type (and the name, of course). If the method signature changes, you’ll have to update your extension, but at least if that doesn’t happen and you regenerate the proxy you won’t have to reapply any changes (and you can still use any other generated classes/methods as is).

    I’ve used this approach before to ‘fix’ proxy classes (for instance, to add SOAP headers that aren’t defined in the WSDL), and while not ideal, it does work.

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

Sidebar

Related Questions

I have made a simple web page using jQuery. When opening it on another
First a bit of background: We have a growing RESTful service layer supporting web
I have made a firefox extension which loads a web page using xmlhttprequest .
Background: I have a web service that returns the rows in a table (table
I have made a code for scrolling a background in Cocos2d to create an
I have made Catifier.com recently, and once the user sets their own background image,
I have a custom made UINavigationBar (different size, background etc) that has inside a
I am working on streaming a song from the web. I have made the
I am trying to self-learn developing Web applications using Python as backend. Since I
Question: Is it possible to (automatically) change the base class of auto-generated domain objects

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.