Just to test the case i have tried the following using a Console Application as a test project:
public static string GenerateUrl(string webserviceId, string webmethodId, string versionId)
{
return @"C:\" + webserviceId + @"\" + webmethodId + @"\Versions\V" + versionId + ".txt";
}
And called it a couple times as follows:
Console.WriteLine(GenerateUrl("ws", "wm", "1"));
Console.WriteLine(GenerateUrl("ws", "wm", "2"));
Console.WriteLine(GenerateUrl("ws", "wm", "3"));
As expected the results (copied from console output) are:
C:\ws\wm\Versions\V1.txt
C:\ws\wm\Versions\V2.txt
C:\ws\wm\Versions\V3.txt
In this case my final thought is the method GenerateUrl()
works fine, there must be a problem the way it is being called. To see that i suggest you place a breakpoint and check for the arguments (watch) webserviceId
and webmethodId
each time method is called. You will probably see the values as string.Empty
or ""
. Before executing return
statement you can manipulate the value for versionId
argument, set it to 1
and see if it's going to break