wcf

WCF data persistence between sessions

一笑奈何 提交于 2020-01-21 12:55:51
问题 We are developing a WCF based system. In the process we are trying to lock some data from being modified by more than one users. So we decided to have a data structure that will contain the necessary information for the locking logic to execute (by for example storing the ID of the locked objects) The problem we are having is persisting that data between sessions. Is there anyway we can avoid executing expensive database calls? I am not sure how can we do that in WCF since it can only persist

How to Convert .NET DateTime to JSON

此生再无相见时 提交于 2020-01-21 12:48:19
问题 My WCF webservice is returning C# DateTime objects as JSON like this, "/Date(1293793200000+1300)/" I have found this, Converting .NET DateTime to JSON Which suggests this method for converting it using javascript, var d = new Date(); d.setTime(1245398693390); document.write(d); The difference is that my date format has the +1300 in it, which seems to be my timezone, as I am +13 hours from GMT. Can I somehow modify my service to adjust the value to an absolute number of milliseconds from epoch

How to Convert .NET DateTime to JSON

狂风中的少年 提交于 2020-01-21 12:48:18
问题 My WCF webservice is returning C# DateTime objects as JSON like this, "/Date(1293793200000+1300)/" I have found this, Converting .NET DateTime to JSON Which suggests this method for converting it using javascript, var d = new Date(); d.setTime(1245398693390); document.write(d); The difference is that my date format has the +1300 in it, which seems to be my timezone, as I am +13 hours from GMT. Can I somehow modify my service to adjust the value to an absolute number of milliseconds from epoch

WCF Timeout issue?

狂风中的少年 提交于 2020-01-21 03:32:08
问题 I have a somewhat long-taking WCF-based process. WCF service runs in Azure if its of any help. The issue I believe has to do with timeouts: 1) Winforms client has the following .config setting in the binding section: <wsHttpBinding> <binding name="XXX" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="10000000" maxReceivedMessageSize=

Call Wcf service with Javascript in Html page

旧城冷巷雨未停 提交于 2020-01-20 19:39:46
问题 I have a WCF project in VSStudio2012 and I want to call a method from JavaScript function. JavaScript file : var url = 'http://localhost:52768/Service1.svc/' function test() { var response; $.ajax({ type: 'Post', url: url + 'GetTEST', contentType: 'application/json; charset=utf-8', dataType: 'json', success: function (msg) { alert(msg); }, error: function (e) { alert("Error : " + e.statusText); } }); } HTML file : <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script

Call Wcf service with Javascript in Html page

做~自己de王妃 提交于 2020-01-20 19:39:25
问题 I have a WCF project in VSStudio2012 and I want to call a method from JavaScript function. JavaScript file : var url = 'http://localhost:52768/Service1.svc/' function test() { var response; $.ajax({ type: 'Post', url: url + 'GetTEST', contentType: 'application/json; charset=utf-8', dataType: 'json', success: function (msg) { alert(msg); }, error: function (e) { alert("Error : " + e.statusText); } }); } HTML file : <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script

Share log4net configuration across multiple projects

风格不统一 提交于 2020-01-20 08:18:45
问题 In my WCF solution, I have multiple projects(16) under this solution. (Business Objects, Business Layer, Windows services etc.) I need to integrate log4net logging framework to all projects. What would be the best approach to have a one log4net config file shared across all the projects. 回答1: Visual Studio allows you to link files from the solution level down to the project level. I would use this approach over the approach of hard coding at path. Add > Existing Item > Add As Link See the

Share log4net configuration across multiple projects

空扰寡人 提交于 2020-01-20 08:18:27
问题 In my WCF solution, I have multiple projects(16) under this solution. (Business Objects, Business Layer, Windows services etc.) I need to integrate log4net logging framework to all projects. What would be the best approach to have a one log4net config file shared across all the projects. 回答1: Visual Studio allows you to link files from the solution level down to the project level. I would use this approach over the approach of hard coding at path. Add > Existing Item > Add As Link See the

WCF 第一个用 Visual Studio 2010 创建的WCF服务

你说的曾经没有我的故事 提交于 2020-01-20 05:02:49
在这个例子中我们将使用VS 2010 U 创建一个WCF服务,其中会了解 [DataContract] [ServiceContract] 等特性。 内置的 WCFSVCHost ,并使用“WCF测试客户端”来测试我们创建的服务。 注意下面的所有类、接口及方法都添加了public 的访问级别。 一,建立一个WCF服务库 创建一个WCF服务库项目, 在解决方案中会自动为我们生成两个类文件“IService.cs”和“Service.cs”。 这两个类文件是两个WCF示例文件,对我们开发没有什么用处,现在我们删掉这两个文件。 在弹出的“添加新项”窗口中,选择“类”,并在“名称”文本框中写入项名称“Person.cs”。 Person.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.Serialization; namespace WcfServiceLibrary1 { / /// <summary> /// DataContract数y据Y约?定¨,?Person 就í是?传?递Y的?消?息¢中D的?内ú容Y。£好?比è信?中D的?文?字?。£ /// 为a了?保£证¤此?类à在úWCF调÷用?中D能ü够?被

How to force WCF client to send client certificate?

匆匆过客 提交于 2020-01-20 03:54:11
问题 I'm trying to access a publicly-hosted SOAP web service (not WCF) over https, and I'm getting an error that I've never seen before. First, here are the facts: This service requires client certificates. I have a certificate that is signed by the same CA as the server's certificate. I know that the URL is available, as I can hit it in Internet Explorer. IE brings up the "choose certificate" window, and if I pick it (and ignore the server-host-name-does-not-match-certificate error), it goes on