简体   繁体   中英

HTTP/1.1 401 Unauthorized error on calling EWS with GSOAP

I created a GSOAP client application in c++ for invoking EWS methods. My EWS is a https URL.I am using correct credentials only but I get the response as follows.

HTTP/1.1 401 Unauthorized  
Cache-Control: private  
Server: Microsoft-IIS/7.5  
X-AspNet-Version: 2.0.50727  
Set-Cookie: exchangecookie=b56b1f57339240a88983be18ce6a50ad; expires=Wed, 30-Jan-2013      10:59:16 GMT; path=/; HttpOnly  
WWW-Authenticate: Negotiate  
WWW-Authenticate: NTLM   
X-Powered-By: ASP.NET  
Date: Mon, 30 Jan 2012 10:59:16 GMT  
Connection: close  
Content-Length: 0

Below I have given my code snippet.

ExchangeServiceBindingProxy *proxy =  new ExchangeServiceBindingProxy();  
proxy->soap_endpoint = "https://xxxx/EWS/exchange.asmx";  
proxy->userid = "xxxxx";  
proxy->passwd= "xxxxx";  
proxy->recv_timeout = 300;  
proxy->send_timeout = 300;  
proxy->version = ns3__ExchangeVersionType__Exchange2010;  
soap_ssl_init();  
if (soap_ssl_client_context(proxy,SOAP_SSL_NO_AUTHENTICATION, NULL, NULL, NULL,NULL,NULL)){ exit(1);}

Please suggest anyone what could be the problem.

Thanks.

使用cc -DWITH_NTLM(或win上的/ DWITH_NTLM)重新编译源代码以启用gSOAP NTLM身份验证协议。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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