webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Webservice Authentication problem,,Urgent!!

  • 1.  Webservice Authentication problem,,Urgent!!

    Posted Tue May 13, 2008 11:00 AM

    Hi all,

    i m a newbie on webservices, this is a webservice using “http wsdl” which is a SAP webservice and this is then code that is working fine when called from asp.net, but the same code when used in C# windows application give me unauthorized error.

     WebService.CustomerService CustObj = new WebService.CustomerService();  //object
    NetworkCredential ntkCred = new NetworkCredential(System.Configuration.ConfigurationManager.AppSettings["UserName"].ToString(), System.Configuration.ConfigurationManager.AppSettings["PassWord"].ToString());
    CredentialCache credCache = new CredentialCache();    //username and pwd from web.config
    credCache.Add(new Uri("[URL="http://xxx.com:xxxx/CustomerService?wsdl=1.1"]http://xxx.com:xxxx/CustomerService?wsdl=1.1[/URL]" ), "Basic", ntkCred);
    CustObj.Credentials = credCache;
    
    CustObj.GetCustomerDetails("00000000", "", "Username", out objCust);   //webservice function

    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 i m getting:

     System.ServiceModel.Security.MessageSecurityException: 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.HttpRequestChannel.HttpChannelReques.WaitForReply(TimeSpan timeout)

    thanks,


    #webMethods
    #soa
    #API-Management


  • 2.  RE: Webservice Authentication problem,,Urgent!!

    Posted Tue May 13, 2008 04:58 PM

    How are webMethods products involved in this scenario?

    Mark


    #API-Management
    #webMethods
    #soa