wcf

Web Services Primer for a WinForms Developer?

I've been writing client/server applications with Winforms for about six years now, but I have yet to venture into the web space (neither ASP.NET nor web services). Given the direction that the job market has been heading for some time and the fact that I have a basic curiosity, I'd like to get involved with writing web services, but I d...

How to use SQL file streaming win32 API and support WCF streaming

I'm using Sql server file stream type to store large files in the backend. I'm trying to use WCf to stream the file across to the clients. I'm able to get the handle to the file using SQLFileStream (API). I then try to return this stream. I have implemenetd data chunking on the client side to retrive the data from the stream. I'm abl...

Returning a byte[] in WCF service

Is it a good practice to return a byte[] in a WCF service which will be invoked by many applications below is the code public byte[] GetDoc(string docParam) { byte[] doc; doc = GenerateDoc(docParam); } Thanks ...

Detecting Connection Speed / Bandwidth in .net/WCF

I'm writing both client and server code using WCF, where I need to know the "perceived" bandwidth of traffic between the client and server. I could use ping statistics to gather this information separately, but I wonder if there is a way to configure the channel stack in WCF so that the same statistics can be gathered simultaneously whi...

Will creating a background thread in a WCF service during a call, take up a thread in the ASP .NET thread pool?

The following code is part of a WCF service. Will eventWatcher take up a thread in the ASP .NET thread pool, even if it is set IsBackground = true? /// <summary> /// Provides methods to work with the PhoneSystem web services SDK. /// This is a singleton since we need to keep track of what lines (extensions) are open. /// </summary> publ...

Elmah for non-HTTP protocol applications OR Elmah without HttpContext

We are working on a 3-tier application, and we've been allowed to use the latest and greatest (MVC2, IIS7.5, WCF, SQL2k8, etc). The application tier is exposed to the various web applications by WCF services. Since we control both the service and client side, we've decided to use net.tcp bindings for their performance advantage over H...

WCF Callbacks often break

I'm having quite some trouble with the WCF Callback mechanism. They sometimes work but most of the time they don't. I have a really simple Interface for the callbacks to implement: public interface IClientCallback { [OperationContract] void Log(string content); } I then implmenent that interface with a class on the client: [Serv...

How to inject dependencies into a custom UserNamePasswordValidator in WCF?

I'm using a UserNamePasswordValidator in WCF along with Unity for my dependency injection, but since WCF creates the instance of the UserNamePasswordValidator, I cannot inject my container into the class. So how would one go about this? The simplest solution I can think of is to create a static proxy/wrapper class around a static insta...

slsvcutil.exe Proxy and Interfaces

Is it possible when using slsvcutil.exe to generate a proxy through the command line not to have the proxy file output the Interface in an Asynchronous fashion. For example, if I have a function "foo()" on the serverside in the Interface, when I generate the proxy using Slsvcutil.exe, it makes two functions in the interface definition i...

WCF using windows service

I am creating a WCF service which is to be hosted in Windows Service. I created a console application as follows I went to management console (services.msc) and started the service. But I got the following error The LijosWindowsService service on Local Computer started and then stopped. Some services stop automatically if they...

WCF Error: the client and service bindings may be mismatched?

Hi let see server config and client config. Then help me find difference between these configs!! Client config <system.serviceModel> <client> <endpoint address="http://localhost/admin2/AdminCentralService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_Config" contract="TIR.Three...

Consuming a WCF Service

I created a WCF service which is hosted in windows service. I created a proxy using svcutil “svcutil.exe http://localhost:8000/ServiceModelSamples/FreeServiceWorld?wsdl” It generated an output.config file and proxy class. The output.config has the following element <client> <endpoint address="http://localhost:8000/ServiceModelSam...

EndpointNotFoundException when working through tutorials in Learning WCF

I am working through the book Learning WCF and on the first tutorial lab HelloIndigo I am receiving the following error. Could not connect to http://localhost:8000/HelloIndigo/HelloIndigoService. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8000. It appears in the Client pro...

possibility to do type/data conversion of data returned by ria services?

My service returns an byte array, which I have to convert to an 'animated gif' (using imagetools since silverlight doesn't support it yet) I was wondering, is it possible to insert some code at the client, where I can do the conversion before the actual object is returned to whatever it is binded against? On the server side, the querie...

WCF: Using multiple bindings for a single service.

Hi, I have a WCF service (in 3.0) which is running fine with wsHttpBinding. I want to add netTcpBinding binding also to the same service. But the challenge that I am facing is in adding behaviorConfiguration. How should I modify the following code to enable the service for both the bindings? Please help… <service name="Li...

WCF web.config is getting overwritten after every compilation?

Hi I have a Silverlight application calling a WCF service. SimplehttpBinding stuff. Every I make changes to silverlight xaml code, the web.config gets refrshed also. Even if make any changes to web.cofig file, they get overwritten too. Its as if, some other process is writing these files. Why is that happening? How can I make sure t...

Passing array to WCF service

Hi, Is it possible to pass an array as an argument from a C# code to a WCF web service? I'm still new to all this. Please help. Thanks ...

Entity Framework and consuming a WCF service

I'm getting data where the database is hidden behind a WCF service. Is it possible to use Entity Framework in a scenario where I have custom objects coming from a web service? (No access to the external database, and no current plans for insert/update/delete logic) Starting with an empty EF model and adding an entity I get this error o...

Prevent Visual Studio generating async methods for WCF callback

I have a WCF Service that uses a callback. Using the "Configure Service Reference..." I can tell it to generate me async implementations. The problem is it will also generate me an async callback which I do not want because I then have to implement it manually which is complicated. Is there a way to just generate the asnyc client for ...

Hosted wcf service in IIS dont response to other computers?

HI I develop the wcf service for hosting in IIS. test service in computer(which is service host in itself IIS) and as result this service work fine. But When I try use that service from other Computer, service not responding and service cant be find!!! ...