wcf

WCF InstanceContextMode.Multiple issues

So I'm hosting WCF service in a WinForms application. I have the following [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.PerCall)] public class Test : ITest { public string TestIt(string input) { Thread.Sleep(5000); return "test"; } } I'm ...

How can a WCF service return large amounts of data?

I'm working on a web app that passes data to a custom client app. I'm getting exceptions when the data is over some "small" size. Since the end users will likely be using increasingly larger data sizes, I switched the return from the WCF function to be the ID of the data set. Next, I converted the client to use the ID to retrieve the ...

WCF Service - runtime not seeing the ServiceContract on Interface

I'm new to WCF and trying to get my first service running. I'm close but stuck on this problem. In my interface definition file, I have this: [ServiceContract(Namespace="http://mysite.com/wcfservices/2009/02")] public interface IInventoryService { [OperationContract] string GetInventoryName(int InventoryI...

Role-based profiles for CAS

Introductory ramble Client Application Services (CAS) is the Microsoft solution for ASP.NET and WCF identity management. The default store is XML but nearly everyone reconfigures it to use ASPNETDB on MSSQL. There is support for per-user information in the shape of the .NET Profile. Within this, the application developer can define an ...

Which list/collection type is best to use in a WCF data contract?

When defining a WCF data contract, which type should one use for collections/lists? Should it be ICollection<T>, IList<T>, T[] or...? Should I use interface types or the concrete types? What trade offs are there to consider? ...

Setting receiveTimeout for callbacks in WCF?

I've written mostly working piece of code using WCF where a client subscribes to a server and the server pushes data to the client. I left is running for a while and tried to puch some data to the client and got an exception which told me I had to set the receiveTimeout property. Where can I set this property? Everywhere I see this iss...

Should I check if already closed before calling Close() on a WCF Service?

Before I call Close() on my WCF service, should I check to see if it is not already closed? ie. myWCFService.State != System.ServiceModel.CommunicationState.Closed My code looks like: MyServiceClient myWCFClient = null; try { myWCFClient = new .....(); } catch { } finally { myWCFClient.Close(); } ...

What is the difference between wsHttpBinding and ws2007HttpBinding ?

On the MSDN we can read : The WS2007HttpBinding class adds a system-provided binding similar to WSHttpBinding but uses the Organization for the Advancement of Structured Information Standards (OASIS) standard versions of the ReliableSession, Security, and TransactionFlow protocols. No changes to the object model or default settings a...

IIS stackoverflow

Here's the thing. We've been chansing an bug on my WCF web application (W2K3 IIS) which was resulting in a stackoverflow. To fix it I need to increase the stack of my application by creating a thread with the amount of memory I want to allocate. But what happens with the child threads? My app creates many threads, will they inherit the v...

Silverlight Combobox Databinding race condition

In my quest to develop a pretty data-driven silverlight app, I seem to continually come up against some sort of race condition that needs to be worked around. The latest one is below. Any help would be appreciated. You have two tables on the back end: one is Components and one is Manufacturers. Every Component has ONE Manufacturer. ...

Converting WCF Request from JSON to IPC/TCP/etc

I have an HttpHandler that acts as a proxy between website visitor and a windows hosted WCF service. Right now the WCF service is setup to handle a json request, but I would like to convert the json request to net.pipe or net.tcp or any of the protocols that WCF can handle. I am hoping to have a communication that goes: client <--j...

Deserialization problem with DataContractJsonSerializer

I've got the following piece of JSON: [{ "name": "numToRetrieve", "value": "3", "label": "Number of items to retrieve:", "items": { "1": "1", "3": "3", "5": "5" }, "rules": { "range": "1-2" } }, { "name": "showFoo", "value": "on", "label": "Show foo?" }, { "name...

What type of security has been used with WCF on Azure that would be compatible with Silverlight?

Has anybody gotten any type of security to work with WCF on Azure that would be compatible with Silverlight? I have already tried transport security on basic http binding, but it does not work. ...

Hosting a WCF Service in Vista

I put together a small WCF service in VS2008 and when I try to run the host using an HTTP protocol, it bombs because it doesn't have the proper rights to do so. On my "Host.Open()" line I get this exception: "HTTP could not register URL http://+:9001/. Your process does not have access rights to this namespace." I did not seem to have ...

Long-running callback contract via WCF duplex channel - alternative design patterns?

I have a Windows service that logs speed readings from a radar gun to a database. In addition, I made the service a WCF server. I have a Forms and a CF client that subscribe to the service and get called back whenever there is a reading that satisfies certain criteria. This works in principle, but after some time the channel times out. ...

WCF service connection issue - maybe security?

I am trying to debug a WCF service. This client has been able to connect in the past, but now I cannot connect. The service is deployed to a server. I can hit the server's service page with the browser and I see the instructions for generating a client. I re-generated the client proxy and configuration file using svcutil. The client sta...

CryptographicException 'Keyset does not exist', but only through WCF

I have some code that makes a call to a third party web service that is secured using X.509 certification. If I call the code directly (using a unit test) it works without any problems. When deployed, this code will be called via a WCF Service. I have added a second unit test that calls the WCF Service, however this fails with a Crypto...

How would you communicate a wcf service with a windows service?

Two weeks ago I needed a way to communicate a wcf service with a windows service running on the same computer. The windows service had to get data from a external source and share it with the wcf service (hosted in IIS) who had to give it when a client made a request. I chose to do that with ipc. I done it and now the windows service i...

WCF Test Client error: Failed to Invoke the service

I'm getting an error when trying to use the WCF Test Client with my WCF service. Here is the service code: [ServiceContract] public interface IEmployeeService { [OperationContract(Name = "GetEmployee")] [WebGet(RequestFormat = WebMessageFormat.Xml, UriTemplate = "/Employees/{employeeNumber}")] Employee GetEmployee(strin...

Best way to support "application/x-www-form-urlencoded" post data with WCF?

I'm building a WCF service based on a W3C specification which defines a RESTful web service endpoint that accepts "application/x-www-form-urlencoded" post data. WCF doesn't support this type of message encoding by default and I have found a number of different examples of creating a contract that looks like this: XElement Query_Post(St...