views:

104

answers:

1

I had written a Web Service to return a DataSet back to my ASP.Net site and this was working fine. However due to security issues and also the ability to get certain references installed, I have to move this to an App Server and so doing it as a Windows Service and communicating with the ASP.Net site now via sockets.

Is there a way I can easily give the Website a serialized DataSet via Sockets from my App Server so I can read this in and then just carry on using the code I currently have to bind this to a GridView?

+3  A: 

I would use WCF with net.tcp binding. It will be easy to setup, as effeicient as sockets, works well with datasets, and you can implement security in many ways pretty using configuration settings.

** UPDATE ** You app server will be a WCF service, and the ASP.NET code will call it using a proxy (automatically generated)

you define a DataConstract for your data entities, and an operation (Get / Put DataSet)

Checkout this example and it will look clearer:

One of many examples: WCF Articles

Dani
Can you elaborate? You build a windows Service that is WCF compliant?
FinancialRadDeveloper
What I mean is I have to build a Web site, so I cannot use a GUI
FinancialRadDeveloper
There is no gui to the server - it can be either hosted in a console application, or as a service. it runs and the ASP.NET code just calls it when it needs the data
Dani
Hi, thanks for your answer. I don't think this gets around the problem that I have to host the solution from an App Server at work. I cannot have my solution on a web enabled server. So I cannot use any http stuff that the link you have provided in your updated answer. :( Its a work security policy thing etc.
FinancialRadDeveloper
WCF can work without a web server at all. it can use tcp to move data around, and it can encrypt it and do a strong authentication.
Dani
@FinancialRadDeveloper: what @Dani is getting at is that WCF can be "self-hosted". You can host a WCF service in any kind of application. It does not have to be hosted in IIS. Host it in your Windows Service. It can then be very efficient since it can use TCP/IP instead of SOAP and can use binary instead of text-based XML.
John Saunders