wcf

Design pattern for WCF client switching and failover capabilities?

I'm looking to identify a best practice or often used design pattern for WCF communication allow communication to occur and fail over to another service or local service of information if the WCF (or initial service exists) I'm not sure this makes much sense so let me give an example. I'd like this agent to be able to connect to a wcf ...

Custom Domain Service Fails but Authentication Works (Silverlight Biz App Template)

I'm hosting a Silverlight Business Application Template derived application on an IIS Server. I'm using the built-in Forms Authentication which is working perfectly. Unfortunately, I've added an additional service which has peculiar behavior. If I remote into the server and use the site everything works as expected. If I connect to the ...

When I call a REST method, it asks me if I want to Download the File.

I have a simple WCF Rest Service with one method. The interface is defined as: [ServiceContract] public interface IHelloRest { [OperationContract] [WebGet(UriTemplate = "json/hello/{name}", ResponseFormat = WebMessageFormat.Json)] string Hello(string name); } The implementation is defined as: public string Hello(string na...

Calling a WCF Rest method with JSON as the Response Format asks to download the file?

This is related the following question, but I thought I would create another post so that question would not become too convoluted: When I changed the ResponseFormat to XML, the browser return the response correctly, but if I try to use JSON as the ResponseFormat, it asks me if I want to download the file. Just to see what is in the fi...

WCF and out parameters

Hi there, It seems there is restriction in having the number of out parameters in WCF. My service reference only downloads one out parameter. Example: if the service has the following method: void methodA(out string param1, out string param2) then the service reference will only create methodA(out string param1). Anyone knows h...

Why would Fiddler fix my connection issues to my WCF server?

I have a WCF server hosting clientaccesspolicy.xml (for Silverlight clients) and I was testing access to it using Internet Explorer. When I accessed it using http://localhost/clientaccesspolicy.xml everything worked correctly, but when I used http://machinename/clientaccesspolicy.xml it wasn't retrieved. I downloaded, installed and ran...

How can I share one session between several wcf's clients?

I have several web services. One of this services is used for retrieve a session id (authentication). I pass this id when call other services through SessionInfo. I want to use WCF instead of classic web methods. How can I share one session between several wcf's clients? ...

WCF Ajax Service Returns Blank to jQuery's Requests

I have an ASP.NET Ajax service set up using WebSriptServiceHostFactory in the *.svc file - no web.config configuration. In the contract, I'm starting with two very simple methods: [OperationContract()] [WebGet] string GetPersonalInformationLabel(); [OperationContract()] [WebGet] string GetCorporateInformationLa...

C# REST webservice authentication problem

In my previous question here i was experiencing difficulties with Authenticating webservices. With the use of the WcfRestContrib library which i found here i was able to solve this issue. I build a small testapplication and the authentication works like a charm. But while i'm implementing this in the webapplication where i want to use t...

Getting Exception while working with multiple endpoints

Hi All, I was trying to create a WCF application with multiple endpoints, but while accessing it using a client(console application) , I am getting below excption: Could not find endpoint element with name 'SS2' and contract 'IStockService' in the ServiceModel client configuration section. This might be because no configuration file wa...

Visual Studio: Simultaneously develop WCF client and server

I need to develop a WCF server (basically a web service which will eventually run in IIS) and a client application that accesses the service. I have both the client and the server project in the same Visual Studio (2008) solution. What's the recommended way to connect the client to the server during development? Two possible solutions ...

How to use Ninject2 with WCF?

Hi all, In a short view of the IoC and DI .NET libraries I chose to use Ninject2. According to DDD style in: Infrastructure: I have Entity Framework 4.0 .edmx model and the Repository implementation Domain Layer: I have POCO objects and Repository Interfaces (implemented in Infrastructure) Application Services: I have WCF services tha...

How can I convert an XML file to an instance of a MessageContract class?

I'm attempting to test a [MessageContract] class against an existing sample message, and I'm looking for a way to simplify development by reading the sample message file into an instance of my [MessageContract] class and seeing how it worked out (I'm dealing with a particularly complex contract here, of non-WCF origin). My [MessageContr...

WCF/Rest/UriTemplate variable length query string parameter list?

WCF will match this: http://localhost:8888/test/blahFirst/blahSecond/sdfsdf,wwewe to this: [OperationContract] [WebGet( UriTemplate = "test/{first}/{second}/{val1},{val2}" )] string GetVal( string first, string second, string val1, string val2 ); Is there a way to make the va11, val2 be a variable length list of parameters? So it co...

WCF service hosted in Topshelf takes long time to shut down

I'm using Topshelf to host a WCF Service as a Windows Service. Even when just running on the console, it takes an exceptionally long time to shut down after I send it a Ctrl-C, and this is mirrored when running as a service. On my local machine, it takes 1ms to call svcHost.Close(new TimeSpan(0)), but 10240ms between the end of my Stop...

Property access differences between .Net 3.5 and 4

I'm trying to create a WsHttpBinding entirely in code, within an SSIS Script Task. The script task will not have access to an app.config file at run time so I need to create the binding manually and set the parameters in code: WSHttpBinding binding = new WSHttpBinding{ Security = new WSHttpSecurity{ ...

How can I add a XML prefix to fields in WCF Message Serialization?

How can I add a XML prefix to fields in WCF Message Serialization? I'm connecting up to a Java Spring web service from .NET, and an object that I pass in with parameters is being serialized as you would expect: <MyClass> <field1>Field 1 Value</field1> <field2>Field 2 Value</field2> </MyClass> However, the web service requires tha...

WCF RIA Services link dropdownlist not present in project properties (Visual Studio 2010)

I committed a project to VSTF and then pulled it down locally on another machine. It works fine on my dev box, but on the other machine, the WCF RIA Service link appears to be gone and there is no option to re-add it in the project properties. See image for clarification: http://imgur.com/XIwfB.png What's missing on the other machine? ...

WCF Client consuming ASMX Web Service with Soap Header

...

Why is this method not allowed for WebInvoke, but OK for WebGet?

Can someone explain the reason behind this or how it works? IF I do a WebInvoke on the following, it fails (says method not allowed, but if I do a WebGet, it passes). I just want to understand why? [OperationContract] [WebGet(UriTemplate = "login/{username}/{password}", ResponseFormat = ...