Windows Services and System.Web.UI.Page.Request  
Author Message
Robertro





PostPosted: Tue Jan 22 12:57:53 CST 2008 Top

Visual C#.Net >> Windows Services and System.Web.UI.Page.Request 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

DotNet104  
 
 
Nicholas





PostPosted: Tue Jan 22 12:57:53 CST 2008 Top

Visual C#.Net >> Windows Services and System.Web.UI.Page.Request 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 Paldino [.NET/C# MVP]
- EMail@HideDomain.com

"pbd22" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> 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


 
 
pbd22





PostPosted: Tue Jan 22 13:23:25 CST 2008 Top

Visual C#.Net >> Windows Services and System.Web.UI.Page.Request 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

 
 
Nicholas





PostPosted: Tue Jan 22 13:39:54 CST 2008 Top

Visual C#.Net >> Windows Services and System.Web.UI.Page.Request 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 Paldino [.NET/C# MVP]
- EMail@HideDomain.com

"pbd22" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> 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
>


 
 
pbd22





PostPosted: Wed Jan 23 09:31:31 CST 2008 Top

Visual C#.Net >> Windows Services and System.Web.UI.Page.Request 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