using Proto buf in WCF

原创 2013年12月02日 17:29:52

Step 1: download Protobuf  and ref in prj , url :
http://code.google.com/p/protobuf-net/

 

Step 2: Simply change DataContract -> ProtoContract
DataMember -> Protomember (orderNo)
 

 
[ProtoContract]
    public class CompositeType
    {
        bool boolValue = true;
        string stringValue = "Hello ";
 
        [ProtoMember(1)]
        public bool BoolValue
        {
            get { return boolValue; }
            set { boolValue = value; }
        }
 
        [ProtoMember(2)]
        public string StringValue
        {
            get { return stringValue; }
            set { stringValue = value; }
        }
    }


 

 

版权声明:本文为博主原创文章,未经博主允许不得转载。 举报

相关文章推荐

不要在using语句中调用WCF服务

http://www.cnblogs.com/dudu/archive/2011/01/18/1938144.html 如果你调用WCF服务时,像下面的代码这样在using语句中进行调用,需要注意一个...

Internet – Web to Remote WCF Using Message Security (Original Caller)

Internet – Web to Remote WCF Using Message Security (Original Caller) - J.D. Meier , Jason Taylor ...

我是如何成为一名python大咖的?

人生苦短,都说必须python,那么我分享下我是如何从小白成为Python资深开发者的吧。2014年我大学刚毕业..

不要在using语句中调用WCF服务

如果你调用WCF服务时,像下面的代码这样在using语句中进行调用,需要注意一个问题。using (CnblogsWcfClient client =new CnblogsWcfClient()){ ...

[WCF] Could not find default endpoint element that references contract 'xx' in the ServiceModel

Background: I have a WCF service which is being hosted in IIS. I have a WCF a common library to invo...
  • wzhiu
  • wzhiu
  • 2014-05-28 10:31
  • 2748

How to: Host a WCF Service in a Managed Windows Service

http://msdn.microsoft.com/en-us/library/ms733069(v=vs.90).aspx How to: Host a WCF Service in a ...

WCF 4 Step By Step Chapter 4 Note (Transport and Message Security + Authentication in Organization)

When building Web services, you can perform authenticationand encryption at two points when sending ...

First WCF App (Host in Console Application)

File Structure Program.csService.csIService.csApp.config 1. App.config Here defines two a...

Instancing modes in WCF

1.什么是Instancing modes? 通过上图我们可以了解到,客户端每次向WCF服务发送请求的时候,会首先在WCF服务端生成一个服务实例,然后通过服务实例来回应客户端的请...

code4fun:host wcf service just in time

http://www.cnblogs.com/jillzhang/archive/2008/10/27/1320086.html 当ServiceContract非常多的情况下,比如...

New in WCF 4.0 Note & Filters for Message Logging Note

http://msdn.microsoft.com/en-us/library/ee354381.aspx Using Filters for Message Logging         ...
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)