wcf

How do I close a database connection being used to produce a streaming result in a WCF service?

I have been unable to find any documentation on properly closing database connections in WCF service operations. I have a service that returns a streamed response through the following method. public virtual Message GetData() { string sqlString = BuildSqlString(); SqlConnection conn = Utils.GetConnection(); SqlCommand cmd =...

Can WCF RIA Services be self hosted?

I know WCF can be self hosted. how about WCF RIA Services? Thanks! ...

Is the WCF REST Starter Kit dead in the water... now?

Looking at an older stackoverflow post (back in June 2009, http://stackoverflow.com/questions/1006309/is-the-wcf-rest-starter-kit-dead-in-the-water), a Microsoft employee said they were pretty close to releasing the next version of the Starter Kit. That was a looong time ago and... they haven't released one. So I'm asking again, Micros...

Help with Authentication ASP.Net Service loses Login

I have been making use of the WCF Authentication Service in ASP.Net but I have found that whenever you navigate all session, user, login data is lost. I have tested using the Standard ASP.Net Login page and mechanism and everything works fine... Why is nothing persisting from one page to another? ...

upload streaming to WCF IIS 7 hosted service not working

I have a wcf service I am setting up to run under IIS 7. I have the service set to streaming for the transfermode. When I self host the service in a console application every thing seems to work ok. But when the client connects to an iis hosted service it seems to be buffering, and the client eventual times out. I have used fiddler to ...

WCF MessageHeaders in OperationContext.Current

If I use code like this [just below] to add Message Headers to my OperationContext, will all future out-going messages contain that data on any new ClientProxy defined from the same "run" of my application? The objective, is to pass a parameter or two to each OpeartionContract w/out messing with the signature of the OperationContract, s...

Opinions on Client Server communication in a very restricted environment.

I have a server that needs to receive information from a client, web services was my first thought until a limitation was imposed. I am not allowed to setup a normal client/server interaction, because the server is not allowed to listen on any ports. The server is allowed to call out, so I'm left with : Having the server poll from the...

WCF Service with callbacks coming from background thread?

Here is my situation. I have written a WCF service which calls into one of our vendor's code bases to perform operations, such as Login, Logout, etc. A requirement of this operation is that we have a background thread to receive events as a result of that action. For example, the Login action is sent on the main thread. Then, several eve...

Informational messages returned with WCF involved

This question is about “informational messages” and having them flow from a “back end” to a “front end” in a consistent manner. The quick question is “how do you do it”? Background: Web application using WCF to call back end services. In the back end service a “message” may occur. Now, the reason for this “message” may be a number of ...

NullReference Exception is thrown while getting a callback channel

Hi! I am trying to get along with WCF's duplex contracts. A code from this article (http://msdn.microsoft.com/en-us/library/ms731184.aspx) ICalculatorDuplexCallback callback = null; callback = OperationContext.Current.GetCallbackChannel(); throws a NullReferenceException. So how can i manage this? Thanks for your attention! ...

WCF host address question

when I setup the wcf service on a web server, I set the end point address as <endpoint address="http://www.mydomin.com/clientname/happy.svc" binding="basicHttpBinding" name="happysvcbasic" contract="happysvc.Ihappysvc"> </endpoint> but when type in above address on a browser, I get a diff...

WCF: Is it safe to override the Client's Dispose method using a partial class?

I'd like to override the Dispose method of generated proxy (ClientBase) because of the fact that disposing of a proxy calls Close and can throw an exception when the channel is faulted. The only way I came up was to create a partial class to my generated proxy, make it inherit from IDisposable: public partial class MyServiceProxy : I...

WCF how to pass token for authentication?

I have a WCF service which would like to support basicHttpBinding and webHttpBinding. When the client successfully login, server will generate a token for client to pass to server on all the request make later. Question is how the client can pass the token to server? I don't want to add an extra parameter on every web method to hold the ...

Multiple Operations with soapAction="" in a WCF Service Contract?

I need to create a service that will be "called back" by a third party. As a result, I need to conform to their WSDL. Their WSDL has all of the operations defined with soapAction="", so my service needs to do the same. Unfortunately, I'm getting the error: The operations A and B have the same action (). Every operation must h...

WCF - CODEGEN: Generating message contract since message FileRequest has headers

I am aware that there is a similar question here with no solution. I'm working on a WCF streaming service over HTTP. Here are my MessageContract [MessageContract] public class FileRequest { #region Message Header [MessageHeader(MustUnderstand = true)] public Credential Credentials { get; set; } #endregion #regio...

How to secure WCF service with public / private key pair without using any certificates

I want to secure my WCF service. For example if I want to generate public / private key pair without involving any third-party certification authority. What is the way and method to do it? Any idea or any other approach. ...

Sync Framework Peer Data Sharing Unable to Catch Conflicts, Source Provider Alwasy wins!

Hi, I am using SQL Server 2008 and the WebSharingAppDemo-SqlProviderEndToEnd sample and this is almost perfect for my needs however I am unable to detect conflicts. By default ConflictResolutionPolicy is set to ApplicationDefined. I have tried setting the ResolutionPolicy to SourceWins, DestinationWins or ApplicationDefined and I alwa...

WCF "DataContext accessed after Dispose"

I have an application with numerous WCF services that make use of LINQ-To-SQL as the data access model. I am having lots of problems with the "DataContext accessed after Dispose" exception. I understand what this exception is and that it is occurring because I have not "initialised" the data that is trying to be accessed. I've read many ...

wcf metadata service page url

I have a service with the metadata exposed. Trouble is when I browse to the wsdl the service page it has the machine name as below: MasterLibrary Service You have created a service. To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command li...

WCF .svc Accessible Over HTTP But Accessing WSDL Causes "Connection Was Reset"

I have a WCF service which is hosted on IIS6 on a Win2003 SP2 machine. The WCF service is hosting correctly and is visible over HTTP giving the usual "To test this service, you will need to create a client and use it to call the service" message. However accessing the .svc?WSDL link causes the connection to be reset. The server itself ...