Re: Accessing server resources from remotable object

From: sprungli (sprungli1_at_netscape.net)
Date: 08/12/04


Date: Thu, 12 Aug 2004 10:19:49 -0400

Thank you Sam,

your reply was helpful. I have been wondering though: if the client, where
the proxy of the remote object executes, happens to have the same file
c:\webapps\clientfiles\MyFile.xml, aren't changes going to be written there
instead of on the server. I ask because I do not have a network where to
test. Also, is there a way to use my host's Server.MapPath() method to get
to the physical path of server files? Or to somehow extract such info from
the web.config? What would you do in my place?

TIA for any suggestions

Best regards.

---
"Sam Santiago" <ssantiago@n0spam-SoftiTechture.com> wrote in message
news:eFzXtMDgEHA.1656@TK2MSFTNGP09.phx.gbl...
> Your remoting host is on the IIS server, so you can have the remote object
> write to a physical path.  Pass the dataset to the remote object and have
> the remote object persist it to a physical directory that is also exposed
as
> a virtual directory.  Your clients can then access the persisted file via
> the virtual directory and http.  For example,
>
> 1)  You have a physical directory on the IIS server,
C:\webapps\clientfiles.
> Give write permission to appropriate identities.
>
> 2) You create a virtual directory named http://MyServer/MyHost/SavedFiles
> that points to C:\webapps\clientfiles
>
> 3) Create a method on your remote object that accepts a dataset as a
> parameter.  Persist the dataset to the directory c:\webapps\clientfiles.
> Use a naming convention specific to each client if you are going to expect
> each client to have a unique file.  Let's say you create the file named
> MyFile.xml.
>
> 4)  You clients can then access the file as
> http://MyServer/MyHost/SavedFiles/MyFile.xml if needed.
>
> Thanks,
>
> Sam
>
> -- 
> _______________________________
> Sam Santiago
> ssantiago@n0spam-SoftiTechture.com
> http://www.SoftiTechture.com
> _______________________________
> "sprungli" <sprungli1@netscape.net> wrote in message
> news:uRvZt1BgEHA.140@TK2MSFTNGP12.phx.gbl...
> > In a remotable class I have to persist the content of a DataSet to a
disk
> > file. The file resides in the remoting host, a web application in IIS.
> > However, the WriteXml method of the DataSet does not support URI
formats,
> so
> > I cannot use something like:
> > ds.WriteXml(@"http://MyServer/MyHost/MyFile.xml",
> XmlWriteMode.WriteSchema).
> > My clients should be able to choose a file to write to only on the
network
> > or the internet, so passing the physical path to the file is not an
> option.
> > How can I write to http://MyServer/MyHost/MyFile.xml from my remotable
> > object?
> >
> > TIA
> >
> >
>
>


Relevant Pages

  • Re: Accessing server resources from remotable object
    ... Your remoting host is on the IIS server, so you can have the remote object ... write to a physical path. ... Your clients can then access the persisted file via ... the virtual directory and http. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Hosting On IIS
    ... > 1) You're mixing two means of activating your object in your client code. ... >> I create a virtual directory named Test and copy these dlls in this ... >> directory to host remote object on IIS. ... >> configuration file for configuration. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Accessing server resources from remotable object
    ... It should return the physical path associated with any virtual directory you ... > the proxy of the remote object executes, happens to have the same file ... >> Use a naming convention specific to each client if you are going to ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Hosting On IIS
    ... Actually this is problem about Remoting. ... Create a virtual directory on IIS. ... In client app, when using Activator.GetObject ... >> directory to host remote object on IIS. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Hosting On IIS
    ... > I create a virtual directory named Test and copy these dlls in this ... > directory to host remote object on IIS. ... > string GetCurrentSong(); ... > namespace RemotingServer ...
    (microsoft.public.dotnet.framework.remoting)

Loading