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