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

  • Home
  • SEARCH
  • 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 308485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:39:17+00:00 2026-05-12T07:39:17+00:00

I am consuming a WCF service from another company, and it is returning an

  • 0

I am consuming a WCF service from another company, and it is returning an object of type object. Is there a reason not to return the actual class, and return an object that must be cast into the correct form?

For example, if the web service returns an object of type OrderStatus, why would you instead return a plain old object?

Correct me if I’m wrong, but this will require me to get the definition of the OrderStatus class manually (via email or whatever), and put it in my solution. Plus, I will have to explicitly cast the object to an OrderStatus object. Not to mention that the company could change the service to return an object of another type, and my code will stop working.

If the return value of the service was an object of type OrderStatus, the class would be automatically generated for me right?

  • 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-12T07:39:17+00:00Added an answer on May 12, 2026 at 7:39 am

    No, definitely not return “object” ! WCF should make use of DataContracts and define full implementations of the request and possibly response objects for each call.

    See these two excellent articles on Datacontract basics:

    • WCF tutorial part 2 – Data Contracts
    • WCF Basics – Data Contracts

    I have no idea why the developers of those services picked “object” as the return type – doesn’t make a whole lot of sense to me!

    Marc

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

Sidebar

Related Questions

I am consuming a WCF Service from a webpart in Sharepoint 2007. But its
I have a WCF web service using wsHttpBinding that I am consuming from a
I need to call two operations from a WCF Service that we are consuming
I am consuming a WCF service from a WP7 app. Both are in a
I have found 2 ways of consuming a WCF service without the help from
We've got a WCF service that we're consuming from a web app. The client
I'm having hard time consuming a secure WCF Web Service from a PHP site.
Here i am consuming a WCf service in MVC and retrieving values from that
Per my other post about WCF service return values , I'm consuming a web
I asked about consuming a WCF service from RPG here and received this response:

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.