wcf

WCF error serializing cycle reference

為{幸葍}努か 提交于 2020-01-23 09:19:13
问题 I'm trying to return lists of objects that have references to another objects and viceversa. I only want the lazy load to get the "first level children", I mean, if I have a "Person" object with a "Place" property, I want the place data to be loaded but not every object in "Place" object needs to be loaded... because this would ahead to a cyclic reference... I've read that I could do this by using [DataContract(IsReference = true)] on every Object. I've set every object in the model (auto

WCF: unsecured or incorrectly secured fault was received from the other party

为君一笑 提交于 2020-01-23 08:41:45
问题 I have created one wcf service with aspnet role & security. When I consumed that in one website and try to check that, with correct username & password it works perfect, but with incorrect username & password it gives me an error: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. I would have expected to get "Access is Denied" instead. So, Any idea why??? UPDATE You are right we can add FaultContracts ...

How to include WCF Custom Headers in console Service Host

北战南征 提交于 2020-01-23 07:00:47
问题 In my WCF service I was getting 405 method not allowed error and then came across a post which suggest to have the following in Application_BeginRequest of my WCF host: protected void Application_BeginRequest(object sender, EventArgs e) { if (HttpContext.Current.Request.HttpMethod == "OPTIONS") { HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Accept, Content-Type,customHeader"); HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "POST,GET,OPTIONS")

Executing a custom SQL query over WCF

筅森魡賤 提交于 2020-01-23 03:57:05
问题 I use WCF service with ORACLE and SQL Server. Then I need "generic" solution. I need built a WCF method to essentially execute a custom SQL string and return the reader results. This is not a great practice and is probably best avoided, it kind of breaks the whole point of the WCF service, but in my case this need have to be done. I don't want neither cannot WCF Data Service neither another technology or protocol. Only WCF service (SOAP). Any good practices about it? Maybe List<List<string>>

Understanding httpGetEnabled and Mex binding

我只是一个虾纸丫 提交于 2020-01-23 01:43:08
问题 In a WCF service, I have removed the default Mex binding and I have set the httpGetEnabled attribute in the default service behaviour to false. With this my understanding is that the service would not allow downloading of WSDL. However, the service's existing clients would work without trouble. Now, when I browse to the .svc in Internet Explorer, it advices 3 things to help me see the structure of .svc file. Create a behaviour for the service. In the serviceMetadata element, create

Change WCF default timeout

≯℡__Kan透↙ 提交于 2020-01-23 00:35:12
问题 I have here a WCF Duplex Service, the requierement is that the Callback to the client should have a timeout of 10 seconds, therefor my web.config file of the Service looks like this: <bindings> <basicHttpBinding> <binding name="simulatorEndpoint" closeTimeout="00:00:10" openTimeout="00:00:10" receiveTimeout="00:00:10" sendTimeout="00:00:10" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288"

To poll or not to poll (in a web services context)

狂风中的少年 提交于 2020-01-23 00:08:13
问题 We can use polling to find out about updates from some source, for example, clients connected to a webserver. WCF provides a nifty feature in the way of Duplex contracts, in which, I can maintain a connection to a client, and make invocations on that connection at will. Some peeps in the office were discussing the merits of both solutions, and I wanted to get feedback on when each strategy is best used. 回答1: I would use an event-based mechanism instead of polling. In WCF, you can do this

To poll or not to poll (in a web services context)

≯℡__Kan透↙ 提交于 2020-01-23 00:07:05
问题 We can use polling to find out about updates from some source, for example, clients connected to a webserver. WCF provides a nifty feature in the way of Duplex contracts, in which, I can maintain a connection to a client, and make invocations on that connection at will. Some peeps in the office were discussing the merits of both solutions, and I wanted to get feedback on when each strategy is best used. 回答1: I would use an event-based mechanism instead of polling. In WCF, you can do this

C# WCF plugin design and implementation

南楼画角 提交于 2020-01-22 19:48:14
问题 I would like to get some advice. I am developing a system that will load up plugins at runtime and require them to be available through a WCF endpoint. I will have a MVC 3 Web app that is only really used for configuration, and a class library (core) that will load up different plugins. I would appreciate some guidance on how to go about this. I would like to load the plugin up and then be able to create a WCF endpoint that is registered with IIS 7 for access into that plugin. Thanks in

C# WCF plugin design and implementation

蹲街弑〆低调 提交于 2020-01-22 19:47:08
问题 I would like to get some advice. I am developing a system that will load up plugins at runtime and require them to be available through a WCF endpoint. I will have a MVC 3 Web app that is only really used for configuration, and a class library (core) that will load up different plugins. I would appreciate some guidance on how to go about this. I would like to load the plugin up and then be able to create a WCF endpoint that is registered with IIS 7 for access into that plugin. Thanks in