Protobuf-net wcf response

I am trying use protobuf-net serialization with wcf I have added the necessary configuration settings on client app.config and server web.config, decorated objects and the service interface. I am using fiddler to examine the request and response. The request is using proto serialization but the response from the wcf service uses datacontractserializer. I am able to serialize and deserialize the onjects outside the wcf service.

Any suggestions on what I could be doing wrong? Thanks in advance

@Marc Gravell - Would yo be able to help with this? I have been able to configure Proto Serialization without issues before but I am running into issues this time. Below are the app.config(relevant portions) and web.config Web.config

   <extensions>
        <behaviorExtensions>
        <add name="protobuf" type="ProtoBuf.ServiceModel.ProtoBehaviorExtension, protobuf-net" />
       </behaviorExtensions>
   </extensions>

    <behavior name="ProtoLargeDataEndpointBehavior">
      <dataContractSerializer maxItemsInObjectGraph="2147483647" />
      <protobuf />
    </behavior>
    <behavior name="LargeDataEndpointBehavior">


     <service name="EOG.Modules.Cashflows.DataServices.CashflowAcrossStreamsService" behaviorConfiguration="DebugServiceBehavior">
    <endpoint address="" binding="netTcpBinding" bindingConfiguration="InsecureTcp" behaviorConfiguration="LargeDataEndpointBehavior" contract="EOG.Modules.Cashflows.Common.Interfaces.ICashflowAcrossStreamsService" />
    <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
    <endpoint address="proto" binding="netTcpBinding" bindingConfiguration="InsecureTcp" behaviorConfiguration="ProtoLargeDataEndpointBehavior" contract="EOG.Modules.Cashflows.Common.Interfaces.ICashflowAcrossStreamsService" />

    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttp" behaviorConfiguration="LargeDataEndpointBehavior" contract="EOG.Modules.Cashflows.Common.Interfaces.ICashflowAcrossStreamsService" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <endpoint address="proto" binding="basicHttpBinding" bindingConfiguration="basicHttp" behaviorConfiguration="ProtoLargeDataEndpointBehavior" contract="EOG.Modules.Cashflows.Common.Interfaces.ICashflowAcrossStreamsService" />
  </service>


   App.config
   <endpointBehaviors>
    <behavior name="proto">
      <protobuf />
    </behavior>
    <behavior name="LargeDataEndpointBehavior">
      <dataContractSerializer maxItemsInObjectGraph="2147483647" />
    </behavior>
    <behavior name="ServiceBehavior">
      <dataContractSerializer maxItemsInObjectGraph="2147483647" />
    </behavior>
    <behavior name="ProtoServiceBehavior">
      <dataContractSerializer maxItemsInObjectGraph="2147483647" />
      <protobuf />
    </behavior>
  </endpointBehaviors>

 <extensions>
  <behaviorExtensions>
    <add name="protobuf" type="ProtoBuf.ServiceModel.ProtoBehaviorExtension, protobuf-net" />
  </behaviorExtensions>
 </extensions>
   <endpoint address="http://server_name/iEconLiteServices/CashflowService.svc/proto" behaviorConfiguration="ProtoServiceBehavior" binding="basicHttpBinding" bindingConfiguration="basicHttp" contract="EOG.Modules.Cashflows.Common.Interfaces.ICashflowAcrossStreamsService" />

Below is a screenshot from fiddler that shows the request being serialized in proto and the response with Datacontractserializer.

https://drive.google.com/file/d/0B1IidY-dzmRLYV9vdDNaTm4wNzg/edit?usp=sharing

Any insight would be appreciated.

Answers


The issue turned out to be that the Contract method was returning a type of object instead of a specific type.


Need Your Help

How to split lines based on the cursor position?

java string parsing csv tokenize

I have a text file which has all the information I need in lines and this needs to be converted into a .csv file.

ruby on rails 3.2 changing the default assets path from /asset to someother directory

ruby-on-rails asset-pipeline

I have been working on rails 3.0.9 earlier and tried moving to rails 3.2 for the same project.