Welcome to the Xceed Community | Help
Community Search  

DiskFolder method is not recognizing mapped drive if called from WCF

Sort Posts: Previous Next
  •  09-30-2008, 2:58 AM Post no. 15729

    DiskFolder method is not recognizing mapped drive if called from WCF

    Hi

    Our project is developed using WCF and VS2008. The WCF is hosted as windows service with 'Log on as:' 'Local System Account'.

    The WCF is calling the workflow and it has the code to perform FTP. We are using xceed ftp dlls to perform FTP.

    The FTP code works fine if I specify the target folder as my local folder. But it fails if I specify a mapped drive.

    This problem happens only if I call the method via WCF service and not when I directly run.

    Please find the source code below:

    ---------------------

    ...

    private static FtpClient client = null;

    ...

    private static int PerformFTPDownload(FTPWorkerConfiguration fwc)

    {

    client.ChangeCurrentFolder(fwc.SourceDirectory);

    newFolder = new DiskFolder(fwc.TargetDirectory);

    if (!newFolder.Exists) <--- newFolder.Exists = false for mapped drive and true for local folder)

    }

    ---------------------

    There are no exception thrown but the DiskFolder() method couldn't identify the mapped drive. 

    Let me know if I can provide more details to identify the problem. 

    Thanks in advance

  •  09-30-2008, 11:38 AM Post no. 15750 in reply to 15729

    Re: DiskFolder method is not recognizing mapped drive if called from WCF

    Hi,

    a possible workaround is to ensure that you are giving the nessary permissions to access the mapped drive to the account used by the WCF service. This WCF service might not be running in your authentication context.  

     


    Xceed - Software Developer and Technical Support
  •  10-01-2008, 1:33 AM Post no. 15764 in reply to 15750

    Re: DiskFolder method is not recognizing mapped drive if called from WCF

    Thanks for your reply....

    The thing is I am not pretty sure on giving the permission to the "right account". Following are what I tried.

    1. Hosted the win service with 'Local system account'. This showed 'NT AUTHORITY\SYSTEM' as the user in process monitor (a MS tool).

    2. Hosted the win service with my local system account (a domain id/pwd). This showed my account as the user in process monitor.

    Regarding the authentication context, I am new to this area.... what I observed is, whenever the control gets transferred from client to the service, all the credentials gets lost. All the static values/session values etc are only available for the UI project (i.e., client).

    Do we have some documentation on the method DiskFolder() on how the authentication is read by this method?

    Thanks

  •  10-07-2008, 4:16 PM Post no. 15957 in reply to 15764

    Re: DiskFolder method is not recognizing mapped drive if called from WCF

    Yogeesh:

    Do we have some documentation on the method DiskFolder() on how the authentication is read by this method?

    It does no authentication.  It is the OS that manages these permissions (i.e. setting the application with the right permissions, and making sure it accesses only the permitted resources). 

     


    André
    Software Developer and Tech Support
    Xceed Software Inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.