Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET HTTP WebService
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 6-Mar-12 20:14pm
Comments
Rahul Rajat Singh at 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 at 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 at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

@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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 400
1 Sergey Alexandrovich Kryukov 329
2 Afzaal Ahmad Zeeshan 264
3 BillWoodruff 245
4 CPallini 195
0 OriginalGriff 5,560
1 DamithSL 4,476
2 Maciej Los 3,942
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 29 May 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100