wcf

What can be done to speed up synchronous WCF calls?

My performance measurements of synchronous WCF calls from within a Silverlight application showed I can make 7 calls/s on a localhost connection, which is very slow. Can this be speeded up, or is this normal? This is my test code: const UInt32 nrCalls = 100; ICalculator calculator = new CalculatorClient(); // took over from the MSDN ca...

Update Web Reference in Visual Studio

Hi, I have inherited a web site project that makes use of a number of WCF Web Services hosted on a BizTalk server. We have two environments that I need to deploy this project to, with different URLs for the different BizTalk servers. i.e. In the Staging environment, I need to point the services at xx.xx.xx.101 In the Live environment, ...

WCF with collection List<T> in POCO gives "The underlying connection was closed: The connection was closed unexpectedly."

Hi, .net service to .net client with shared POCO (data objects) library at both ends. Object OrderInfo contains a List. If the list contains any Module objects I get the dreaded "The underlying connection was closed: The connection was closed unexpectedly." I can send a "standalone" List from another service method and it works fine so...

Implement WS-Addressing in a C# DotNet Web Service

I'm building a Web Service in C# with VS2008, and want to implement WS-Addressing, so the message headers look like eg below: What do I need to add / do in VS2008 to make this happen? <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/address...

How can I filter the WCF Trace?

I need to get the following information during tracing: 1. I need to know how long an operation was executed. 2. I need to know if the operation(method in the service) is executed successfully. 3. I need to know if there's an error. I know that we can see all of that using the Service Trace Viewer, but is there a way that I can filte...

WCF error from "System.ServiceModel.Administration.WbemProvider" in event log

Hi, we run a WCF service hosted in IIS7 on Win2k8. We see the following error in the event log. The WMI provider was not registered. WMI Object: System.ServiceModel.Administration.WbemProvider/65126532 Error:80041003 Process Name: w3wp Process ID: 10144 Which WMI provider has not been registered? What setup procedure was supposed ...

Any definitive guide for using Unity with an ASP.NET MVC site that hosts one or more web services?

I'm struggling to find a decent walkthrough for this issue, and was hoping that someone could shed some light on this... I've built an application using a ton of Unity and DI, and I need to pull a few components into a web site and run a WCF service now with them. host a WCF service for clients to connect to it instead of having it inclu...

Obtaining the server IP address in WCF?

How can I obtain the server address that was used for a request when it has multiple IP addresses? E.g. the server has the addresses 10.0.0.1 and 10.0.0.2. when processing the request the server service needs to know if 10.0.0.1 or 10.0.0.2 was used by the client to connect to it. So far I only found that OperationContext.Current....

How to add service known types from external config file

Hello, I am having difficulty understanding how to exactly go about adding known types; for WCF, from a configuration file that is external to my wcf. I found an example of how to set the configuration file up, however, I am a bit confused as to the way the file is set up and I am not sure as to how I am actually supposed to call this ...

Showing enums client side from wcf service

Hi! I don’t know if it’s possible, but I want to be able to refer to enums from my WCF service on the client side. I have one core project, and in that project the enums are: public enum StatusType { Ok = 1, Error = 2, Unknown = 0 } public enum DirectionType { None = 0, ToSystem = 1, FromSystem = 2 } I...

WCF binding programatically and adding metadata excange

Hi, My problem is im trying to enable mex on a service that uses net.tcp binding. that binding is for localhost port 5000, when i want to enable mex on the same port, and have it avilable for http i have to enable the HttpGetEnabled on the Service host. All this works well but when i try to add the binding it fails becuase the binding is...

Can a web.config read from an external xml file?

I have to duplicate some settings (like connection string) between a web.config file that a WCF host uses and a web.config file that a web client uses. In the interest of not duplicating, can I have both the web.configs read from a separate xml file? The two web.configs can be entirely in different solutions/projects so I guess this is ...

WCF Multiple contracts with duplicate method names

Hello, I have a service with multiple contracts like so. [ServiceContract] public partial interface IBusinessFunctionDAO { [OperationContract] BusinessFunction GetBusinessFunction(Int32 businessFunctionRefID); [OperationContract] IEnumerable<Project> GetProjects(Int32 businessFunctionRefID); } [ServiceContract] publ...

WCF RIA Services - Loading multiple entities

Hello, I'm looking for a pattern to solve the following problem, which I imagine is common. I am using WCF RIA Services to return multiple entities to the client, on initial load. I want both entities to load asyncrhonously, so as not to lock the UI, and I'd like to leverage RIA Services to do this. My solution, below, seems to work....

Perceived Inefficiencies in Data translation in web Services

I have been writing web services for about a year now and it seems that the process I use to get data from the Database all the way to display to the user and back again has some inefficiencies. The purpose of this question is to make sure that I am following best practices and not just adding extra work in. Here is the path for data ...

can multiple instances of wcf service share a single message queue for execution

Hi, Is it possible to queue messages in a separate server and have multiple instances of WCF services hosted in Windows Services in different machines to use the same queue. Using the same queue enables service requests to be kept centrally. the different service instances can get the queue messages one at a time and perform the task. P...

Adding WCF service behaviors with code

I know I can add service behaviors with some XML configuration, but I'd like to do it with a piece of C#, similar how you can add endpoint behaviors. I'm not sure how to do that, though. In other words, how can I add the debug behavior I've instantiated below? var host = new ServiceHost(typeof(MyService)); var endpoint = host.AddServic...

WCF UriTemplate won't match a single string parameter with slashes (/'s)

Here is the scenario, I have a WCF service call that takes one string parameter and that string has slashes in it (e.g. "123/456.xml"). I want to setup a UriTemplate like this "/{file}" so that I can access the method at http://www.example.com/File.svc/123/456.xml rather than http://www.example.com/File.svc/GetFile?file=123/456.xml. Is...

Is it possible to get a reference to a WCF ServiceHost Singleton Instance before the first WCF client request comes in?

I am trying to access the singleton instance created by my WCF service but .SingletonInstance seems to be null even after .Open is called on the ServiceHost. Is there any way to force the ServiceHost to create the instance before the first WCF client request comes in (which presumably automatically spawns the singleton instance)? ...

WCF service fails to start when more than one service is available.

I am running a WCF service from inside a exe (for debugging, it will be moved to the windows service when deployed) I got one service running fine inside of it however when I run a second service I get the exception System.InvalidOperationException was unhandled Message=The ChannelDispatcher at 'http://backupsvr:8082/' with contract(s...