2

我在通过 REST 在 CRM Dynamics 中进行身份验证时遇到问题。仅当我尝试从具有 CentOS 的机器(在 Ubuntu 和 Windows 中工作)连接时才会出现此问题。

2012-10-31 14:55:00,940 WARNING [org.restlet.engine.security.AuthenticatorUtils] (schedulerFactoryBean_Worker-1) Couldn't find any helper support the HTTP_NTLM challenge scheme.
2012-10-31 14:55:01,005 ERROR [com.zenvia.wrapper.ServiceWrapper] (schedulerFactoryBean_Worker-1) Can't get the metadata for http://<HOST>:5555/zenvia/xrmservices/2011/OrganizationData.svc/ (response's status: Unauthorized (401) - Unauthorized)
2012-10-31 14:55:01,007 INFO  [com.zenvia.wrapper.ServiceWrapper] (schedulerFactoryBean_Worker-1) Get the metadata for http://<HOST>:5555/zenvia/xrmservices/2011/OrganizationData.svc/ at http://<HOST>:5555/zenvia/xrmservices/2011/OrganizationData.svc/$metadata
2012-10-31 14:55:01,010 INFO  [org.restlet.ext.net.HttpClientHelper] (schedulerFactoryBean_Worker-1) Starting the HTTP client
2012-10-31 14:55:01,156 WARNING [org.restlet.engine.security.AuthenticatorUtils] (schedulerFactoryBean_Worker-1) Couldn't find any helper support the HTTP_Negotiate challenge scheme.
2012-10-31 14:55:01,158 WARNING [org.restlet.engine.security.AuthenticatorUtils] (schedulerFactoryBean_Worker-1) Couldn't find any helper support the HTTP_NTLM challenge scheme.
2012-10-31 14:55:01,161 ERROR [com.zenvia.wrapper.ServiceWrapper] (schedulerFactoryBean_Worker-1) Can't get the metadata for http://<HOST>:5555/zenvia/xrmservices/2011/OrganizationData.svc/ (response's status: Unauthorized (401) - Unauthorized)
2012-10-31 14:55:01,163 INFO  [com.zenvia.wrapper.ServiceWrapper] (schedulerFactoryBean_Worker-1) Get the metadata for http://<HOST>:5555/zenvia/xrmservices/2011/OrganizationData.svc/ at http://<HOST>:5555/zenvia/xrmservices/2011/OrganizationData.svc/$metadata
2012-10-31 14:55:01,167 INFO  [org.restlet.ext.net.HttpClientHelper] (schedulerFactoryBean_Worker-1) Starting the HTTP client
2012-10-31 14:55:01,317 WARNING [org.restlet.engine.security.AuthenticatorUtils] (schedulerFactoryBean_Worker-1) Couldn't find any helper support the HTTP_Negotiate challenge scheme.
2012-10-31 14:55:01,319 WARNING [org.restlet.engine.security.AuthenticatorUtils] (schedulerFactoryBean_Worker-1) Couldn't find any helper support the HTTP_NTLM challenge scheme.
2012-10-31 14:55:01,322 ERROR [com.zenvia.wrapper.ServiceWrapper] (schedulerFactoryBean_Worker-1) Can't get the metadata for http://<HOST>:5555/zenvia/xrmservices/2011/OrganizationData.svc/ (response's status: Unauthorized (401) - Unauthorized)
2012-10-31 14:55:01,325 INFO  [com.zenvia.wrapper.ServiceWrapper] (schedulerFactoryBean_Worker-1) Get the metadata for http://<HOST>:5555/zenvia/xrmservices/2011/OrganizationData.svc/ at http://<HOST>:5555/zenvia/xrmservices/2011/OrganizationData.svc/$metadata
2012-10-31 14:55:01,328 INFO  [org.restlet.ext.net.HttpClientHelper] (schedulerFactoryBean_Worker-1) Starting the HTTP client
2012-10-31 14:55:01,512 WARNING [org.restlet.engine.security.AuthenticatorUtils] (schedulerFactoryBean_Worker-1) Couldn't find any helper support the HTTP_Negotiate challenge scheme.
2012-10-31 14:55:01,514 WARNING [org.restlet.engine.security.AuthenticatorUtils] (schedulerFactoryBean_Worker-1) Couldn't find any helper support the HTTP_NTLM challenge scheme.
2012-10-31 14:55:01,517 ERROR [com.zenvia.wrapper.ServiceWrapper] (schedulerFactoryBean_Worker-1) Can't get the metadata for http://<HOST>:5555/zenvia/xrmservices/2011/OrganizationData.svc/ (response's status: Unauthorized (401) - Unauthorized)
2012-10-31 14:55:01,519 WARNING [org.restlet.ext.odata.Query] (schedulerFactoryBean_Worker-1) Can't parse the content of http://<HOST>:5555/zenvia/xrmservices/2011/OrganizationData.svc/zenvia_operacaoSet?$filter=statuscode/Value eq 1 and zenvia_tipoOperacao/Value eq 300000005: java.lang.Exception: Can't execute the query without the service's metadata.

有人知道这些警告(“找不到任何支持 HTTP_Negotiate 质询方案的助手。”和“找不到任何支持 HTTP_NTLM 质询方案的助手。”)?

Client: CentOS 5.6
Client: Windows 7 SP1
Server AD: Windows Server 2008 R2
CRM Dynamics 2011
Restlet 2.1
JBoss 7.1.1
Java SE 6

蒂亚戈·马丁斯

4

1 回答 1

0

您应该使用网络连接器并调用:

// Create your own authenticator
Authenticator a = new Authenticator() {
    public PasswordAuthentication getPasswordAuthentication() {
        return (new PasswordAuthentication("<your account>", "<your password>".toCharArray()));
    }
};

// Sets the default Authenticator
Authenticator.setDefault(a);

此处提供说明: http ://wiki.restlet.org/docs_2.0/13-restlet/27-restlet/46-restlet/112-restlet/364-restlet.html

于 2012-11-27T07:34:26.507 回答