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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:35:42+00:00 2026-06-14T09:35:42+00:00

I have a WCF service with the following method: [OperationContract] TernaryWebServiceResponse<long> ModifyObservations(…); Response object

  • 0

I have a WCF service with the following method:

[OperationContract]
TernaryWebServiceResponse<long> ModifyObservations(...);

Response object is as following:

[DataContract]
public class TernaryWebServiceResponse<T>
{
    [DataMember]
    public TernaryProcessingResultStatus ProcessingSuccessStatus { get; set; }

    [DataMember]
    public Dictionary<T, bool> ProcessingSuccessDetails { get; set; } 
}

This class is defined in a shared assembly and WCF reference is configured to reuse it.

But when I generate the proxy, I get something like this:

Custom tool warning: Cannot import wsdl:portType Detail: An exception
was thrown while running a WSDL import extension:
System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Referenced type ‘TernaryWebServiceResponse`1, General,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ with data
contract name ‘TernaryWebServiceResponseOflong’ in namespace
‘http://schemas.datacontract.org/2004/Genaral.SoapCommunication&#8217;
cannot be used since it does not match imported DataContract. Need to
exclude this type from referenced types.

Can somebody plz explain me, what is exactly the problem here? I know that generics can be used in WCF contracts as long as they are resolved, e.g. not MyObj<T> but MyObj<long>. So what’s wrong with this class? Is it that T defined on the class cannot be somehow resolved on the dictionary?

  • 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-14T09:35:43+00:00Added an answer on June 14, 2026 at 9:35 am

    Maybe defining a new contract will help.
    Something like:

    [DataContract] 
    public class LongTernaryWebServiceResponse : TernaryWebServiceResponse<long> 
    { 
    }
    

    And then in your service contract something like:

    [OperationContract]
    LongTernaryWebServiceResponse ModifyObservations(...);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple WCF service method: [OperationContract] public SetupGameResult SetupGame(long player1Id, long player2Id,
I have following method in wcf webenabled service Public Person AddPerson(Person p); As of
Given that I have the following WCF service: class LookUpService { public List<County> GetCounties(string
I have an ajax enabled WCF service method : [OperationContract] public string Test(string name)
In my WCF service I have method with 'int' parameter: [OperationContract] PublishResult PublishEnrollmentProfile( string
I have a WCF-REST service with one method which returns a string: [ServiceContract] public
I have the following method on a WCF service: /// <summary> /// Receives the
I have the following classes: [DataContract] [KnownType(typeof(SpecifiedItemCollection))] public class ItemCollection<T> : IEnumerable where T
I have an ADO.NET Data service that I run through WCF: public class AdminService
I have a WCF Service with the following requirements: a) The client requests a

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.