wcf

Are there any constants in the .NET framework for the different web method types (GET, PUT, POST, DELETE, HEAD)?

I just noticed while creating a RESTful WCF service that the Method parameter on the WebInvoke attribute is case sensitive (CAPS required). So, [WebInvoke(Method = "Delete")] is not equal to [WebInvoke(Method = "DELETE")] This mistake was causing a ProtocolException: System.ServiceModel.ProtocolException: The remote server ret...

WCF - advantages and disadvantages

I would like to find out about BOTH advantages and disadvantages of Windows Communication Foundation from people who have used it or just know it theoretically. ...

How to configure WCF in a separate dll project

Aloha I'm developing a web application (ASP.NET 3.5) that will consume a number of web services. I have created a separate dll-project for each web service: these projects contains the service reference and client code. However, the calling website MUST have the <system.serviceModel> information (the <bindings> and <client> nodes) in ...

Strange communication error in Win2008

I have a windows service that hosts the main WCF service. The clients for this service are both hosted in IIS 7, the first one is an IIS hosted WCF service and the second is a standard Asp.Net application. Both of the IIS hosted clients communicate with the windows service over named pipes. The IIS hosted WCF service can communicate w...

Best practice to share DAL between ASP.NET and Silverlight 2

I have an ASP.NET 3.5 e-commerce site that has an admin section. I want to swap out the ASP.NET-based admin section and rewrite it in Silverlight 2. Silverlight requires async calls, so I can't just call my existing DAL from a new SL2 app. What is the best practice for doing something like this? Should I create a WCF service and call...

How to change WCF binding of a third party component?

I have a third party application, built with WCF. It is installed as a windows service and it supports wsHttpBinding and basicHttpBinding by default. Is there a way to switch to a more optimized binding such as tcpBinding or named pipes? I will be consuming the service within same server so named pipes is an option. I want to know i...

.Net: Running code when assembly is loaded

Is it possible to run some code when an assembly is loaded, without doing anything specific in the loading code? What I am looking for is like a static constructor on a type. Eg: Assembly A does not know about Assembly B, but B does know about A. Assembly A needs to know certain things about B if B is loaded. When Assembly B is loaded ...

Can I stop my WCF generating ArrayOfString instead of string[] or List<string>

I am having a minor problem with WCF service proxies where the message contains List<string> as a parameter. I am using the 'Add Service reference' in Visual Studio to generate a reference to my service. // portion of my web service message public List<SubscribeInfo> Subscribe { get; set; } public List<string> Unsubscribe { ge...

Connecting ASP.Net to Wcf/Tcp chat service

I have a WCF chat service that accepts duplex tcp connections. A single duplex tcp connection can be used to send and receive messages for more than one user (so I can have multiple chat servers that all connect to each other). Now I want to add Web users into the mix, to let them chat with the desktop users. This is for a live-support ...

WCF Config element: baseAddressPrefixFilters

I have read the documentation for this element but still fail to understand what its purpose is. Here is a sample of how I've seen it used in examples: <serviceHostingEnvironment> <baseAddressPrefixFilters> <add prefix="http://localhost:5100/"/&gt; </baseAddressPrefixFilters> </serviceHostingEnvironment> I want to understand w...

Is there a way of using WCF and .NET Remoting at the same time?

Due to deployment restrictions, we can't deploy WCF on the client-side (yet) but would like to use it on the server-side. I am interested to know if it is possible to use WCF on the server but consume it with .NET remoting on the client side. I don't have any problems with using specific bindings, transfers or protocols on the server si...

.NET Remoting vs. Web Services vs. Windows Communication Foundation (WCF)

Anyone willing to help me out with pros/cons on .NET Remoting, Web Services, and WCF? I have worked a bit with .NET Remoting and Web Services and I am architecting a new ASP.NET 3.5 web app where I will be using a SQL 2008 DB. Primarily I am wondering if it would be worthwhile to really look into WCF for this app. In this particular i...

WCF [DataContract] set/get not getting executed

I'm a bit new to WCF and I don't think I completely understand what the deal is with DataContracts. I have this 'RequestArray' class: [DataContract] public class RequestArray { private int m_TotalRecords; private RequestRecord[] m_Record; [System.Xml.Serialization.XmlElement] [DataMember] public RequestRecord[] Record { ...

Multi-tenancy with SQL/WCF/Silverlight

We're building a Silverlight application which will be offered as SaaS. The end product is a Silverlight client that connects to a WCF service. As the number of clients is potentially large, updating needs to be easy, preferably so that all instances can be updated in one go. Not having implemented multi tenancy before, I'm looking for ...

Multiple Base Addresses in single WCF Service

I have an environment where multiple sites hosted on the same server will use a single service to make its calls. For example: http://domain1.com/Api/Service.svc http://domain2.com/Api/Service.svc The Api application has been setup as a virtual directory in each site mapped to the same physical directory, so that the source is only l...

WCF Self-hosted service, client clean-up on service stop

Hi everyone, I'm curious to know how I would go about setting up my service to stop cleanly on the server the service will be installed on. For example when I have many clients connecting and doing operations every minute and I want to shut-down the service for maintenance, how can I do this in the "OnStop" event of the service to then...

Naming Generic DataContracts in WCF

I am using a Generic Class as a Response Data Contract. All is good and this is streamlining the design of my WCF service significantly. Each request is given a standard response object with the following signature: Status (Enum) Message (String) Result (T) Below is the Response Class: [DataContract] public class Response<T> ...

Do WCF Web Service components have to be coupled to the web?

I'm learning about WCF Web Services and I'm concerned about all of the coupling that I'm seeing. The way I see it, I should be able to write a component and then use it just about anywhere - in-proc, across the intranet or from an ASP.NET page and only ever need to just change the way it's hosted. Once you start working with System.Ser...

Best way to compute UTC/local datetime conversion in a WCF client/server application

I've got a client/server application, written in WCF / C#3.5. The server is in my local TimeZone, and clients are spreaded accross the world. My current strategy is to use UTC DateTime everywhere on the server and in the database, and to let the clients handle correctly the UTC DateTimes they receive. This means that everytime the cli...

How to move from LINQ to SQL to "LINQ to WCF"?

I'm putting together a WPF application which will eventually use WCF web services as its data source. During the prototyping phase, I'm using LINQ to SQL on an SQL 2008 database and have come to appreciate the ease with which I can do "Add New Item | LINQ to SQL Classes" and generate a model class for a table, then speak to it with LIN...