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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:41:34+00:00 2026-06-14T23:41:34+00:00

I have an application which will use WCF as the underlying transport mechanism of

  • 0

I have an application which will use WCF as the underlying transport mechanism of an app protocol, but this question is more about service orientated design rather than WCF specifically.

I have different data source plugins running on the server which can be referenced by the client calling GetData on the service, and specifying the data source name. Such a function call would return a list of data such as an array of overdue invoices:

class OverdueAccounts
{
    float Amount;
    int Days;
    string Reference;
}

Or an array of open support cases:

class OpenTickets
{
    DateTime Date;
    Guid TicketId;
    TicketStatus Status;
}

Only on loading of plugins would we know the types that will be returned and what data access methods are available.

public interface IDataSourcePlugin /* plugin running on server */
{
  string Name;
  Type DataType;
  object GetDataType(); // returns a type of the type specified above by DataType
}

public interface IAppService /* service contract */
{ 
  [OperationContract]
  object GetData(string datasourceName); // will call plugins IDataSourcePlugin.GetDataType
}

My issue is these types will only be known at runtime and I don’t like untyped objects but don’t know of any other recommended way to achieve what I need.

I have thought about transferring the data object by return a string of XML and specifying a DTD to validate, but this adds an extra layer on top of what WCF can do for me already.

Alternatively, I can set up a concrete set of operations such as ReadString(string fieldname), ReadInt(string fieldname) and so forth, but that could mean many calls.

It is important to keep the data flow and messages within the set protocol and all going from client to the server and then the server on to the data source, as opposed to each client going directly to the data source. This is for caching and other business requirement reasons.

Any recommendations on how to structure the transport and structure for types which can only be known at runtime or an alternative design would be great.

  • 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-06-14T23:41:38+00:00Added an answer on June 14, 2026 at 11:41 pm

    You need to add a ServiceBehavior with a custom DataContractResolver to the service. In this custom DataContractResolver you can dynamically add your Types and the corresponding names.

    On the client side you most likely will also have to add a similar contract resolver, so this only works if you know what types you might reveive from the service.

    I am using a simple Dictionary in both resolvers.

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

Sidebar

Related Questions

I have an application which will use WCF to serve up various chunks of
Please advise me on this. I have both Wcf service (which will be responsible
I have a client-server application, which intercommunicate via WCF. They also both use Castle
I have a phonegap application which will need to take a zip archive of
I have a silverlight application which users will be running in various time zones
I'm designing an application which will have a network interface for feeding out large
I am making an application which will have an interface similar to Photoshop: multiple
I have a textField in my application which will be initiated programmatically (textField.setText() )
I have to implement a iphone application which will record user's voice as you
I have been working on a facebook application which will be using Graph API

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.