wcf

WCF

前提是你 提交于 2020-01-22 18:17:42
Windows Communication Foundation(WCF) 是由微软开发的一系列支持数据通信的应用程序框架,可以翻译为Windows 通讯开发平台。整合了原有的windows通讯的 .net Remoting,WebService,Socket的机制,并融合有HTTP和FTP的相关技术。是Windows平台上开发分布式应用最佳的实践方式。 WCF 的服务可以挂载于 Console Application,Windows Application,IIS (ASP. NET) Application,Windows Service以及Windows Activation Services中,但大多都会挂在 Windows Service。 WCF 的基本概念是以契约(Contract) 来定义双方沟通的协议,合约必须要以接口的方式来体现,而实际的服务代码必须要由这些合约接口派生并实现。合约分成了四种: 数据契约(Data Contract) ,订定双方沟通时的数据格式。 [DataContract]//一般接口返回的数据都会带上DataContract特性,这样方便我们控制返回的数据 public class WCFUser { //[DataMember]//不被标记DataMember特性的字段不会返回 public int Id { get; set; }

WCF - Cannot obtain Metadata

折月煮酒 提交于 2020-01-22 16:27:46
问题 It is running in an Intranet using IIS 7 and it works fine whenever I enable Anonymous Authentication in the IIS Manager. If I disable it and try to run it using wcftestclient then I get the following error, Error: Cannot obtain Metadata from http://myserver/testing/eval.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to

WCF并发连接数的问题

别等时光非礼了梦想. 提交于 2020-01-22 16:13:02
在最近的开发中,总是发现人数一多就会有用户莫名其妙的界面卡死,或者直接掉线的情况,不知道是什么原因,由于项目采用的是netTcp绑定,猜想可能是并发连接的问题。于是查了一下: 在windows7中,并发连接数默认是10 代码 < binding name ="netTcpBindConfig" closeTimeout ="00:30:00" openTimeout ="00:30:00" receiveTimeout ="00:30:00" sendTimeout ="00:30:00" transactionFlow ="false" transferMode ="Buffered" transactionProtocol ="OleTransactions" hostNameComparisonMode ="StrongWildcard" listenBacklog ="10" maxBufferPoolSize ="2147483647" maxBufferSize ="2147483647" maxConnections ="10" maxReceivedMessageSize ="2147483647" > 将项目移植到windows server2008上之后,并发连接数需要改变一下,于是变成 代码 < binding name ="netTcpBindConfig"

How to force a net.tcp mex endpoint (mexTcpBinding) to participate in port sharing?

前提是你 提交于 2020-01-22 13:49:11
问题 I have a WCF service which is hosted as a Windows Service. We would like to enable a mex endpoint at the same address (but with a '/mex' suffix). I have been trying to do this (unsuccessfully) using the following configuration: <system.serviceModel> <services> <service name="MyCompany.MyService" behaviorConfiguration="defaultServiceBehavior"> <host> <baseAddresses> <add baseAddress="net.tcp://localhost"/> </baseAddresses> </host> <endpoint address="MyService" binding="netTcpBinding" contract=

Using WCF on Localhost on Azure

早过忘川 提交于 2020-01-22 12:32:27
问题 In summary How do I acces a WCF service on localhost when hosted in IIS on Azure? Azure does not bind localhost or 127.0.0.1 to my website. Details I have an ASP.Net application hosted on Azure. I have added a .svc and some workflows that I want to use via WCF. To keep matters simple, my web app simply calls the service on localhost, so I have endpoints like these in web.config; <client> <endpoint address="http://localhost:8080/Router.svc/Case" binding="basicHttpBinding" contract="NewOrbit

WCF Serialization problems with WSDL file created by Java tools

对着背影说爱祢 提交于 2020-01-22 10:56:28
问题 My team is tasked with getting several in-house developed .NET client applications to connect to some new Java web services. The Java web service is a third party, vendor supplied WSDL file that our team has a limited ability to modify/control...meaning we probably have the power to request our vendor to make slight tweaks to the WSDL, but major changes would probably be either unfeasible or difficult to request. That said, we are attempting to utilize WCF/.NET 4.0 to generate the .NET proxy

Exclude property on WCF DataContract

我是研究僧i 提交于 2020-01-22 03:33:08
问题 Given a WCF interface definition like this, is there a way to exclude a property from the ComplexObject response value? I want to exclude the ChildObjects property. I don't want to remove the DataMember attribure from the property definition as I need it to be serialized in another case. [ServiceContract] public interface IComplexObjectService { [OperationContract] ComplexObject Test(int a); } ComplexObject is defined something like this: [DataContract(IsReference = true)] public class

In WCF, server hasn't accessed client's public key and client hasn't accessed server's public key - still the web-method operation is successful. Why?

元气小坏坏 提交于 2020-01-22 03:10:13
问题 I have a WCF service on a dev server secured with X.509 server certificate ( .pfx ) [not self-signed, organization provided] using message security. On my local machine, a client app consumed it with a client certificate ( .pfx ) [not self signed] file using message security. The intended operation (web service method) worked successfully with required result. Client service call : try { ServiceClient.Service1Client obj = newServiceClient.Service1Client(); Response.Write(obj.Add(1, 1)); }

IE9 XmlHttpRequest returns 12019 error instead of HTTP/417 response code

元气小坏坏 提交于 2020-01-21 23:53:27
问题 I have some error processing for ajax request to WCF service on client side, self.remove = function (dep, processingResult) { var data = { "id": dep }; $.ajax({ url: 'my.svc/remove', type: 'POST', contentType: 'application/json', dataType: "json", cache: false, data: JSON.stringify(data), complete: function (e, xhr, settings) { var message = self.getMessage(e.status); switch (e.status) { case 200: processingResult(); break; case 417: console.log(e.statusText); radalert(message + e.statusText,

微软产品组邀请您参加网页预览并提出您的宝贵意见

僤鯓⒐⒋嵵緔 提交于 2020-01-21 22:26:30
您好! 感谢您一如既往地对于微软技术和相关产品的使用和支持,并能及时给予我们相关产品的反馈和您提出的宝贵意见。身为社区专家,您的反馈不仅代表广大客户的需求,对于微软改进产品,满足客户需求而言具有更实际的价值。 微软产品组一直以来非常重视 各位社区专家 对于微软产品的反馈信息,现邀请 各位 对于相关网页进行预览并提出您对于相关网页的宝贵意见。同时,您也可以将以下网页网址放在您的 Blog 中,与其他 IT 同仁一同分享,让更多的人了解微软产品和技术的最新资讯。 具体网页信息如下: 1. 微软中国研发集团服务器与开发工具事业部 : http://blogs.msdn.com/stbcblog 作为 微软中国研发集团 的核心研发部门之一,服务器与开发工具事业部在上海和北京与总部及世界各地产品研发机构紧密配合,致力于为微软用户提供安全与访问、管理与服务、互连系统、数据平台、 Windows 服务器解决方案、商业在网服务和开发工具等核心产品与技术的研发和孵化。 服务器与开发工具事业部还积极与本土合作伙伴展开战略合作,分享研发管理和产品开发的经验,将创新成果带给广大用户。此外,事业部还在中国吸纳和培养软件开发人才,致力于促进华东地区 IT 产业的繁荣和共赢。 我们希望通过这个交流平台与学生、专业人士、用户进行近距离地沟通,分享我们中国 " 智 " 造的产品、技术