views:

32

answers:

2

Hi, 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 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!

+1  A: 

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.

Gabriel McAdams
+1 for the handler option, it's definitely the way to go. As to the first part, obviously it depends on the web service - try calling a SOAP service via a link and you won't get very far at all ;)
Zhaph - Ben Duguid
Thanks, that seems like a viable option!
Mr Cricket
A: 

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.

Shiraz Bhaiji