wcf

WCF - The maximum message size quota for incoming messages has been exceeded

I'm getting the following error from my WCF service which is returning the results of a query in C# objects. The maximum message size quota for incoming messages (131072) has been exceeded I know how to resolve this via MaxReceivedMessageSize What I'm looking to find out is how do I find out what contributes to the message size. It do...

First WCF Request, client always throws System.Xml.XmlException: There are multiple root elements

Every time my WCF Host application pool starts, the client making the first WCF call to it always throws "System.Xml.XmlException: There are multiple root elements" All subsequent calls work perfectly. This exception happens on the consumer/client side of the WCF request. I've tested this for both a full WCF client and a Silverlight ...

Single instance of third-party library for WCF service

Is there a way of creating an instance of a third-party/external library when my WCF server is started and not create a new one everytime a request is received? I am looking for something sort-of like a Global.asax file in a asp.net website. I am relatively new to WCF and I am currently only prototyping using a console app and serving ...

PreRequestHandlerExecute event not fired for REST calls

I'm creating my nhibernate session in the PreRequestHandlerExecute event handler of the HttpApplication class. It works fine for MVC, however, when in WCF (REST) the event is never fired. Is there a way to make it happen or any other better idea to set the session both in MVC and WCF/Rest? Thanks in advance, André Carlucci ...

Collecting Query string values from URL in Sliverlight and WCF application

I am trying to retrieve query string values from a url. And the app should be a silverlight app. For Eg: The sample URL might look like http://<hostname>/silverlightApp/Default.aspx?S=Name|address|title|sal|... I should be able to take the query string and built a Silverlight UI. Can this be done or Silverlight is not a good ca...

Consuming a WCF WsHttpBinding WebService in Java

Hey guys, I'm trying to get a Java Client to communicate with a WCF wshttpbinding WebService. But I am unable to do so. The call either hangs, or I get "musunderstoodheader expcetions". My Web Service is just the default Visual Studio generated "WCF Service Library Template". My Web Service Client is just a blank IntelliJ project, wi...

WCF WebGet ResponseFormat Vs WebOperationContext.OutgoingResponse.ContentType

What is the difference between using a WebGet attribute [WebGet( ResponseFormat = WebMessageFormat.Xml )] and manually setting the content type? WebOperationContext.Current.OutgoingResponse.ContentType = "application/xml"; I have a Silverlight app that is making this request to WCF. I'm looking at the traffic and the request/resp...

WCF WebGet and ICollection<>

I'm attempting to return a generic ICollection from a REST WCF service. Should the following be possible? [ServiceContract] public class WebConfigurationManager { [WebGet] [OperationContract] public ICollection<string> GetStrings() { return new string[] { "A", "B", "C" }; } } When I attempt to execute this o...

Silverlight, WCF and rewriting response

I am trying to write a WCF service as a proxy for my Silverlight control to do cross-domain requests to an internet REST web service. I just want to make the requests to my service, and it would format and forward the request to the 3rd party web service (replace the hostname and part of the URL), then simply return the response to the c...

Returning JSON AND XML format from a .NET 3.5 WCF web service (REST)

I have an existing web service that returns XML responses and I would like to add some new methods that return JSON. Do I have to create a separate web service that returns in JSON or can I have a mix? If I use the ResponseFormat = WebMessageFormat.JSON I need to have the service annotated with [DataContractFormat] but I cant seem to ha...

Duplex WCF service hangs on 11th call

I've got a duplex WCF service which hangs after the magic 10 proxy instantiations. The specific error on the client is: "System.TimeoutException: This request operation sent to net.tcp://localhost:8080/RoomService/netTcp did not receive a reply within the configured timeout (00:00:59.9960000)". There aren't any apparent error messag...

Strange WCF Error - IIS hosted - context being aborted

I have a WCF service that does some document conversions and returns the document to the caller. When developing locally on my local dev server, the service is hosted on ASP.NET Development server, a console application invokes the operation and executes within seconds. When I host the service in IIS via a .svc file, two of the documen...

Problem when inserting an entity in the database through a service

I have a Silverlight application and I'm using a WCF service to access my database information. For this I'm using EntityFramework. I have a class Items (mapped on my DB table Items) which has an ObservableCollection of Keywords (class mapped on my DB table Keywords) objects. From the interface I create an Items object with all the pro...

Dealing with a longer running process in WCF

In the app I'm currently working on we are using a couple of WCF services with a lot of methods. Until now, all methods are very short running, often just getting some data. I've just added a method that takes a way longer time to run. I do not want to raise the timeout in the config, because 1 minute is long enough for all other metho...

WCF from JavaScript

I am having a WCF service Hosted separately in IIS I need it to consume from separate web application using JavaScript (client side) but my namespace is not recognized by JavaScript intellisense. When I browse my service it works fine. Is that any reference needed to be given to the .svc? ...

Reliable session faulting for unknown reason

Hi all, My problem is this: I am trying to achieve the following - one client-side proxy instance (kept open) accessed by multiple threads using a reliable session. What I have managed so far is to have either A) a reliable session with a client-side proxy which is created and disposed per call or B) what I aim for, but without a reli...

WCF Event Declaration

I see that WCF doesn't directly use events and instead uses OneWay delegate calls, but can someone show me a simple example on how to do this? Here is what I have setup right now: [OperationContract(IsOneWay = true)] void OnGetMapStoryboardsComplete(object sender, List<Storyboard> results); ...

How to consume legacy business logic from a silverlight application?

Hello Everyone, I have an XBap system designed as a 3-layer application. The XBap client consumes the logic through a WCF Service using netTcpBinding. For easy of databinding and to be able to re use data validation built-in my business objects, I choosed to reference the business objects library from the xBap client instead of generat...

Problem with POST request to RESTful WCF Service

I am trying to make a post request to my restful WCF service. The contract looks like this: [OperationContract] [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat=WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemp...

Windows Forms & WCF - Client Application Communication

We are developing a Windows Forms application that will be installed on about 1,000 employee pcs. Users may run multiple instances of the application at the same time. The clients are all on a single intranet. Changes in the application may cause database record changes, which in turn must be communicated to the other clients so their...