Webservice Request Problem
I am facing a problem in webservice, I want to know what will be the exact procedure to solve the problem.............
What I want to do............
I have a table named order in SQL Server. There are some fields including OrderID, DomainNameURL, SessionID. I want to create a webservice which takes a parameter(SessionID) and return the details from order table. Here OrderId works as a Unique key. but In some cases when SessionID is not a unique key (Two different domains can have same SessionID) my webservice fails. Now I want to pass the Url (which will be passed implicitly from the site where we will use the webservice) and SessionID(explicitly) in webservice. How can i do that...
Re: Webservice Request Problem
Simply extend the webmethod's function to accept two arguments, one the SessionId and the other, the URL of the calling site. I am not sure if web services can use Referers, but you can try that too...
Try:
Request.UrlReferrer.ToString()
Re: Webservice Request Problem
Thanks Mehandak for considering the problem, but this is not the exact solution. Webservice supports UrlReferrer through Context Objects. But UrlRefferer dose not dispaly anything and throw error.
We can't extend the parameter of Webmethod because dut to this the webservice security has been lost, any one can enter the any site name
Re: Webservice Request Problem
Question:
The web service only returns info from a table to the calling application. How can there be an error in any case, even if two companies have the same SessionId (which in itself is somehow a flaw in your architecture)?
Re: Webservice Request Problem
Hi mendhak, The webservice does not throw any error you are saying right but there may be 50% probability that it will show the wrong result.
Let me explain, If two person Alex and peter has same sessionid and they belong to different company. if alex want to retrieve the records from webservice through Sessionid then there may be 50% possibility of wrong result. It may be possible that webservice retrieve the records of peter......
Thanks for your concern.........
Jitesh