wcf

Strange issue while hosting WCF in Windows Server 2003 standard edition, with config details

Hi All, I have hosted WCF in Windows Server 2003 standard edition. If there is not much process while fetching data from service it returns expected result, but if there is much processing involved, it comes with 504 error(The server didn't return a response for this request). I am using custom binding which is as follows to return JSO...

WCF Data Services: How to avoid the __metadata members

I'm currently experimenting with using WCF Data Services as a way to open up our product a bit more while at the same time being able to consume the data from AJAX. One thing that I noticed is that the JSON represention format has these __metada members sprinkled across the data, and in the OData documentation I found this (under Represe...

Limit WCF service resources usage

Hi, I'm developing a web application that needs to perform a task that consumes a lot CPU and Memory, and that also may last several minutes. In order to get a better user experience, I also developed a windows service that hosts a WCF service that performs this "high cost" task and that comunicates with the web app using msmq (message ...

WCF-Capturing the full HTTP response

I'm using WCF to call a method on a Java web service (using basicHttp with <security mode="Transport">). The service returns some HTML back instead of a SOAPFault. WCF seems to implement some odd truncating of the content returned in the exception, so I can't see the entire error. Is there a way to get the entire response? Perhaps so...

WCF List<> received as [] in client, how to work with [].

I present a List from WCF and client receives DocTypes[]. No prob there. current situation is where client my only accept 1,2 out of 100 DocTypes. What is best way to condense the [100 ] to only 2? I have this code for marking what user checked off of grid. foreach (GridViewRow rowItem in gvDocTypes.Rows) { ...

WCF Security; IAuthorizationPolicy called after ServiceAuthorizationManager

My understanding is that an IAuthorizationPolicy (added through my web.config) should be called BEFORE my ServiceAuthorizationManage.CheckAccessCore (also added through my web.config). (I also have principal authorization mode set to Custom in the web.config). This way, the IAuthorizationPolicy can add a ClaimSet, then the ServiceAuthor...

Rolling my own CMS with the WCF, what should my contract be?

I'm looking to create a solution for a asp.net mvc app that displays unstructured course descriptions that have been scraped from around the web. The web server will be on a web hosting company while the description db will be on a private network, so I'd like to pass the description to the mvc app through a WCF service. For the body of...

Exception notification with WCF ReliableSession enabled

We recently enabled ReliableSessions on one of our applications and have noticed some very frustrating side effects with Exception Notification. If Reliable sessions is disabled and the serverUrl is mistyped we get a 'EndpointNotFoundException' return withing a few seconds or if (popular error) a user mistypes their credentials we get a ...

ServiceHost Efficiency

Hiya, Hoping you could help me please.. I am using WCF in my program. Part of this includes using ServiceHost in a self-service type scenario using a netNamedTypeBinding. When I include ServiceHost in my class and then instantiate that class (ServiceHost is set to null at this point), the memory usage increases by approx 9Mb. If I c...

How to determine WCF message size at the encoder level

I am building a custom encoder that compresses WCF responses. It is based on the Gzip encoder in Microsoft's WCF samples and this blog post: http://frenk.wordpress.com/2009/12/04/gzip-compression-wcfsilverlight/ I've got it all working, but now I would like to apply the compression only if the reply is beyond a certain size, but I am...

WCF REST : returning classes and rules / Pascal/Camel case for fields?

Hi there, Can anyone tell me the recomemended case (pascal or camel) for returning classes with fields... For example, the example that comes with vs 2010 uses Pascal Case like so // TODO: Edit the SampleItem class public class SampleItem { public int Id { get; set; } public string StringValue { get; set; } } Notice first cap...

Sharing Objects across WCF Services

I am having an issue similar to this question: Problem with WCF and Multiple Namespaces The major difference I am having is that I don't control both ends of the wire. My setup is similar to this: My.Objects My.LoginService My.Service1 My.Service2 The first thing you do is login via the login service and receive a security ticket. T...

Calling a web service that requires basic http authentication from wcf client

Hi, I have a wsdl from a web service, I generated the wcf proxy. No problem. But I can not get my head around how to pass the user name and password. The webservice requires basic authentication - only username and password. Any help ? ...

Expose a WCF Service via Forms Authentication in IIS: how can I make the metadata (?wsdl) public, but the operations protected

We've got some WCF services we're hosting via IIS. The application in general uses Forms Authentication, and we'd like to continue making that available for web service clients. We just have a <authorization><deny users="?"> in our web.config and some authentication/redirection goodness that gets everything done. The problem is we'd lik...

Hosting WCF service in IIS

I am trying to host the service in IIS but I get Page Not found error. Here is what I did to host in IIS Created a WCF Service application (BillingService) I have two classes called IBillSrv.cs (as Base) and BillSrvc.cs Added a new WCFService website (BillSrvcSite) to the solution and added a reference to the above mentioned (BillingS...

Inherit from abstract class in WCF without exposing that class

I have various classes which I want to expose as Complex Types in WCF, so I add [DataContract] and [DataMember] attributes as necessary on those types and properties. However if I want to have them inherit from an abstract base class (for example Person inherits from abstract EntityBase), I get an error that the type "cannot inherit fro...

WCF REST: specify content-type on WebGet Attribute doesn't seem to be working

Hi there, probably something i doing wrong, but i am returning XML from my WCF Rest service which is built with VS 2010. In fiddler you can see here that it returns test/html as the content-type HTTP/1.1 200 OK Cache-Control: private Content-Length: 222 Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.5 X-AspNet-Ver...

WCF Service response "HTTP/1.1 400 Bad Request" on shared hosting <aka Blank Page, XML Parsing Error, Invalid Address, Webpage cannot be found>

This is both information to those experiencing the issue and a question. edit: The question is why does dropping "www." from the URL cause this error when a website running at the same address can be referenced without "www.". I recently reproduced this problem using a trivial WCF service (the one from endpoint.tv) after resolving the ...

Is there any way to hide/flatten base types in WCF service data contracts?

Consider the following simple example: [DataContract("{0}Base")] public class Base<T> where T : Entity<T> { // Common methods & properties. No WCF exposed properties } [DataContract] public class Employee : Base<Employee> { // WCF exposed properties } The base class Base has no properties of interest to the WCF service consu...

How to make a post method ajax call by passing the entities in javascript?

I need to make a post ajax request, where in i need to pass entity classes as parameter. for eg: [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json )] public bool SaveEmployee(Employee employee) { //inserting the d...