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

Posted on 2006-06-07
Last Modified: 2010-04-16
I am currently working on an automated build of a 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.

Question by:johnfattal
    LVL 14

    Accepted Solution

    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.

    Author Comment

    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?

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now