• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

Why is the web services proxy generated by wsdl different to that generated by Visual Studio?

I am currently working on an automated build of a c#.net application which uses web services in Visual Studio 2003.
One of the required steps is to update the web references, for which I am using the wsdl tool.
As the web references use a dynamic URL, the following code is generated for the proxy by Visual Studio
 
string urlSetting = System.Configuration.ConfigurationSettings.AppSetting["Key"];
            if ((urlSetting != null)) {
                this.Url = string.Concat(urlSetting, "");
            }
            else {
                this.Url = "http://localhost/service.asmx";
            }

But when generating through wsdl the dynamic setting does not concatenate an empty string to the end of the URL

string urlSetting = System.Configuration.ConfigurationSettings.AppSettings["Key"];
        if ((urlSetting != null)) {
            this.Url = urlSetting;
        }
        else {
            this.Url = "http://localhost/service.asmx";
        }

Can anyone tell me why this is?
It seems pointless but I would like to know what the reasoning behind it is, as ideally the automated build process should not be generating code that differs from a manual build.

I've searched high and low for this, and can't seem to find any clue so I've assigned high points for this.

0
johnfattal
Asked:
johnfattal
1 Solution
 
existenz2Commented:
You are correct, it is pointless. I think it's a flaw MS accidentally left in, since
string.Concat(urlSetting, ""); will act the same as just a normal urlSetting; . Only thing I can think of is that the concatenation will turn a null value into a empty string value, but in my opinion that is totally pointless.
0
 
johnfattalAuthor Commented:
Hmm...
I was under the impression that Visual Studio uses the wsdl.exe tool under the hood.
Any way to find out if this is the case?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now