Windows Services and System.Web.UI.Page.Request

  • Thread starter Thread starter pbd22
  • Start date Start date
P

pbd22

Hi.

I am wondering how to handle AbsoluteUri values inside windows
services?
It seems that the absoluteuri is called from the System.Web.UI.Page
namespace
which is not allowed inside a windows service (that I am aware of).

But, I need to call the following inside my service:

Request.UserAgent,
Request.UserHostAddress,
Request.Url.AbsoluteUri

Since I can't use the Request object (in the sense of
System.Web.UI.Page),
how do I access the above values from within my service??

Thanks for your help.
Peter
 
Peter,

Why are you trying to access these values inside your service? If you
need to hook into the processing of an ASP.NET page (which these are for),
then you need to have something in the ASP.NET pipeline to perform the
processing.

If you really need to pass these values to a service, then create a
remoting proxy into your service, and make the call from the ASP.NET
pipeline into your service, wait for the results, then continue processing.
 
Nicholas,

Thanks for your hlep. Just to be clear, the
values that I need to pass using System.Web.UI.Page.Request
are being passed "to" a Web Service. It's the login to a
web service:

Login(txtUserName.Text, txtPasswrod.Text, Request.UserHostAddress,
Request.Url.AbsoluteUri, out Id, out data);

Does it still make sense to create and call a remoting
proxy for every web service - related task? Is this the only
way I can do this?

Peter
 
Peter,

Yes, it is. The web service on the other side can't look into your
calling process and peek at the Request. You have to pass those values
manually.
 
Nicholas,

OK, thanks.
I solved this by "fudging" the Request values and passing
hard-coded strings for each value.

Thanks for the response - I learned a bit about the remoting
proxy approach (which I am sure will come in handy at some
point).

Thanks again,
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top