Web Service Response
-
I used to create web methods using the template provided with Visual Studio .NET 2003, all I needed to do is to add the [WebMethod] attribute before the function I want to expose through the web service. But recently I was asked to expose my function to a specific client who is using AJAX and JSP and my return values are required to be sent using the "Response" object! I don't know how to access this object in a web service, unlike web applications, this object is not easily accessible from within the code. In fact I have doubts about the whole approach, is it possible and if possible is it practical to send the results back using the "Response" object? The caller wants the return values to be incorporated into a string that contains JavaScript code they can evaluate and use to display the result on their AJAX enabled JSP page. Any help or ideas about the subject are appreciated. Thank you.
-
I used to create web methods using the template provided with Visual Studio .NET 2003, all I needed to do is to add the [WebMethod] attribute before the function I want to expose through the web service. But recently I was asked to expose my function to a specific client who is using AJAX and JSP and my return values are required to be sent using the "Response" object! I don't know how to access this object in a web service, unlike web applications, this object is not easily accessible from within the code. In fact I have doubts about the whole approach, is it possible and if possible is it practical to send the results back using the "Response" object? The caller wants the return values to be incorporated into a string that contains JavaScript code they can evaluate and use to display the result on their AJAX enabled JSP page. Any help or ideas about the subject are appreciated. Thank you.