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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:55:54+00:00 2026-05-11T02:55:54+00:00

I’m currently working on a wcf service that does some lookups in a database

  • 0

I’m currently working on a wcf service that does some lookups in a database and return the data to the client. The user has entered an id of something he wants to see in a textbox. This could be a client-id, a product-id, an order-id or whatever. The lookup method on the server tries to find the id in the client table. If it’s not in there it goes on the the product table etc, until it’s found.

When calling to the server there is no way to tell what the user is looking for. As far as I know I need to specify the return type design time, otherwise serialisation of the objects doesn’t work. The only thing I can come up with is helper class containing all possible objects and return that from the wcfservice, any better ideas?

Additional info: We’re using a wsHttpBinding and Linq-To-Sql. The database is legacy and also used other software so the dataobjects can’t be changed.

  • 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. 2026-05-11T02:55:55+00:00Added an answer on May 11, 2026 at 2:55 am

    You didn’t mention the binding you are using for your service. If it is SOAP based binding such as wsHttpBinding or basicHttpBinding then all the possible types that your method can possibly return must be known at compile time so that they can be exposed in the WSDL and the clients can generate proxy classes. In this case you have to define a base class containing the id that all your entities will derive from and use either the ServiceKnownTypeAttribute or list them in your app.config/web.config file:

    <system.runtime.serialization>     <dataContractSerializer>         <declaredTypes>             <add type='MyNamespace.Entity'>                 <knownType type='MyNamespace.Client' />                 <knownType type='MyNamespace.Product' />                 <knownType type='MyNamespace.Order' />             </add>         </declaredTypes>     </dataContractSerializer> </system.runtime.serialization> 

    If you are using binary serialization over TCP then it is not necessary specify known types at compile time because the binary serializers will transmit type information.

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

Sidebar

Ask A Question

Stats

  • Questions 58k
  • Answers 58k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You'll need to be sure that Python has been built… May 11, 2026 at 8:38 am
  • added an answer If you 'pre-compile' the web site using the aspnet_compiler.exe tool… May 11, 2026 at 8:38 am
  • added an answer Changed the HTML charset to ISO-8859-1 fixed the problem! Silly May 11, 2026 at 8:38 am

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

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.

      Related Questions

      No related questions found