wcf

WCF service instance will not close despite only calling oneway method

I have a WCF service running inside a windows service on a remote machine. In the WCF service's contract, I have a method that takes a long time to run set up as [OperationContract(IsOneWay = true)] void Update(myClass[] stuff); Everything works fine, the method gets called, I can see what it needs to do start getting done. The prob...

WCF Web Service Custom Exception Error to Client

I would like to throw custom exception like some error message as an exception from WCF web service and trying receiver this exception error message in client app on calling web service method. how to throw custom exception from WCF web Service and receive same exception error at client side. WCF Web Service Method: public bool Re...

Custom Output directory for a .NET Web Project

Whenever I choose a custom output folder in a WCF Service or Web project in VS .NET 2008, running the project always gives me errors or inconsistencies as far as finding the right referenced assemblies. For example, if the output folder is < solution root >\bin instead of < solution root >\Project\bin, the project will still attempt to ...

ServiceHost message receive event?

Surely there must be an event to attach onto before a ServiceHost or Channel or Dispatcher handles a message? I'm assuming it can be accessed through OperationContext.Current, but the closest events I can find are Opening and Closing. Is there something like a MessageReceived or BeforeMessageProcessed event? If not using events, is the...

Include xml prolog in web request

I've added a Service Reference for a third-party web service to my project. When i send a request to a webservice using the generated method, the request fails saying that it is missing the XML prolog. How can I add: <?xml version="1.0" encoding="UTF-8"?> to the begining of the request before sending it? This is a C# web applicatio...

How to find out if a client gets disconnected before a WCF service returns data?

Hello, I have a WCF service with a function GetData() When my client calls this function,it takes a while to return the data after looping through some stuff Within that period of time,if I pull of the wires on the server,no error is thrown. How do I get to know if the client gets disconnected? Thanks. Edit:I'm using Wshttpbinding ...

Where to place clientaccesspolicy.xml in Silverlight project

I have a Silverlight application on the client communicating with the server side through WCF. I keep getting a CommunicationException occasionally - and in particular when passing larger amounts of data to some parameters of the service. I have been told that if I want the Silverlight application to communicate with a server like this I...

WCF serialization error

Hi there, I have method of a WCF service that accepts an interface as a parameter called IClient [OperationContract] void RegisterClientToCallBackTo(IClientCallBack client); public interface IClient { void SendMessage(string message); } I have a windows form that implements iclient and When I pass the form into the method I get ...

Generating iTunes podcast feed with WCF

How do you make an iTunes podcast feed with WCF? Or do you know of a complete example that actually works? I've reached the point where I corrected all errors and warnings[1] marked by feedvalidator.org and also included all the iTunes custom tags I could and iTunes still claims it's a broken feed (obviously giving no useful information...

WCF: Accessing a windows form from inside a service

Hi there, How can I achieve this scenario? I have a WCF service hosted in a windows form and whenever a client of the service calls a method on the service i want the service to be able to write a message to a textbox on the windows form. I was thinking that i would make my WCF service a Singleton, pass my form using an Interface that...

Silverlight WCF calls work in IE but not in FF

Hi, I'm having a WCF service deployed on one of my servers, and my Silverlight app on the other server. The problem I'm having is running it in Firefox 3.5. Opening in IE 6/7 works great, but when I open it in Firefox it loads the app, but on calling WCF service i get this: An error occurred while trying to make a request to URI 'http:/...

WCF Integration Facility throws exception: cannot load System.ServiceModel

<component id="errorhandler1" service="System.ServiceModel.Description.IServiceBehavior, System.ServiceModel" type="Nbs.CoreServices.GenericErrorHandler.ErrorHandler, Nbs.CoreServices.GenericErrorHandler" /> I am trying to inject a errorhandler component using Castle with WCF. I get this error wherein I get the er...

Why isn't the Identities property passed to my custom IAuthorisationPolicy?

I'm trying to set up a custom IAuthorisationPolicy that I can give to ServiceAuthorizationBehaviour to install my own IPrincipal implementation. I've followed the instructions here, and written a test that verifies that this works when self-hosting using a NetNamedPipes binding. The problem is, when I try to use this hosted under IIS t...

Using CDATA with WCF REST starter kits

Hey Everyone, I have a service built using Preview 2 of the WCF REST starter kit, but I've run into an issue with passing around xml-styled data in the calls. Here's my request object: [DataContract(Namespace = "")] public class ServiceRequest { [DataMember] public string ContentText { get; set; } [DataMember] public s...

Managing asp.net membership in production

I have been using the 'Web Site Administration Tool' that you can bring up in Visual Studio to manage users and roles in our dev and staging environment. Currently we have no way of managing users and roles when the app goes to our production servers. for now we have been calling stored-procedure in the membership database to manually ...

How do you add another namespace to WCF SyndicationFeed?

In my feed generation code I have things like: XNamespace itunesNS = "http://www.itunes.com/dtds/podcast-1.0.dtd"; feed.ElementExtensions.Add( new XElement(itunesNS + "subtitle", new XAttribute(XNamespace.Xmlns + "itunes", itunesNS.NamespaceName), "sample subtitle").CreateReader()); which generates something like ...

Wcf Request Lifecycle

Is there a lifecycle that WCF requests go through? Specifically I need to be able to intercept and possibly cancel requests made before they get to the method that was invoked. ...

Bridge NSB over WCF

I am trying to publish a WCF service that sends to a NSB host. I have looked at the WebServiceBridge example in the NSB samples but cannot figure out how to use the NServiceBus.WcfService class in the WCF counterpart. I have found out that I can have my service interface inherit one or more IWcfService < TRequest, TResponse >, but since...

IDispatchOperationSelector question

Hello, i built a service with a custom operation selector, the selector simply looks at a specific element in the message body ( and ignores the action) to specify which method to call on a contract. This works fine, and i can see that the server code is being invoked now, however the client throws an exception saying that the action o...

WCF: Interfaces, Generics and ServiceKnownType

Hi guys I have the following: [ServiceContract] [ServiceKnownType(typeof(ActionParameters))] [ServiceKnownType(typeof(SportProgram))] [ServiceKnownType(typeof(ActionResult<SportProgram>))] public interface ISportProgramBl { [OperationContract] IActionResult<ISportProgram> Get(IActionParameters parameters); } When I run the ...