How can I call the WCF service constructor call?

I'm currently trying to enlist support for WCF services for an ASP.NET dev environment, and I believe that I am doing a good job of what puzzles me.

Basically, I have the WCF service installed (let's take the default with the constructor added):

public class MyService : IMyService
{
    public MyService() { /* blah */ }
    public DoWork() { /* blah */ }
}

The interface IMyServicedefines the method DoWork()as [OperationContract]it should be.

So, I have this service referenced in another project (say, [Unit] Test Project) using the Add Service Reference on the VS2010 user interface. This creates a link to MyServiceClient, which provides my WCF service methods, as it should be.

However, when I do this in my test project:

ServiceReference.IMyService service;
service = new ServiceReference.MyServiceClient();

... MyService() , , MyServiceClient, MyService .

? (, , ?).

+5
2

, .

"" - ( ) .DLL. , , ...

+6

- InstanceContextMode PerCall ( ServiceBehavior).

+1

All Articles