A WebService as a web server?
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.aspnet.webservices.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Erik Cassel (VIP)
I have a rich client app that displays HTML from an ASP.NET server. The
client needs to send fairly complex information to the server in order for
the server to render the page.

Encoding the information into the URL (as request values) would make for
very long and cumbersome request strings.

It seems to me the most elegant and maintainable solution is for the client
to send strongly-typed data to a WebService.

The WebService would:

1)    load/create the Page
2)    Use the data from the client to configure the page
3)    Render the Page
4)    Send the rendered HTML stream back to the client as a return value

I found a great article
(http://aspnet.4guysfromrolla.com/articles/091102-1.aspx) that does this for
Controls (ascx). But I want to render an entire aspx page.

Basically, I’m looking for a WebService that acts as a WebServer!

Is there some other way to do this that I haven’t thought of? I suppose the
client could manually generate an XML representation of the data, encode it
into a custom header, and send it off to the web server. Again, this seems
like re-inventing the wheel.

Any ideas?

Reply to this message...
 
    
Denis Kondratyev
Do u mean "screen scrapping"? U can find good article "Screen Scraping with
C# for ASP.NET" in http://www.codeproject.com/aspnet/weather.asp.

"Erik Cassel" <Click here to reveal e-mail address> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ ×
ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Trebek
You can always try and work something out with the HttpRuntime and
HttpWorkerRequests. This would allow you retrieve the html without having
the dependency of maintaining a separate web service.

Although I've only done this for research purposes, it worked well in
testing I've done.

HTH,

Alex

"Erik Cassel" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Erik Cassel (VIP)
Trebek,

Thanks for your response. However, I think all this lets me do is simulate
IIS and pass a URL and query string on to HttpRuntime. In my case I already
have a full ASP.NET web server running.

Let me explain it this way:

The client is a small C++ WebBrowser app that displays HTML from an ASP.NET
web server.

The C++ app sends data to the web server, and the server returns HTML. In a
traditional web server architecture, the client would send the server a URL
with information encoded in the query string.

In my case, the query string would be potentially >1K of data, and it would
be ugly to parse and maintain.

I was hoping to use an elegant protocol like SOAP (web services) to send the
data and receive the resulting HTML.

-Erik

"Trebek" wrote:

[Original message clipped]

Reply to this message...
 
 
System.Web.HttpRuntime
System.Web.Services.WebService




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com