我开发了一个自定义SharePoint Web服务,并将其部署到/_vti_bin/myservice.asmx。作为“常规”用户,浏览到该ASMX URL工作正常。当我尝试按照从ASP.Net AJAX调用此服务的需要浏览到“/_vti_bin/myservice.asmx/js”时,我得到一个403.如果我浏览它不亚于一个农场管理员(网站集管理员没有“我的工作”,我得到了403.农场管理员作为本地服务器管理员的角色完全可以让它工作。
这是我的网络服务类:
[WebService(Namespace = "http://sharepointservices.genericnamespace.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class ApprovalSvc : System.Web.Services.WebService
{
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Xml)]
public XmlDocument GetInboxItems(string inboxName, string s_Id)
{
// code removed
}
}
这是我的网页部件代码的艺术,我正在连接ASP.Net AJAX的东西:
ScriptManager scriptMgr = new ScriptManager();
string webUrl = SPContext.Current.Web.Url;
ServiceReference srvRef = new ServiceReference(webUrl + "/_vti_bin/ApprovalSvc.asmx");
scriptMgr.Services.Add(srvRef);
this.Controls.Add(scriptMgr);
如果我以服务器场/服务器管理员身份登录,则可以正常运行。否则,没有。 Web服务组件位于GAC&在SafeControls中列出。有什么想法吗?
答案 0 :(得分:0)
很好的老过程监控器来救援。
事实:
解决方案:
由于请求未通过SharePoint发出,并且默认情况下也启用了身份模拟,因此Web应用程序的BIN目录上的默认NTLM权限不够好 - 用户的帐户无法访问BIN目录或其中的DLL。
我们给了NT AUTHORITY \ Authenticated Users Read access(不是Read& Execute,而不是List Folder Contents,只是Read)到文件夹,一切都很顺利。