Architecture challenge - dynamically include virtual directory content

Architecture challenge - dynamically include virtual directory content

Post by Sonn » Sun, 04 Aug 2002 08:29:13



The problem:
I want to assemble the content of several text files into a single web
page.  My database (sql server) will provide the number of files and
their pathnames in the virtual directory.  This would seem easy, but
every solution I've tried fails because of the fact that the files are
on another server.

I am open to any type of architecture that will work (within my
limits), so please reply with any information you can provide, even if
it's just "You idiot. Why are you trying to do that."

The requirements/details:
1. The files reside on a file server that is separate from the iis box
2. I can't install IIS on the file server, so I don't think webmethods
will help.
3. The files are plain text, and cannot be modified.

Stuff I've tried, and why it has failed:

1. Response.WriteFile
this works as long as the virtual dir references the same server... it
doesn't use the proper impersonation when accessing a remote server
and fails when trying to login as the (iisserver)/ASPNET account
"System.IO.IOException: Logon failure: unknown user name or bad
password. "

2. Server.Execute
same problem as 1, but a different error message
"System.Web.HttpException: Error executing child request for
(filename)"

3. Read the file into a string using e.g. FileReader (also tried
FileSystemObject from Interop.Scripting)
These methods try to find the file on my local directory.  I could use
server.mappath, but that would just convert the virtual dir syntax to
smb syntax (which gives me the same access problem, since I can't
access the share as the ASPNET user)

What's not the problem:

If I browse directly to the files I'm trying to read, I can see them
fine!
(i.e. http://mymachine/virtualdir/path/filename.txt)

For every method I've tried, I can get it to work when using a virtual
directory that points to a directory on my local machine.

Info about my setup:

For testing purposes, I granted full access to everyone (security and
sharing) for the shared directory on the fileserver (and all
sub-folders and files).

I also tried granting full write, execute, browse, and read access to
the virtual directory (ie. I created it as an application), but none
of this has helped.  The errors definitely seem to be the result of
the inability of the ASP methods to use the impersonation defined on
the virtual directory.

FYI, I'm running VS.net on XP pro with sp1 of the framework.  I'm
doing all of my testing on my machine, accessing a file server running
Win2kAS (both on the same domain)

Sorry this is so long.
HELP!

-Sonny

 
 
 

Architecture challenge - dynamically include virtual directory content

Post by clinton » Mon, 05 Aug 2002 00:26:17


I'm certain this is possible but could not tell you how but for
the reference that Microsoft calls this 'remoting' which should
give you a good lead...

--
<%= clintonG

        URL http://www.metromilwaukee.com/clintongallagher/


Quote:> The problem:
> I want to assemble the content of several text files into a single web
> page.  My database (sql server) will provide the number of files and
> their pathnames in the virtual directory.  This would seem easy, but
> every solution I've tried fails because of the fact that the files are
> on another server.

> I am open to any type of architecture that will work (within my
> limits), so please reply with any information you can provide, even if
> it's just "You idiot. Why are you trying to do that."

> The requirements/details:
> 1. The files reside on a file server that is separate from the iis box
> 2. I can't install IIS on the file server, so I don't think webmethods
> will help.
> 3. The files are plain text, and cannot be modified.

> Stuff I've tried, and why it has failed:

> 1. Response.WriteFile
> this works as long as the virtual dir references the same server... it
> doesn't use the proper impersonation when accessing a remote server
> and fails when trying to login as the (iisserver)/ASPNET account
> "System.IO.IOException: Logon failure: unknown user name or bad
> password. "

> 2. Server.Execute
> same problem as 1, but a different error message
> "System.Web.HttpException: Error executing child request for
> (filename)"

> 3. Read the file into a string using e.g. FileReader (also tried
> FileSystemObject from Interop.Scripting)
> These methods try to find the file on my local directory.  I could use
> server.mappath, but that would just convert the virtual dir syntax to
> smb syntax (which gives me the same access problem, since I can't
> access the share as the ASPNET user)

> What's not the problem:

> If I browse directly to the files I'm trying to read, I can see them
> fine!
> (i.e. http://mymachine/virtualdir/path/filename.txt)

> For every method I've tried, I can get it to work when using a virtual
> directory that points to a directory on my local machine.

> Info about my setup:

> For testing purposes, I granted full access to everyone (security and
> sharing) for the shared directory on the fileserver (and all
> sub-folders and files).

> I also tried granting full write, execute, browse, and read access to
> the virtual directory (ie. I created it as an application), but none
> of this has helped.  The errors definitely seem to be the result of
> the inability of the ASP methods to use the impersonation defined on
> the virtual directory.

> FYI, I'm running VS.net on XP pro with sp1 of the framework.  I'm
> doing all of my testing on my machine, accessing a file server running
> Win2kAS (both on the same domain)

> Sorry this is so long.
> HELP!

> -Sonny


 
 
 

Architecture challenge - dynamically include virtual directory content

Post by Sonn » Wed, 07 Aug 2002 01:19:58


Thanks for the suggestion.  From my understanding, remoting would
certainly work, but would require me to establish the interaction
between the iis box and the file server.

What I really want to know is: How can I get ASP to use a virtual
directory.  It seems crazy to me that I can access the virtual dir
from the HTML and from #include pre-processing, but the ASP that runs
in the middle can't use it!

Am I encountering the expected behavior for these methods?  Is this
the correct behavior?  If not, is this something that will be amended
in the next service pack/release?

Losing hope...
Sonny


> I'm certain this is possible but could not tell you how but for
> the reference that Microsoft calls this 'remoting' which should
> give you a good lead...

> --
> <%= clintonG

>         URL http://www.metromilwaukee.com/clintongallagher/



> > The problem:
> > I want to assemble the content of several text files into a single web
> > page.  My database (sql server) will provide the number of files and
> > their pathnames in the virtual directory.  This would seem easy, but
> > every solution I've tried fails because of the fact that the files are
> > on another server.

> > I am open to any type of architecture that will work (within my
> > limits), so please reply with any information you can provide, even if
> > it's just "You idiot. Why are you trying to do that."

> > The requirements/details:
> > 1. The files reside on a file server that is separate from the iis box
> > 2. I can't install IIS on the file server, so I don't think webmethods
> > will help.
> > 3. The files are plain text, and cannot be modified.

> > Stuff I've tried, and why it has failed:

> > 1. Response.WriteFile
> > this works as long as the virtual dir references the same server... it
> > doesn't use the proper impersonation when accessing a remote server
> > and fails when trying to login as the (iisserver)/ASPNET account
> > "System.IO.IOException: Logon failure: unknown user name or bad
> > password. "

> > 2. Server.Execute
> > same problem as 1, but a different error message
> > "System.Web.HttpException: Error executing child request for
> > (filename)"

> > 3. Read the file into a string using e.g. FileReader (also tried
> > FileSystemObject from Interop.Scripting)
> > These methods try to find the file on my local directory.  I could use
> > server.mappath, but that would just convert the virtual dir syntax to
> > smb syntax (which gives me the same access problem, since I can't
> > access the share as the ASPNET user)

> > What's not the problem:

> > If I browse directly to the files I'm trying to read, I can see them
> > fine!
> > (i.e. http://mymachine/virtualdir/path/filename.txt)

> > For every method I've tried, I can get it to work when using a virtual
> > directory that points to a directory on my local machine.

> > Info about my setup:

> > For testing purposes, I granted full access to everyone (security and
> > sharing) for the shared directory on the fileserver (and all
> > sub-folders and files).

> > I also tried granting full write, execute, browse, and read access to
> > the virtual directory (ie. I created it as an application), but none
> > of this has helped.  The errors definitely seem to be the result of
> > the inability of the ASP methods to use the impersonation defined on
> > the virtual directory.

> > FYI, I'm running VS.net on XP pro with sp1 of the framework.  I'm
> > doing all of my testing on my machine, accessing a file server running
> > Win2kAS (both on the same domain)

> > Sorry this is so long.
> > HELP!

> > -Sonny

 
 
 

1. include file without <!--#include virtual or <!-- include file?


i got a problem:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Response.Expires = 0

dim subsitedef as string = request.params("subsite")

response.write ("<!-- #include virtual='subsites/" & substedef & "' -->")
'doesn't seem to work?!

End Sub

is there any other way to import a file into a document via VS.NET Code??

thx, chris!

2. Connecting to CISCO PIX VPN from 2000 - S.O.S

3. Displaying virtual directory contents on a Web Page

4. unresolved symbols when using stlport

5. List folders tree including virtual directory

6. Looking for 49 other designers.

7. Session.Contents and virtual directories

8. newbie

9. Virtual Virtual directories

10. Deleting Application Directories Leaves Virtual Directories In-Tact

11. Shared directories vs virtual directories

12. Including control on aspx /virtual path

13. Include virtual in ASPX