wcf

Microsoft .NET 4.0完整框架和客户端配置文件之间的差异

时光怂恿深爱的人放手 提交于 2020-02-27 11:40:03
Microsoft .NET Framework 4.0完整安装程序(32位和64位)为48.1 MB,客户端配置文件安装程序为41.0 MB。 解压缩的安装文件分别为237 MB和194 MB,一旦安装,它们分别为537 MB和427 MB。 这是110 MB的差异。 两个包之间有什么区别? 什么时候安装客户端配置文件而不是完整的.NET Framework? #1楼 .NET Framework 4 Client Profile中的新功能RTM 解释了许多不同之处: 何时使用NET4 Client Profile以及何时使用NET4 Full Framework? NET4客户端配置文件: 始终针对所有客户端桌面应用程序(包括Windows窗体和WPF应用程序)定位NET4客户端配置文件。 NET4完整框架: 仅当应用程序所需的功能或程序集未包含在客户端配置文件中时,才能使用目标NET4 Full。 这包括: 如果您正在构建服务器应用程序 如: o ASP.Net应用程序 o基于服务器端ASMX的Web服务 如果您使用旧版客户端方案。 如: o使用在.NET4中不推荐使用但未包含在客户端配置文件中的System.Data.OracleClient.dll。 o使用旧版Windows Workflow Foundation 3.0或3.5(WF3.0,WF3.5)

WCF TCP clients - basic guidelines on how to use them?

空扰寡人 提交于 2020-02-26 08:18:43
问题 I've got a WCF service and want to connect to it using a TCP binding. This is all well and good, but how are you supposed to handle the clients? I've noticed that if you create a new client for each call it doesn't re-use the channel and leaves around a bunch of TCP connections until they time out. Is it normal use to create a client, call a method on it, then close it? What if you want to re-use the connection? What are the limitations on that? Can you make simultaneous calls from different

WCF客户端“使用”块问题的最佳解决方法是什么?

给你一囗甜甜゛ 提交于 2020-02-25 22:14:17
我喜欢在 using 块中实例化我的WCF服务客户端,因为它几乎是使用实现 IDisposable 资源的标准方法: using (var client = new SomeWCFServiceClient()) { //Do something with the client } 但是,正如 本MSDN文章中所述 ,在 using 块中包装WCF客户端可能会掩盖导致客户端处于故障状态的任何错误(如超时或通信问题)。 简而言之,当调用Dispose()时,客户端的Close()方法会触发,但会因为处于故障状态而抛出错误。 然后,第二个异常掩盖了原始异常。 不好。 MSDN文章中建议的解决方法是完全避免使用 using 块,而是实例化您的客户端并使用它们,如下所示: try { ... client.Close(); } catch (CommunicationException e) { ... client.Abort(); } catch (TimeoutException e) { ... client.Abort(); } catch (Exception e) { ... client.Abort(); throw; } 与 using 块相比,我认为这很难看。 每次需要客户端时都需要编写很多代码。 幸运的是,我发现了一些其他的解决方法

WCF

你离开我真会死。 提交于 2020-02-25 19:12:58
我有一个WCF服务,它从数据库返回1000条记录到客户端。 我有一个ASP.NET WCF客户端(我在asp.net Web应用程序项目中添加了服务引用以使用WCF)。 运行客户端应用程序时收到以下消息: 已超出传入邮件的最大邮件大小限额(65536)。 要增加配额,请在相应的绑定元素上使用MaxReceivedMessageSize属性。 有帮助吗? 如何增加邮件大小配额? #1楼 WCF测试客户端 拥有自己的客户端配置。 运行测试客户端并滚动到底部。 如果双击“配置文件”节点,您将看到XML表示。 如您所见, maxReceivedMessageSize 为 65536 。 要编辑它,请右键单击“配置文件”树节点,然后选择“使用 SvcConfigEditor 编辑”。 编辑器打开时展开Bindings并双击自动生成的绑定。 您可以在此处编辑所有属性,包括 maxReceivedMessageSize 。 完成后,单击 文件 - 保存 。 最后,当您返回WCF测试客户端窗口时,单击 工具 - 选项 。 注意 : 取消选中启动服务时始终重新生成配置 。 #2楼 我在web.config上使用此设置时出现此错误 System.ServiceModel.ServiceActivationException 我设置这样的设置: <service name="idst

WCF Services in ASP MVC PRoject (NopCommerce)

时光怂恿深爱的人放手 提交于 2020-02-25 13:46:47
问题 I am trying to add a WCF Service to the Admin Folder of NopCommerce . I have done the same thing for the web folder and every thing goes Well, but for Admin folder when I try to execute I have this Error : It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. In the XML File here is the problem :< serviceHostingEnvironment

WCF Services in ASP MVC PRoject (NopCommerce)

爷,独闯天下 提交于 2020-02-25 13:46:28
问题 I am trying to add a WCF Service to the Admin Folder of NopCommerce . I have done the same thing for the web folder and every thing goes Well, but for Admin folder when I try to execute I have this Error : It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. In the XML File here is the problem :< serviceHostingEnvironment

Can WCF accept JSON encoded using single quotes and non-quoted identifiers?

陌路散爱 提交于 2020-02-25 08:06:25
问题 Is there a way that I can instruct WCF to accept JSON that is formatted using either single quotes (as opposed to double quotes): { 'foo': 'bar' } Or using non-quoted identifiers like so: { foo: 'bar' } As it is, it seems like JSON will only be accepted if it is formatted like so: { "foo": "bar" } Using either of the first two example results in a 400 (bad request). 回答1: The first two examples are invalid JSON texts. http://www.ietf.org/rfc/rfc4627.txt object = begin-object [ member *( value

Intermittent '401: Unauthorized' exceptions from server

泪湿孤枕 提交于 2020-02-25 05:30:07
问题 I have a web service that is hosted in a clustered environment. The web application that is calling this service is also hosted in a clustered environment, but on a different set of IIS6 servers. Hence, the application servers are appserv1 and appserv2 and the service servers are svcserv1 and svcserv2. We don't control which servers are accessed since we typically just refer to them as either appserv or svcserv, respectively. The service is a WCF Service but has been created to be compatible

Intermittent '401: Unauthorized' exceptions from server

亡梦爱人 提交于 2020-02-25 05:29:07
问题 I have a web service that is hosted in a clustered environment. The web application that is calling this service is also hosted in a clustered environment, but on a different set of IIS6 servers. Hence, the application servers are appserv1 and appserv2 and the service servers are svcserv1 and svcserv2. We don't control which servers are accessed since we typically just refer to them as either appserv or svcserv, respectively. The service is a WCF Service but has been created to be compatible

Bad Request Error On REST service Method call with POST (json Data)?

非 Y 不嫁゛ 提交于 2020-02-24 05:32:07
问题 Hi i am new to the RESTful WCF I am trying to do the the simple call to the webservice method using POST here is my code Service Interface code [ServiceContract] public interface IJsonSave { [OperationContract] [WebInvoke(UriTemplate = "/SaveJason", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest)] string SaveJason(string value); } web.config file code <?xml version="1.0"?> <configuration> <system