Click here to Skip to main content
15,886,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HI,

I have a method in ASP.net web page,it returns thw string parameter.from the Web service method how can i access that web page method using HTTP request.
Posted
Comments
Rahul Rajat Singh 7-Mar-12 1:19am    
I think you should rethink the design. as this kind of requirement totally nullify the idea of having a web service in the first place.

But i might be wrong. If you could tell me the big picture scenario i.e what you are trying to achieve then perhaps i could think more.
kranthi1988 7-Mar-12 1:59am    
@rahul Actual flow is Request: ClassLibrary ------> Webservice --------> web page responce: webpage------->webservice------->classlibrary in the above flow webservice takes the input from class library and adds data to input and sent it to web page,then web page responds back with respective string value of given amended input to web service,then web service returns it to the class library.
kranthi1988 7-Mar-12 1:53am    
@rahul

Actual flow is

Request: ClassLibrary ------> Webservice --------> web page
responce: webpage------->webservice------->classlibrary

in the above flow webservice takes the input from class library and adds data to input and sent it to web page,then web page responds back with respective string value of given amended input to web service,then web service returns it to the class library.

@rahul

Actual flow is

Request: ClassLibrary ------> Webservice --------> web page
responce: webpage------->webservice------->classlibrary

in the above flow webservice takes the input from class library and adds data to input and sent it to web page,then web page responds back with respective string value of given amended input to web service,then web service returns it to the class library.
 
Share this answer
 
Request: ClassLibrary ------> Webservice --------> web page
responce: webpage------->webservice------->classlibrary

TO Achieve this, I think the best way would be to do a response.redirect to the webpage. Whatever data you want to pass to the web page can be passed in query string if it is small and trivial or it can be put in session variable if the data is long and sensitive.

so the webservice could simply do a response.redirect or server.transfer after putting the required data in querystring or session veriable and the web page can fetch the data on rendering itself.

This way you are also decoupling the webservice and keeping the notion intact. If tomorrow some java or php guy need to use it then he will know that the required data is coming in querystring/session variable.

NOTE: Some of the 3rd party bank payment gateways also use the same trick. they call the web page of our site and specify that the required info can be pulled from querystring/session variable.

Hope I helped.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900