Go Back   Velocity Reviews > General Computer Discussion > Software
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
Old 05-09-2008, 02:23 PM   #1
Default Authentication Problem with Webservice


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.comxxx/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 error401)Unauthorized. at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.channels.HttpChannelFactory.Ht tpRequestChannel.HttpChannelReques.WaitForReply(Ti meSpan timeout)

thanks,,


suddu
suddu is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
AAA authentication problem for enable mode access leopard Hardware 1 07-02-2007 08:08 AM
Cisco Aironet LEAP authentication problem Naman Sharma Hardware 0 04-01-2007 12:25 PM
authentication problem (radius /tacacs) hh_forum Software 0 07-07-2006 09:34 AM
Re: Virus Problem ** Help!** David BlandIII A+ Certification 1 03-02-2004 06:00 PM
Re: Serious Computer Problem hootnholler A+ Certification 1 11-24-2003 12:18 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46