如何启用文件系统访问Web服务? [英] How to Enable File System Access to Web Service?

查看:186
本文介绍了如何启用文件系统访问Web服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C#/ .Net应用程序,它本质上是一个胖客户端数据收集应用程序。给定一个部件号,它会执行一些数据库查询(对外部Orcale DB),一些Sharepoint查询,还会搜索一些网络驱动器以获取相关信息。现在我正在尝试将其更改为面向服务的体系结构。 Web服务现在驻留在服务器上,当瘦客户端调用时,db查询,sharepoint查询和文件系统查询并返回结果。除文件搜索外,所有这些都很有效。搜索结果是空的,我认为因为Web服务在其自己的小虚拟文件系统中执行,并且无法查看网络驱动器以扫描它需要扫描的文件。

I have a C#/.Net app that is essentially a thick client data collection app. Given a part number, it does some DB queries (to an external Orcale DB), some Sharepoint queries, and also searches some network drives for related info. Now I'm trying to change this to a service-oriented architecture. The web service now resides on a server, and when called by a thin client, does the db queries, sharepoint queries, and file system queries and returns the results. All of this works well except file searches. The searches come up empty, I think because the web service is executing within its own little virtual file system, and cannot look out onto the network drives to scan the files it needs to scan.

有人可以推荐正确的方法来允许对网络驱动器进行受保护的读访问,以便服务可以获取所需的信息吗?我不打算直接向瘦客户端提供这些文件,只是允许服务对我们办公室中的所有网络驱动器进行后端访问。顺便说一下,Web服务托管在IIS 6,Windows Server 2003上。

Can someone recommend the correct way to allow protected read access to the network drives so the service can fetch the info it needs? I'm not looking to serve up these file directly to the thin client, just allow the service to have back-end access to the full array of network drives in our office. By the way the web service is hosted on IIS 6, Windows Server 2003.

推荐答案

取决于用户的Web服务运行为(我不记得IIS6的默认值是什么,但怀疑它本质上是网络服务),如果它们是安全的,它将无法读取网络共享。您最好的办法是为Web服务创建一个域帐户,然后使用Internet信息服务(IIS)管理器将应用程序池配置为以所述用户身份运行(注意:对于IIS 6,您还需要添加用户到LOCAL用户组IIS_WPG)。

Depending on the user the web service is being run as (I can't remember what the default for IIS6 is but suspect it's essentially "NETWORK SERVICE"), it won't be able to read network shares if they're secured. Your best bet is to create a domain account for the web service to run under and use "Internet Information Services (IIS) Manager" to configure the application pool to run as said user (NOTE: For IIS 6 youy'll also need to add the user to the LOCAL user group "IIS_WPG").

一个小注释,你在整个问题中提到网络驱动器;您的服务不会共享任何映射的网络驱动器,因此您需要为其提供完整的UNC路径(即 \\server\share 而不是 m:\ )让它工作。

One small note, you mention "network drives" throughout your question; your service will not share any of your mapped network drives, so you'll need to provide it with full UNC paths (i.e. \\server\share rather than m:\) for it to work.

这篇关于如何启用文件系统访问Web服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆