Last post May 03, 2012 03:20 PM by ESD
Apr 23, 2012 03:11 PM|ESD|LINK
Is it possible the send a message to a webservice via a link in an email message?
I want to provide a way for user to set a status by simply clicking a link.
I know I can add a hyper-link to a web-page which can then do the work, but this requires the site to open a page which I then force to close.
Any help greatly welcome!
Apr 24, 2012 06:48 AM|Steven Cheng - MSFT|LINK
I think what you want to do can be easily achieved by WCF REST service. By using the web HTTP programming model of WCF, you can build a REST style service which expose some operations that can be called via standard HTTP GET/POST requests.
For your case, you can just define a WCF REST service which expose some HTTP GET based operations. And you can pass any necessary input parameters via URL querystring. for example, to call a REST service operaiton for send an alert, you can just open web
browser and type the following style URL:
http://servername/servicename.svc/SendAlert?msg='some text data'
and you can just embed a hyperlink in your email message which point to the above style service operation URL. Whenever user click the link and the service operation is called.
Here are some reference about WCF REST service programming:
#An Introduction To RESTful Services With WCF
#WCF Web HTTP Programming Model Overview
#WCF REST Service Template 40(CS)
#UriTemplate and UriTemplateTable
BTW, when calling REST service operation via HTTP GET in web browser, it is just the same like what we do to view a web page in web browser(by typing its page url). And if the code logic is not very complex, I even think it is more convenient to build an
ASP.NET httpHandle to do the work (which can also be directly invoked by a hyperlink in email ).
May 03, 2012 03:20 PM|ESD|LINK
thanks much for the kind and useful reply!