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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:57:59+00:00 2026-06-04T10:57:59+00:00

Problem: I have a WCF service that invokes methods via reflection and sends the

  • 0

Problem: I have a WCF service that invokes methods via reflection and sends the results. Like so:

[OperationContract]
Object InvokeMemberByReflection(string typeName, string name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args);

I do this because I have an existing API X which I want to invoke. I don’t want to write wrappers for all of methods.

I also don’t use explicit DataContracts because both the server and client reference the same set of dlls.

However, for the InvokeMemberByReflection method above, since I’m sending method parameters as an array of type object, it looks like I have to add all possible method signatures of API X as KnownTypeAttributes for the DataContractSerializer to work.

Is there a work around for this? The CLR basically knows the types of the elements that are contained in the object array. Can it not serialize/deserialize based on this (granted it’s a different type all together)?

Also I would appreciate any other patterns for addressing such a problem. Reflection is too slow for obvious reasons.

  • 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-04T10:58:01+00:00Added an answer on June 4, 2026 at 10:58 am

    If the client and the server are using the same DLL (i.e., the types are exactly the same), then you can use the NetDataContractSerializer, which doesn’t need the known types attribute (it emits the CLR type information when serializing). This post has an example on how to use that serializer.

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

Sidebar

Related Questions

We have a WCF service that uses Microsoft.Practices.EnterpriseLibrary.Validation and receives an object like so
The problem: I have a WCF service that I'm trying to performance test with
I have a problem with getting jquery to retrieve results from a WCF service.
I have a WCF service that provides a couple of methods. A Windows Forms
I have a WCF service that accepts an object as a parameter that has
I am having the following problem: I have a WCF service that checks a
I have a WCF service that I'd like clients to be able to reference
I have created a WCF service that uses windows authentication and would like to
I have developed a VB.NET WCF service that recives and sends back data. When
Problem: I have a WCF service setup to be an endpoint for a call

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.