title: HTTP/1.1 401 Unauthorized error on calling EWS with GSOAP
body: <p>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.</p>
  
  <pre>
  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  
  </pre>
  
  <p>Below I have given my code snippet.</p>
  
  <pre><code>ExchangeServiceBindingProxy *proxy =  new ExchangeServiceBindingProxy();  
  proxy-&gt;soap_endpoint = "https://xxxx/EWS/exchange.asmx";  
  proxy-&gt;userid = "xxxxx";  
  proxy-&gt;passwd= "xxxxx";  
  proxy-&gt;recv_timeout = 300;  
  proxy-&gt;send_timeout = 300;  
  proxy-&gt;version = ns3__ExchangeVersionType__Exchange2010;  
  soap_ssl_init();  
  if (soap_ssl_client_context(proxy,SOAP_SSL_NO_AUTHENTICATION, NULL, NULL, NULL,NULL,NULL)){ exit(1);}
  </code></pre>
  
  <p>Please suggest anyone what could be the problem.</p>
  
  <p>Thanks.</p>