Sharepoint GetListItems不返回任何行

时间:2012-12-14 09:05:51

标签: java sharepoint soap webservice-client

我有一个jax ws客户端调用GetListItems给定一个列表名称和视图名称,它在我的Windows 7机器上本地工作正常。但是,当我部署到我的Linux服务器时,相同的服务返回零行。没有例外,我已经比较了两台机器的soap请求和它相同的

以前有人遇到过这个问题吗?

1 个答案:

答案 0 :(得分:0)

您是否已使用SharePoint网站进行身份验证?这里有一个关于SharePoint ajax身份验证的优秀文章:https://sharepoint.stackexchange.com/questions/79803/how-to-authenticate-user-in-sharepoint-online-using-javascript

在上一个链接中,以下是验证代码:

var soapDataString = "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \
  <soap:Body> \
    <Login xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
      <username>username</username> \
      <password>password</password> \
    </Login> \
  </soap:Body> \
</soap:Envelope>"

// Call web service
$.ajax({
  url: "http://mywebsitename:2355/_vti_bin/authentication.asmx",
  type: "POST",
  dataType: "xml",
  data: soapDataString,
  success: resultsFeedback,
  contentType: "text/xml; charset=\"utf-8\""
});

function resultsFeedback(xData, status) {
   alert(xData);
   alert(status);
}