Accessing a secure web service RRS feed

  • Question

  • I'm new in consuming web services and i have to access a state-run web service.
    I was given an app.config file, a certificate file (.cer) and some general instructions.

    • I installed the .cer file using mmc
    • I opened a new project in VC# 2008 express
    • I added the System.Runtime.Serialization and System.ServiceModel
    • I added a service reference to the WSDL link
    • I included app.config file in my project

    so i run the following code.

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsAppl { class Program { static void Main(string[] args) { ConsoleApplication1.SerRef.ServiceClient clientProxy = new ConsoleApplication1.SerRef.ServiceClient(); clientProxy.ClientCredentials.UserName.UserName = "xxxxxx"; clientProxy.ClientCredentials.UserName.Password = "xxxxxxxxx"; clientProxy.Open();            System.Console.WriteLine("init succeeded ");

    ConsoleApplication1.SerRef.eResult r = clientProxy.getResult("xxx"); clientProxy.Close(); } } }


    i get an error on line:

    ConsoleApplication1.SerRef.eResult r = clientProxy.getResult("xxx");

    InnerException: "FailedAuthentication : The security token cannot be authenticated."

    any clues???

    • Edited by niyo0508 Tuesday, August 27, 2013 5:33 AM
    Friday, August 16, 2013 10:22 PM

All replies

  • Hi there,

    did you make any progress on this? I am guessing I work on the same app

    Wednesday, December 4, 2013 10:50 AM