Is it possible to call a webservice via a link?
I have a webservice I need to call via a link. The webservice returns a pdf document and takes a document Id as a input parameter.
Under normal circumstances I could have the link call some code 开发者_JAVA百科in the code behind which in turn calls the webservice.
However the difficult part about it is I can't add code to the code behind. The reason is it is for some CMS users who want to know what links to add to the page which will download the pdfs. I can only add the link to the aspx page. Is this at all possible?
Thanks!
While it is possible to call a web service VIA a link (making it difficult to add parameters, though), it sounds like the thing you want to do is a generic handler (in ASP.Net, it is an ASHX file).
Here is a good example of how to use one.
You can do this see: http://msdn.microsoft.com/en-us/library/45fez2a8(VS.80).aspx
There are however limitations on the type of input parameters that you can use. Int and String work OK, your own objects do not work.
精彩评论