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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:52:28+00:00 2026-05-18T01:52:28+00:00

I try use WCF with protobuf-net r.282 Ok. I mark my contracts with ProtoBehavior

  • 0

I try use WCF with protobuf-net r.282

Ok. I mark my contracts with ProtoBehavior attribute

    [OperationContract,ProtoBehavior]
    [FaultContract(typeof(ServiceFaultException))]
    Dictionary<ActivityCategoryDTO, SalesTemplateDTO> GetSalesTemplates();

    [OperationContract, ProtoBehavior]
    [FaultContract(typeof(ServiceFaultException))]
    List<ActivityCategoryDTO> GetActivities();

Next, – DTO:

    [DataContract]
    [Serializable]
    [ProtoContract]
    public class ActivityCategoryDTO
    {
        [DataMember]
        [ProtoMember(1)]
        public int Id { get; set; }
        [DataMember]
        [ProtoMember(2)]
        public string Guid { get; set; }
        [DataMember]
        [ProtoMember(3)]
        public string Name { get; set; }
    }

I try consume this servise from client. When I call GetSalesTemplates – all is OK. I’ve got successful deserialized dictionary, but when I call GetActivities I get null at client.
Through fiddler I see that, data is transmitting succesfully, so I think it’s deserializer problem.

What’s wrong? How can I get List at Client?

EDIT

It seems that I have problems with all Lists 🙂

[DataContract]
[Serializable]
[ProtoContract]
public class SalesTemplateDTO
{
    [ProtoMember(1)]
    [DataMember]
    public string Name { get; set; }
    [ProtoMember(2)]
    public List<FieldTemplateDTO> Fields;
}

It comes to client just with Name, List of Fields is null again. Though all data is transmitted too.

  • 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-18T01:52:29+00:00Added an answer on May 18, 2026 at 1:52 am

    OK; I’ve reproduced and this actually looks to be the IDE/svcutil refusing to re-use the service-contract (interface) from your DTO assembly, even though it is re-using the data-contracts (classes). The mex-generated service-contract (interface) lacks the necessary extra attributes, so protobuf-net never gets asked to deserialize.

    Two options:

    Option 1

    use configuration rather than code to define the protobuf usage; the advantage of this is that it can be used without any changes to either client or server.

    Option 2

    don’t use the generated service wrapper – a generic counterpart can be written simply as:

    public class Client<T> : ClientBase<T> where T : class
    {
        public T Service { get { return Channel; } }
            public Client() {
        }
    
        public Client(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
    
        public Client(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
    
        public Client(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
    
        public Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }
    }
    

    Then consume as:

    using (var svc = new Client<IService1>())
    {
        var data = svc.Service.GetActivities();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Whenever I use WCF, I always try to make immutable classes that end up
I'm trying to consume a WCF webservice using the RPC capabilities of the Protobuf-net.
This is my first try trying to use WCF, so I'm guessing I'm doing
I just implemented a simple WCF server using net.tcp . First, I use 127.0.0.1
An application I'm writing needs to use .Net Remoting (I'm aware that WCF is
I'm trying to use impersonation with my WCF service (using net.tcp binding) hosted in
I have been trying to use protobuf-net with MonoTouch but I have no idea
I try use string as a regular expression pattern but I've following errors PHP
I try use a integer array in java with the code below: public static
I try to use the domainpeople.com API and to do I need to use

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.