Hi All,
this is the code which i am using to call a webservice in ASP.Net, which is working, but the same code is not working when called from C# windows application.
WebService.CustomerService CustObj = new WebService.CustomerService(); //object
NetworkCredential ntkCred = new NetworkCredential(System.Configuration.Configurati onManager.AppSettings["UserName"].ToString(), System.Configuration.ConfigurationManager.AppSetti ngs["PassWord"].ToString());
CredentialCache credCache = new CredentialCache(); //username and pwd from web.config
credCache.Add(new Uri("http://xxx.com

xxx/CustomerService?wsdl=1.1" ), "Basic", ntkCred);
CustObj.Credentials = credCache;
CustObj.GetCustomerDetails("00000000", "", "Username", out objCust); //webservice function
in C# app,, i am unable to assign the credentialcache object to my webservice object like this CustObj.Credentials = credCache; in C#
the intellisence doesn't show the Credential method instead it shows a ClientCredentials property.
and this is the error:
System.ServiceModel.Security.MessageSecurityExcept ion: The HTTP request is unauthorized with client authentication scheme 'Anonymous'.The authentication header received from the server was 'Basic realm="SAP Web Application Server [SAPDS]".--->System.Net .WebException: The remote server returned an error

401)Unauthorized. at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.channels.HttpChannelFactory.Ht tpRequestChannel.HttpChannelReques.WaitForReply(Ti meSpan timeout)
thanks,,