简体   繁体   English

从 Java 应用程序使用 Sharepoint Office 365 Web 服务

[英]Consume Sharepoint Office 365 web services from Java application

I am trying to consume Sharepoint Online Office 365 out-of-the-box web services ( Lists.asmx ) from Java application (from the moment SoapUI 5.3 )我正在尝试从 Java 应用程序(从SoapUI 5.3 )使用 Sharepoint Online Office 365 开箱即用的 Web 服务( Lists.asmx

I tried with all 3 types of authentications ( Basic , NTLM , SPNEGO/Kerberos ) but always get 403 FORBIDDEN error我尝试了所有 3 种类型的身份验证( BasicNTLMSPNEGO/Kerberos ),但总是收到403 FORBIDDEN错误

If I add X-FORMS_BASED_AUTH_ACCEPTED=f header, I get 401 UNAUTHORIZED or empty return stream depending on authentication type如果我添加X-FORMS_BASED_AUTH_ACCEPTED=f标头,我会得到401 UNAUTHORIZED X-FORMS_BASED_AUTH_ACCEPTED=f或空返回流,具体取决于身份验证类型

I've checked SharePoint 2010: consuming web services from NetSuite - 403 Forbidden error and tried to used Authentication.asmx before but always get PasswordNotMatch error, although I am sure password is correct我已经检查过SharePoint 2010:从 NetSuite 使用 Web 服务 - 403 禁止错误并尝试使用Authentication.asmx之前但总是收到PasswordNotMatch错误,尽管我确定密码是正确的

I also checked Authenticating Office 365 SharePoint Online OOTB services , but no luck我还检查了Authenticating Office 365 SharePoint Online OOTB services ,但没有运气

All tests are done in both Windows and Ubuntu environments to avoid NTLM fails when consuming SharePoint web service from Java?所有测试都是在 Windows 和 Ubuntu 环境中完成的,以避免在从 Java 使用 SharePoint Web 服务时 NTLM 失败?

The user I use to connect to Sharepoint Online is OK.我用来连接到 Sharepoint Online 的用户没问题。 It has admin rights and I can connect through a browser without any problem.它具有管理员权限,我可以毫无问题地通过浏览器进行连接。

What do I miss?我想念什么?

Only answer can be given with what you tell us is : You have to look what your service wsdl asking for example: http://www.webservicex.net/globalweather.asmx service located here have contract(wsdl) like that: http://www.webservicex.net/globalweather.asmx?wsdl您告诉我们的唯一答案是:您必须查看您的服务 wsdl 要求的内容,例如: http : //www.webservicex.net/globalweather.asmx位于此处的服务有这样的合同(wsdl): http: //www.webservicex.net/globalweather.asmx?wsdl

Which is don't have any ws-security policy so no authentication required but probably your service wsdl going to have some security requirments and you have to fulfill them.哪个没有任何 ws-security 策略,因此不需要身份验证,但您的服务 wsdl 可能会有一些安全要求,您必须满足它们。

This happened to me trying to make a request to SharePoint web services using Postman.这发生在我尝试使用 Postman 向 SharePoint Web 服务发出请求时。 I was also receiving the forbidden error while I had tested the credentials another way and they were working fine.当我以另一种方式测试凭据并且它们工作正常时,我也收到了禁止的错误。 It turned out it was another parameter that needed to be set but was showing as forbidden.原来这是另一个需要设置但显示为禁止的参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM