views:

219

answers:

4

Hi,

I have to pass information from a desktop application to Web application and vice versa.

What are the best practices that are regularly used?

Currrently I'm using Asp.Net and a Winforms.

To pass data to Web Site im creating a (POST) WebRequest and posting an xml to the site.
To pass data to Application im using .Net Remoting from Asp.net
(I'm using Winforms is an adminstration and monitoring application.)

Edit: Lets treat it as a generic web app and winforms.

Also currently both Web app and Winforms are on the same machine.(but can change).

+1  A: 

I am not sure if there is a best practice for what you are trying to accomplish. There might be some security concerns you have to think about when allowing posts to your web application however. It would be very easy for a potential attacker to manipulate the post data and send it to your web application. You should consider using web services or Windows Communication Foundation.

Web Services still do posts/gets to remote sources that could be eavesdropped/tampered. If you need protection send it over a secure channel such as HTTPS.
Michael Shimmins
Er... a Web service /is/ a Web application! Take a look at (say) REST, which uses HTTP POST to get data into an application. While there are security matters to worry about, that's the same between /any/ two applications, Web or not.
Jeremy McGee
+2  A: 

Web Services or Windows Communication Foundation (WCF) would be your best bets for remote interoperability.

On your website, expose some service end points and consume them from your desktop app. Then send messages as you require.

Michael Shimmins
+2  A: 

I'd look hard at the design of the system and consider whether it's necessary to use a Winforms application at all for monitoring and administration. No, really: creating rich Web sites is quite straightforward (if necessary, with technologies like AJAX) and the architecture of the resulting application will be much, much simpler.

And, of course, deployment is then really simple.

Jeremy McGee
Also: bear in mind Remoting is now deprecated, in favour of WCF.
Jeremy McGee
A: 

Register a custom handler like how Real player registers rstp:// or for that matter web browsers register http://

ggonsalv