3

I have downloaded the C# Rate Service example code from Fed Ex's Developer Resource Center. I edited the code with my test key and password The project builds OK, but it keeps looking for a settings file that doesn't exist in the example code and is not referenced in the documentation.

private static String getProperty(String propertyname) //Sets common properties for testing purposes.
    {
        try
        {
            String filename = "C:\\filepath\\filename.txt";
            if (System.IO.File.Exists(filename))
            {
                System.IO.StreamReader sr = new System.IO.StreamReader(filename);
                do
                {
                    String[] parts = sr.ReadLine().Split(',');
                    if (parts[0].Equals(propertyname) && parts.Length == 2)
                    {
                        return parts[1];
                    }
                }
                while (!sr.EndOfStream);
            }
            Console.WriteLine("Property {0} set to default 'XXX'", propertyname);
            return "XXX";
        }
        catch (Exception e)
        {
            Console.WriteLine("Property {0} set to default 'XXX'", propertyname);
            return "XXX";
        }
    }

I have been trying to guess what the file should look like, without any luck. As nearly as I can tell it should be simple text file. Has anyone else gotten this to work?

I have followed the comments in the code and added my developer key and password, but I get the following response:

Notification no. 0 Severity: ERROR Code: 1000 Message: Authenticatio Source: prof

Bill Harris
  • 106
  • 6

1 Answers1

0

I know how to solve this issue. Just create a file called filename.txt to the given folder that is "C:\filepath\filename.txt"

See FilePath Here

and write your key and password in this file that you got from FedEx for testing purpose. See File Content Here

That's it try again to run your application this time you didn't face file doesn't exist issue.

I hope this will gonna help you...