wcf

ActiveResource NameError calling a WCF Service

Lately I've been working on validating an architectural design idea using Rails ActiveResource as a client and a WCF restful service as a server. I have the WCF service running on Windows Vista in a bootcamp partition on a Macintosh hosted in VMWare Fusion (self hosted mode). When I call the service from the Mac in a browser, I do indeed...

How to access SOAP 1.1 fault detail from WCF client (no fault contract)

I'm accessing a SOAP 1.1 web service, and it's returning a fault. The web service does not define any fault contract in the WSDL as far as I can see. My WCF client maps the fault to a FaultException (rather than a FaultException<T>). This all makes sense. The problem is that the service is returning some useful diagnostic information...

WCF REST Debugging

How can I log what xml is sent to my WCF REST service prior to being deserialized into my datacontract class? ...

Add Service Reference to WCF Service within Same Project

Is it an acceptable programming practice to add a Service Reference to a Project where the Service being referenced is defined within the same VS Project? (Service and Service Reference are in the same Project) example: MyWebAppProj -Services --MyService -Service References --MyServiceServiceReference.MyServiceClient -Default.aspx.cs ...

Mixing XML and JSON in RESTful WCF without separate methods

I have a RESTful WCF service that can return XML, JSON, or JSONP, depending on the arguments, e.g. /service.svc/stuff?format=xml or service.svc/stuff?format=json&callback=myCallback. To do this, I've created a custom Behavior, MethodEncoder and MethodEncoderFactory which handle wrapping the JSONP callback and chooses the writer based on ...

Getting quotes in innerXML to go on the wire as &quot;

(warning - unholy mixture of xml and gratuitous character encoding below.) Short version: Why can't I get my service reference call (c#, .net 3.5, automagic service reference code added to VS2008) to properly encode a parameter that's supposed to look like this one the wire: (look for the &quot; bits...those are my bane.) (other extra ...

Is it possible to have different StructureMap configurations for ASP.NET and IIS-Hosted WCF?

I just followed this example to bootstrap WCF with StructureMap. At the same time I've been using StructureMap in my ASP.NET application (IIS6), which is initialized in Global.asax.Application_Start(). The two configurations have different requirements. Unfortunately, StructureMap is configured statically, and contrary to my expecta...

Unexplained CPU use in C#/WCF application

I have a troublesome problem which I'm at a loss to explain. To put it simply, the CPU use is inexplicably high on the web servers in my web farm. I have a large number of users hitting two front-end web servers. 99% of the page loads are Ajax requests and serve a simple JSON-serialized object which the web servers retrieve from a backe...

Can you get a client to trust a Server certificate without needing it to be a Registered Trusted Certificate?

I have a WCF Server Deployed through IIS. I want to Create a Certificate for it. I could do this by making the server a certificate server. But then when the client connects to that server I want the client to automatically trust the certificate without having to register that the server as a "trusted authority". Is this possible? ...

IIS 7 Restarts Automatically

Dear Gurus I have a WCF Service Deployed on IIS. (BasicHTTPBinding with [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]) I have built custom in-memory session management and Now I am facing a strange problem that is IIS 7 Restarts Automatically without even throwing any kind of warning...

Why WCF needs DTC for transaction flow ???

Hi, I wonder why WCF needs MSDTC configured and started on both client and server, when I use transaction flow. (with network access enabled) After all, transactions in WCF are managed though SOAP messages using WsAtomicTransaction... So why in the hell the two DTCs need to communicate with each other ? Thanks for your response. ...

Castle WCF DefaultServiceHostFactory in IIS: Accessing the ServiceHost

I am attempting to move from a self hosting architecture to hosting under IIS 6, primarily to take advantage of built in dynamic compression. I am using the Castle DefaultServiceHostFactory to provide the service to IIS in the .svc file. However, I need to programmatically specify certain end points and behaviours and I do not know how...

How to produce an HTTP 403-equivalent WCF Message from an IErrorHandler?

I want to write an IErrorHandler implementation that will handle AuthenticationException instances (a proprietary type), and then in the implementation of ProvideFault provide a traditional Http Response with a status code of 403 as the fault message. So far I have my first best guess wired into a service, but WCF appears to be ignori...

WCF with multiple services and namespace issues

I have created a number of WCF Services, for arguments sake they are called Service1 and Service2. Both of the services return (at some point, possibly through a relationship inside an object) a Customer object. For testing sake, I have added a GetCustomer() method to both Service1 and Service2 and I have added a service reference to b...

BizTalk low latency - response time issue calling C# to WCF-Published-Orchestration

Calling a WCF published orchestration from a C# program usually is sub-second response time. However, on some occasions, it can take 20-50- seconds between the call in the C# program and the first trace message from the orchestration. The C# that runs calls the WCF runs under HIS/HIP (Host Integration Services/CICS Host-Initiated Proce...

What is the order of schema locations (xsd:import) generated in a WCF WSDL?

I'm generating a custom address for the schemaLocation attribute of the xsd:import statements in a WSDL. Is there an easy way to determine which xsd selector corresponds to which namespace? For example, the wsdl generated automatically by WCF contains <wsdl:types> <schema targetNamespace="http://www.xyx.com/myService/Imports" ...

Custom Exception as Detail in Fault Exception

Hi, I'm trying to throw my own custom exception inside a FaultException from my WCF service and catch it in my WCF client. On the client side, however, the exception is caught as a non-generic FaultException and the details of my custom exception are lost. My custom exception is: [Serializable] public class MyCustomException : Applic...

How to generate client-side code for multiple WCF services with shared types

I have multiple WCF services that share some data contracts and need to generate client-side code using svcutil.exe. I've run into errors using two most obvious ways to do this and need some help. But first, here are the services: [ServiceContract( Namespace = "http://www.me.com/services/" )] public interface IFooService { [Operati...

Why should a developer use web services instead of direct connections to a db?

I'm looking for a "top ten" list of reasons why we should be connecting to remote databases via web service instead of directly connecting to the db. This is an internal debate right now and I'm pro-web service but loosing the argument. I have a basic grasp of WCF / web services, no one else does. We can do whatever we want moving forwar...

WCF Soap Actions in HTTP header or SOAP header?

I'm a little confused about how SOAPAction is implemented in WCF (and other web service frameworks for that matter). In a test client, I have a Client Message Inspector configured to grab both the SOAP message and any HTTP headers that are being sent with the request. At least here in the client message inspector, the action shows up a...