views:

21

answers:

1

Is it possible to retrieve the URL of a 3rd party webservice calling my controller method? Things like Request.Current.Url refer to my own URL (/someController/someAction/).

The 3rd party webservice is sending HTTP POST data to my /someController/someAction and I wish to send back a HTTP POST message to the caller of the method, the 3rd party webservice, without using

return Content["some response"]

which will force me to exit the method. Since the answer is plain text I would like to send it using HTTP Post.

What I actually try to do is respond to the calling webservice without exiting my method (return Content() will exit) so I can call other methods to process the data send to me by the webservice. I want to first tell the webservice I received their stuff and than process, in this way when a processing error occurs the webservice at least will not resend old data. Is there another way to do this than building your own HTTP post?

+1  A: 

You can rely on Request.UrlReferer, but your idea seems not that good. The best solution would be propably to start new thread for data processing and stick to return Content.

LukLed
Exactly the way I implemented it in the meanwhile :). Marked as final answer. I suspect UrlReferer is no luck by the way when since the service calls the method at once so there is no referer. The URL Referrer returns a value only when the user reaches the current page through a link from the previous page I believe but I did not test it.
bastijn