wcf

Does ChannelFactory implement a factory pattern?

I’ve started learning WCF and I’m already utterly confused. I did a bit of reading on factory pattern and I can’t figure out how or why does ChannelFactory<> implement it. Namely, the whole idea of a factory pattern is that factory abstracts the creation and initialization of the product from the client and thus if new type of product i...

What is going on with customUserNamePasswordValidatorType?

I have been creating a custom username/password validator for a WCF service and ran across the configuration item customUserNamePasswordValidatorType. I've been able to make my code work by following examples, but I just don't understand what is going on. Unfortunately, the MSDN article doesn't provide much detail. This is the sample ...

Do I need to expose a constructor in a WCF DataContract for it to work during object instantiation on the client?

I have a class in a WCF service, lets call it A. A is a data contract, which contains as one of its DataMembers a collection of another custom object B. To avoid Null Reference problems on the client side, I instantiate the BList in the constructor like so: [DataContract] public class A { [DataMember] public String name { get; s...

Adding a collection of objects to Entity Framework

I have a domain collection type called SavedAnswers and would like to add that collection to my Entity Framework type Entries. I've been trying to figure out what I need to do but I'm getting confused on all the information out there. Answers has a Identity Primary Key and two Foreign Keys, which brings more issues/questions. publi...

.NET WCF SVC file downloaded instead of being executed

I am using a WDF Service in my web application which I am accessing very jquery. Locally it works fine, but on my test server (IIS7) it does not. I tried accessing the .svc via the url (www.mydomain.de/Services/MyService.svc) expecting that I get the same page as offline ("This is a WCF service, metadata publishing is disabled ....". I...

WCF and SOAP exception handling policy

Has anyone got a framework that can be used to determine whether specific communication exceptions are connection or timeout errors? I have some central Head-Office systems that communicate with various other systems, some SOAP, some WCF and some TCP Sockets. These all create financial transactions. For each of the above cases I need c...

WCF Transport Security with SSL and Thread information

Hello all, I have a question about the above topic. I have a WCF service and use the Transport security model for it. But there is some mechanism related to the Thread state that I can't understand. In constructor of my service I tried to set the Thread.CurrentPrincipal but at the begin of a called method of my service the Thread.Curren...

Sharing event with WCF Service

Hi All, I would like to share the event 'MyEvent' in the following class: [ServiceContract] public interface MyInterface { [OperationContract] void Start(); event EventHandler<MyEventArgs> MyEvent; } public class MyEventArgs:EventArgs { public string Name{set;get;} } Which Attribut...

Consume a wcf duplex service in console application

I have a wcf duplex service with work fine in silverlight. but the same service I want to consume in windows console application. My code as follow: var context = new InstanceContext(this); var address = new EndpointAddress("http://localhost:31881/PubSubService.svc"); var binding = new CustomBinding( new Pollin...

Windows service stops because of unknown reason

Hi, I have a WCF application which is hosted as a windows service in windows server 2008. But for some unknown reason the service stops sometimes. I checked the eventviewer, i see that an error has occured but its not saying why? It is only saying 'service terminated unexpectedly. It has done this 1 time(s).' Please help. ...

The protocol 'net.tcp' is not supported.

When I try to browse my service.svc file,I keep getting this error. I've enabled tcp in the default website in IIS. The port number 808:* is already there in my IIS bindings Ive installed WAS and support for non http protocols... TcpChannellistener service and tcp port sharing services are running.. But,now why am I unable to browse ...

How to debug WCF Data Service?

Hi, I have created a WCF Data Service and using it in a web application which is the part of same solution. The WCF service holds the reference of another DLL(Utility.dll) which is also part of the same solution. I have added the service reference of the WCF service in the web application. So the structure is Solution | |-...

How to build URL of WCF REST web services

Hi, I am using the new .NET 4 WCF REST web services. In order to link resources, I'd like to put links in my responses. In ASP.NET I can generate URLs from my routing configuration (e.g. UrlHelper.Action(...)) With WCF REST web services I have an ASP.NET routing configuration plus Uri templates: [WebGet(UriTemplate = "{id}")] MyResult ...

Raw socket listening to a REST Channel in Silverlight

I understand how I can use a raw socket to listen to a server application and recieve information but I need an easy to access API and I am very familiar with REST. Is there a way to push (not by using long pooling) data using a WCF service? Here's my idea of how things should happen, at least at the begining: The client accesses a U...

WCF CreateChannel for every method call

In my current web project, we perform a ClientFactory.CreateChannel for every method call to a remote service. Is this really necessary? What is the best practice? ...

IIS 7.5 WCF Version Registered

How do I ensure that WCF 4.0 is the only version of WCF registered within IIS 7.5? ...

Error consuming WCF RestFull POST call, works on W2003 Server / IIS6 but cannot manage to make it work on W2008 IIS7

I have a WCF service that exposes some methods with WebInvoke and POST method, this has been working on a Windows 2003 server machine for some time now, the thing is that I have to migrate the service to a new windows 2008 server machine and this is where I'm getting the issue, I get error 400 Bad Request when I try to call from the clie...

WCF IIS-hosted wsHttpBinding service - svcutil generates proxy with basicHttpBinding!

I consider myself pretty expert at WCF but this has me stumped. I don't know if this is a .NET Framework 4/WCF 4 thing with it's automatic configuration or what but I am getting strange behavior. I basically have a WCF 4 WCF service hosted in IIS project. It all worked and then I went in and switched the config from basicHttpBinding to w...

Why can DateTime.MinValue not be serialized in timezones ahead of UTC?

I am experiencing issues with a WCF REST service. The wire object that I try to return has certain properties not set, resulting in DateTime.MinValue for properties of type DateTime. The service returns an empty document (with HTTP status 200 ???). When I try to call JSON serialization myself, the exception that is thrown is: Seriali...

Procmon notifying "PATH NOT FOUND" for web.config, that too at wrong location in a WCF Service

The environment is windows 2008 R2, X64, .Net 3.5 framework, vmware virtual machine While watching a worker process in ProcMon, I noticed the following error: Date & Time: 10/20/2010 3:21:26 PM Event Class: File System Operation: QueryOpen Result: PATH NOT FOUND Path: D:\Rxxxxxx\Wxx\Pxxx\xxxx.xxxxxx...