![]() |
【转帖】problems locking file from web service
problems locking file from web service
the calls to lock a file require a windows handle, however i am trying to lock the file from a web service using the pdmworks api (no front end). i have tried "nothing" and 0 for a handle, but the code hangs at the call when on the server. any help would be appreciated. edmfile = vault.getfilefrompath(path, edmfolder) if edmfile is nothing then log.debug("file not found") return false end if if lockrequest then log.debug("attempting to lock") if not edmfile.islocked then ' lock edmfile.lockfile(edmfolder.id, nothing) else log.debug("file is already locked ... ignoring request") end if else log.debug("attempting to unlock") if edmfile.islocked then ' unlock edmfile.unlockfile(edmfolder.id, nothing) else log.debug("file is not currently locked ... ignoring request") end if end if btw, if i put the following code in a forms project it locks and unlocks fine even without a handle dim vault as iedmvault5 dim edmfolder as iedmfolder5 dim edmfile as iedmfile5 dim lockrequest as boolean = true vault = new edmvault5 vault.login("test", "test", "vault") edmfile = vault.getfilefrompath("c:\vault\arrow.sldprt", edmfolder) if edmfile is nothing then return end if if lockrequest then if not edmfile.islocked then ' lock edmfile.lockfile(edmfolder.id, nothing) end if else if edmfile.islocked then ' unlock edmfile.unlockfile(edmfolder.id, nothing) end if end if in all likelihood your problem has to do with permissions. i spent the better part of a day trying to figure this out with my own web service, and what i ended up doing was creating a new application pool and virtual app for the web service and having the service and pool run under a user account and not the default network service. quick |
所有的时间均为北京时间。 现在的时间是 06:49 AM. |