WCF Service Hosting on client premises - c#

I have to create an application which communicate with DB through WCF Service. WCF service will be hosted on client's server.It will be an intranet environment. I want to use NetTCPBinding to get the performance benefit.
If i use IIS7 to host my service on client's server, then source code is available to client. I don't want to make source available to client.
My question is.
How do I host my service so source code would not available to client?
While we are hosting WCF service in IIS 7 can we provide only WCf service exe? If yes then how Please explain.

Here is quite detailed guide of how to host WCF service in IIS.
No need to put your source code there.

Related

how can i call a method in wcf (hosted as windows service) from c# client?

i have created a wcf service and host it to iis. and finally i access the service methods from the client by adding that service as a reference. this add service reference is already available in .net.
i have hosted a wcf service as windows service. now i have to access that service methods from the client. i dont know how to proceed in this point. please help me to resolve this.
is i need to add the service reference in a client application if the wcf service is hosted as windows service?

Scalable WCF Web Service

I have written a stateless WCF REST Web service. The main consumer of this web service will be a mobile app. There could be 1000's of clients connecting to the web service simultaneously. And this number will increase in the future.
How do I deploy the WCF web service so that it scales nicely. I am guessing the web service will be hosted in multiple servers and a load balancer will distribute the traffic among there servers. Can anyone suggest a load balancer typically used for such a scenario?
Is there any other recommended way to deploy the web service for scalability?
Frankly speaking I haven't tried this... So this only a thought
I would Install Microsoft Azure Service Bus for Windows Server and then connect/setup all available instances of Web Service to the Service bus endpoint.
There is a buildin load balancer.
Pros:
There is a build in Load Balancer, easy.

How to setup WCF proxy relay service

I am writing an ASP.net Dashboard application in C#. The application will collect alarm statistics and display them on the dashboard via Ajax(jQuery).
The application could collect the alarm stats cross domain so we chose to set it up as follows:
A standalone Windows Service runs with a constant connection to the Broker(a program that collects stats). Inside the Windows Service we've hosted a WCF service. The windows service will load pass the string of stats into the WCFExternalService.
We then setup an WCF Service hosted in IIS and referenced inside the Client app( this service will act as a relay/proxy service).
Can someone please point me to an article or explain how to setup the bindings/endpoints to connect the proxy service to the external WCF service?
Thanks in advance for any help on this!
Larry
Looks like you have already got most of the structure going. My inputs below:
The WCF proxy (in UI layer) could implement the same service contract as its WCF service counterpart (in Windows service). However, the WCF proxy would be a 'client' of the real WCF service (you need to configure this in Web.config).
Now, enable the WCF proxy to be consumed by jQuery / JavaScript using WebInvoke attribute. [WebInvoke("GET", WebMessageBodyStyle.WrappedRequest, ResponseFormat:=WebMessageFormat.Json)]
Use jQuery $.ajax syntax to consume your WCF proxy. The url should be an equivalent of 'http://myHost/myVirtual/MyProxy.svc/MyMethod' and the data should be a JSON string equivalent of your WCF proxy parameters.
Further explanation on the first point:
This MSDN article explains how to set up a WCF client (to be consumed by your proxy WCF).
Next, you can create a proxy WCF service to consume the WCF client.
The Web.config of your website (which contains the proxy) needs sections for WCF client and WCF proxy.
Hosting does not matter in WCF, so your 'real' service could support any binding (Http, Tcp) based on your requirements and environment

iPhone communication with Windows C# App

I am create an iPhone app that needs to talk to a Windows C# app. The app will run as either a Service or Form Application.
What would be the best way to accomplish this? Ideally exposing a service-type architecture would be best as I don't need a stateful connection (stateless is fine in this case).
Can a WCF service hosted by my app using a form of TCP binding be consumed by my iPhone? Or can an app host using httpBinding without the aid of IIS or some other web server?
To run WCF on iPhone you need MonoTouch. Currently, which isn't completely implemented.
I don't think it's a good idea.
Web Service are a better idea in my opinion. You can spawn a web service listener from your console/gui/service Windows C# application.
Here's what I ended up doing:
In my .NET windows service, I created WCF service bound using a WebHttpBinding endpoint. Doing so exposed my WCF services as JSON.
From the iPhone, using Objective-C, I used the ASIHTTPRequest and json-framework libraries to talk to and parse the JSON web service exposed by my .net app.
Expose your C# application functionality as a ReSTful web service. More information on exposing WCF service is available here
And there are project templates available for creating REST WCF service. Download the WCF REST starter kit.You can expose your service in XML/JSON format.
Then from your iPhone app, you may consume the web service exposed.

Hosting non web based application in IIS 7

I have heard that you can host non-web based applications in IIS7 similar to windows services. Basically I want a C# app that is just a process running all the time to perform a specific function. I want to create a process that connects to the database at an interval and does some work.
I would like this whole app to be housed inside IIS. Is this possible? Can you provide me with links and resources to get me started?
WCF services can be hosted in IIS. Abstractly, think of them as webservices. Really much more, than that, but it gives you the gist. More information:
How to: Host a WCF Service in IIS
Why we use wcf rather than web services
How To: Hosting a WCF Service in IIS
Take a look at AppFabric it's Microsofts Application Server
http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx
http://www.hanselman.com/blog/InstallingConfiguringAndUsingWindowsServerAppFabricAndTheVelocityMemoryCacheIn10Minutes.aspx

Categories

Resources