wcf

How to pass a generic object through WCF

Is it possible to pass generic objects (by generic I mean any with DataContract, not C# generic collection) without inheriting from one root? At the moment I have something like this: [OperationContract] void Save(GenericObject o); [DataContract] [KnownType(typeof(ClassA))] [KnownType(typeof(ClassB))] class GenericObject {.... [DataCo...

what is the difference between wcf service and web service?

Duplicate: http://stackoverflow.com/questions/351334/web-service-vs-wcf-service What is the difference between WCF service and Webservice ? ...

Why is SvcTraceViewer included into Windows SDK and NOT to .NET Framework tools?

It is a WCF tool and why it is located within Windows SDK and not inside the .NET Framework? ...

REST in WCF -- PUT and DELETE return "Forbidden"

I created a REST webservice in WCF that originally used POST to perform any inserts and deletes. Mostly out of curiosity, I decided to change the insert to a PUT and the delete to a DELETE. While this worked fine on my local machine (using the built-in VS2008 webserver), I'm getting this error when trying to target an actual server dep...

How can we transparently serialize Dataset ExtendedProperties in WCF?

We are migrating from Remoting to WCF a very big application that makes intensive use of DataSets. We use the ExtendedProperties of the DataSets' tables to store a graph of objects containing special information we need at client side. In our Remoting implementation we did add to the channel stack a client and a server channels to check...

Setting credentials for a WCF application?

I've written a simple Application that utilizes WCF to communicate between client and server. When I run it locally it works fine, however when I run the server and client on two different boxes I get the following exception: Unexpected error occured, while getting the group names from the VDN server System.ServiceModel.Security.Securit...

What causes this error message? The remote server returned an error: (422) Unprocessable Entity.

I try to submit a request to a REST API using WCF; here's what I've done: namespace Sample { [ServiceContract] [XmlSerializerFormat] public interface ISampleApi { [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "users.xml", ResponseFormat = WebMessageFormat.Xml, RequestFormat = WebMessageFor...

Does WCF FaultException<T> support interop with a Java web service Fault

I have written a java axis2 1.4.1 web service and .net 3.5 WCF client and I am trying to catch the wsdl faults thrown. Unlike .net 2.0 the .net 3.5 claims to support wsdl:fault and the service reference wizard does generate all the correct fault classes in the client proxy. But when I try to catch a fault it doesn't seem to correctly s...

WCF duplex service using net tcp: "Stream Security is required..."

I'm writing a service that allows users to register with it and receive notifications when an event happens. I'm trying to do this with netTcpBinding, but keep coming up with errors, even when running on my local machine. When I try to send a notification, I am timing out, getting this error: Stream Security is required at http://w...

How to do after-call proccessing on a web service?

Is there a way to have a web service (WCF/ASMX/etc) call do some processing after it returns it's results? Note I'm not looking for a asynchronous calls as the client needs the result back ASAP, before the the extra processing is done. The primary constraint is that as far as I can tell, the only way for me to run code on my server is v...

WCF service documentation

What is the best way to document/publish information on a WCF service in a technical product document that both programmers as well as non-programmers will look at? Also, what is the best tool for publishing. ...

Injecting an unrelated contract into the WSDL created by WCF's MEX provider

I am implementing a WCF service (Contract A) that will eventually make calls to a standalone service (Contract B) hosted by the client. At design-time when the client queries my service's WSDL to build its proxy, I'd like to include the WSDL for Contract B so the client can build its service around that. Unfortunately, I can't figure out...

WCF Callback Channel gets disposed prematurely?

My application is using the net.tcp WCF service with a callback channel. For some reason I'm not able to send callbacks on event. Here's what I'm doing (all code server-side): On initialization: OperationContext Context { get; protected set; } ... Context = OperationContext.Current; On event: var callback = Context.GetCallbackChanne...

ChannelFactory.Close VS IClientChannel.Close

Consider the following code which is typcial of many ChannelFactory examples: WSHttpBinding myBinding = new WSHttpBinding(); EndpointAddress myEndpoint = new EndpointAddress( ConfigurationSettings.AppSettings["HelloWorldServiceURL"]); ChannelFactory<IHelloWorldService> myChannelFactory = new ChannelFactory<IHelloWorldService>(...

What is the best way to call/start a Windows Service every x seconds?

I have a Windows Service which is basically accessing a mailbox and reading the emails. I am trying to figure out the best way to check the mailbox every x seconds. One method is to just call Thread.Sleep, then call the Start Method again, e.g. protected override void OnStart(string[] args) { // get config settings CheckMailb...

Can an WCF Service create his own host ?

I have a client / server type of application and I'd like the server object to create his own host. It looks something like this: public class Server : IServer { private ServiceHost m_Host; public Server() { m_Host = new ServiceHost(this); m_Host.Open(); } } It seems to work fine when there are few message transfers oc...

WCF InProcFactory error

I'm using IDesign's ServiceModelEx assembly to provide additional functionality over and above what's available in standard WCF. In particular I'm making use of InProcFactory to host some WCF services within my process using Named Pipes. However, my process also declares a TCP endpoint in its configuration file, which I host and open wh...

Suggestions to log the number of requests when building an API?

We have a pretty large website, which handles a couple million visitors a month, and we're currently developing an API for some of our partners. In the near future, we hope to expose the API to all of our visitors. As we are trying to limit the number of requests to say, 100.000 / day and 1.000 / minute, I need to log the total number o...

Move WCF service from test console app to IIS

Hi, I've been building a WCF app behind 3 projects (contract,implementation,client) I've hosted my service as a console app with basic HTTP binding. I'm now ready to move it to IIS. However, the tutorial for creating a .svc file shows it actually implementing the contract - but I already have an implementation. How do I just redirect to...

WCF: Why isn't HttpResponse getting logged here?

I am trying the samples from the Learning WCF book and trying to inspect the HTTP request/response. I can see the HTTP Request headers in MS TraceViewer but strangely not the response headers. (only envelope). If you notice something amiss, could you please let me know? <configuration> <system.serviceModel> <diagnostics> <me...