几何尺寸与公差论坛

 找回密码
 注册
查看: 600|回复: 0

【转帖】problems locking file from web service

[复制链接]
发表于 2009-4-12 22:06:55 | 显示全部楼层 |阅读模式
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
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 18:48 , Processed in 0.035437 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表