Watch, Follow, &
Connect with Us
Public Report
Report From: C#Builder/Data Access    [ Add a report in this area ]  
Report #:  62918   Status: Reported
Problem with Web References
Project:  C#Builder Build #:  11.0.2902.10471
Version:    11.1 Submitted By:   Stephen Boyd
Report Type:  Basic functionality failure Date Reported:  6/4/2008 8:29:51 AM
Severity:    Critical / Show Stopper Last Updated: 6/17/2008 12:53:14 PM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
I am attempting to port a C# application from Visual Studio into Delphi for .Net.  This application contains 3 web references.  Two of the web references define the same partial class.

    public partial class WSHeader {

        private bool errorFlagField;

        private string returnMessageField;

        /// <remarks/>
        public bool ErrorFlag {
            get {
                return this.errorFlagField;
            }
            set {
                this.errorFlagField = value;
            }
        }

This causes compile errors:

[Csc Error] Reference.cs(232): The type 'ImagingMyFax.WSHeader' already contains a definition for 'errorFlagField'
[Csc Error] Reference.cs(234): The type 'ImagingMyFax.WSHeader' already contains a definition for 'returnMessageField'
[Csc Error] Reference.cs(237): The type 'ImagingMyFax.WSHeader' already contains a definition for 'ErrorFlag'
[Csc Error] Reference.cs(247): The type 'ImagingMyFax.WSHeader' already contains a definition for 'ReturnMessage'

Of course this all works perfectly in Visual Studio.

Any suggestions????
Steps to Reproduce:
Create a C# application.

Add these two web references:

https://www.protusfax.com/protus/xmlwebservices/xmlsubmitter/messaging.asmx
https://www.protusfax.com/protus/xmlwebservices/archivingfaxes/archiving.asmx

Try to compile the project.
Workarounds
None
Attachment
None
Comments

Stephen Boyd at 6/4/2008 12:32:10 PM -
I think I figured it out.  When Visual Studio creates the Web References, it creates each Web Reference in its own namespace.  For example a Web Reference named webref1 added to a project named myproj would be given a namespace of myproj.webref1.  When Delphi creates the same Web Reference it puts it in the same namespace as the project.  So, the namespace would be just myproj, not myproj.webref1.  Therefore, the duplicate class names cause errors in Delphi, but not Visual Studio.

This is all very odd as Delphi uses the .Net SDK tool disco to create the web reference.  You would think it would be the same as Visual Studio, but it isn't.

Server Response from: ETNACODE01