小编Chr*_*oph的帖子

JAX-WS Sharepoint 401未经授权的NTLM

我试着通过JAX-WS访问SharePoint列表中所描述的在这里

但是,当运行下面的代码时,我得到:

java.lang.Exception: Exception. See stacktrace.com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 401: Unauthorized
Run Code Online (Sandbox Code Playgroud)

Sharepoint需要NTLM身份验证.可能是什么问题?非常感谢!

public static ListsSoap sharePointListsAuth(String userName, String password) throws Exception {
    ListsSoap port = null;
    if (userName != null && password != null) {
        try {
            Lists service = new Lists();
            port = service.getListsSoap();
            System.out.println("Web Service Auth Username: " + userName);
            ((BindingProvider) port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, userName);
            ((BindingProvider) port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
        } catch (Exception e) {
            throw new Exception("Error: " + e.toString());
        }
    } else {
        throw new Exception("Couldn't …
Run Code Online (Sandbox Code Playgroud)

java sharepoint exchange-server ntlm jax-ws

13
推荐指数
1
解决办法
2万
查看次数

标签 统计

exchange-server ×1

java ×1

jax-ws ×1

ntlm ×1

sharepoint ×1