wcfservice

Best practice for Service and data contracts - WCF

I understand I can apply several options to the ServiceContract (like Name, Namespace) attribute and for OperationContract (Action, ReplyAction) The same goes to DataContract (Namespace) and DataMember (IsRequired, Name, Order) How do I determine if I need to apply a particular option or not. What is the best practice/convention I shou...

WCF hosted in a Web application and compatibility mode

I have a WCF service hosted in a web application (IIS). I need to expose 1 end point over wsHttp and the other over netTcp. I am on a IIS7 environment that makes it possible for me to host non HTTP based services. Anyways, when I browse the .svc file using a browser, I get the error: The service cannot be activated because it does not s...

WCF Exception Handling Strategies

We are developing a proxy in WCF that will serve as a means of communication for some handhelds running our custom client application. I am curious what error handling strategies people use as I would rather not wrap EVERY proxy call in try/catch. When I develop ASP .NET I dont catch the majority of exceptions, I leverage Application_E...

Is there a difference between WAS and AppFabric

I understand that AppFabric has both caching capabilities along with hosting WCF/WF services. I have seen Windows Activation Service used interchangeably with AppFabric when talking about hosting services on IIS 7.0 Are both one and the same? ...

Default encoding type for wsHttp binding

My understanding was that the default encoding for wsHttp binding is text. However, when I use Fiddler to see the SOAP message, a part of it looks like this: <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecu...

return xdocument from wcf service

How can i return xdocument from wcf service??? what i need to do to let wxf service's method return a object of xdocument? ...

Obtaining the server IP address in WCF?

How can I obtain the server address that was used for a request when it has multiple IP addresses? E.g. the server has the addresses 10.0.0.1 and 10.0.0.2. when processing the request the server service needs to know if 10.0.0.1 or 10.0.0.2 was used by the client to connect to it. So far I only found that OperationContext.Current....

Can a web.config read from an external xml file?

I have to duplicate some settings (like connection string) between a web.config file that a WCF host uses and a web.config file that a web client uses. In the interest of not duplicating, can I have both the web.configs read from a separate xml file? The two web.configs can be entirely in different solutions/projects so I guess this is ...

Can I host both a webservice and a WCF service on the same website in IIS?

I currently have a website where I'm hosting a webservice with several web methods, I need to add some new web methods, but I want to move to the WCF services model rather than continue with asmx. I want to be able to host the WCF service in the same IIS 6 website as the asmx is - is this possible and if so are there any gotchas? ...

Get Number of active service instances?

Hi all, Is there anyway of getting the number of active instance of the service I've tried adding a static int counter in the constructor and this works and implemented Idisposable to decrement the counter on the service but the dispose method only gets called when the service host closes? Is there any native object i can get and see t...

Is there an easyier way to publish silverlight & wcf services from localhost to IIS?

Hello, Is there a simpler way to deploy/publish silverlight & wcf projects from localhost enviroment to a IIS server? I have a web project with a self host wcf service which my silverlight application references. When I work locally I set the reference address to htt://localhost:8080/MyService.svc -and when I want to put it on the IIS...

Long running stateful service in .NET

Hi, I need to create a service in .NET that maintains (inner) state in-memory, spawns multiple threads and is generally long-running. There are a lot options - Good-old Windows Service Windows Communication Services Windows Workflow Foundation I really don't know which to choose. Most of the functionality is in a library used by t...

Wcf IInstanceProvider Behaviour never calling Realease() ?

Hi, I'm implementing my own IInstanceProvider class to override the creation and realease of new service instances but the Release() method never gets called on my implemented class? It's implemented using an IServiceBehavior to attach to the exposed endpoint. No matter how hard we hammer the service the Relaease() method nevers get...

WCF Service Library vs Class Library project types

What does a WCF Service Library do that a regular class library doesn't? Edit: I posted my own answer. Am I missing anything? Are they fundamentally both just class libraries with a few template classes added? ...

405 Method Not Allowed Error in WCF

Can someone spot the problem with this implementation? I can open it up in the browser and it works, but a call from client side (using both jquery and asp.net ajax fails) Service Contract [OperationContract(Name = "GetTestString")] [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json )] string GetTestString(...

Is this the Crudy anti pattern?

Currently I am creating a WCF service which has to connect to a DAL which, just connects to a database using ADO.net and stored procedures. The DAl writes its responses from the database to a datacontract which is passed over the wire to the client via the service. I was reading that this may possibly be the anti pattern 'CRudy Interfa...

WCF: WSDL-first approach: Problems with generating fault types

Hi, I'm currently in the process of creating a WCF webservice which should be compatible with WS-I Basic Profile 1.1. I'm using a wsdl-first approach (actually for the first time), defining first the xsd for the complex types, the WSDL and then using svcutil.exe for generating the according server as well as client-side interfaces/proxi...

WCF without NET 3.0

Hello there, Does anyone tell me if it's possible to use WCF without .NET 3.0? Our company develops a 3-tier client-server end-user solution based on .Remoting. One of the limitation of our project is using .NET 2.0. Unfortunately .NET 3.0 framework is too large to be included in our installation package and I don't know if MS license ...

WCF service issue when client has multilple IP addresses

Hello All, I need some help in resolving an issue I'm facing an with communication of a desktop client with WCF service hosted on IIS. What I'm trying to do in my test case: Server hosts a WSDualHttpBinding service Client establishes a connection (calls Register method) to this by providing its callback uri which contains the client’...

When should I use OperationContextScope inside of a WCF service?

I'm currently working on a WCF service that reaches out to another service to submit information in a few of its operations. The proxy for the second service is generated through the strongly typed ProxyFactory<T> class. I haven't experienced any issues but have heard I should do something like the following when making the call: usin...