Microsoft .NET WSDL and XML parsers still have many bugs. Some of them prevent seamless usage of classes generated from VZA.wsdl.
After you add and try to compile the Web Reference from http://www.swsoft.com/webservices/vza/4.0.0/VZA.wsdl
, you'll see the following compilation errors:
Keyword does not name a type.
Reference to a non-shared member requires an object reference.
The first error is caused by name conflicts between the user-defined identifiers and VB keywords. Usually parsers enclose the identifiers that are identical to VB keywords in square brackets. Note, however, that this does not work for words like new
, which are encountered in WSDL and XSDs.
In our case, there are problems with the get
, stop
, set
, and select
function names. To solve them, simply double click on each error line in the Task list and enclose the respective words in square brackets.
The second error is related to the case-insensitive nature of VB -- it confuses the system
field name in the Agent cpu_loadType
class with its own System
module. To fix this problem, change the line
<System.Xml.Serialization.XmlIgnoreAttribute()>
to
<Xml.Serialization.XmlIgnoreAttribute()>
Now you should have the code that compiles and works.
The first group of these problems does not exist in the Visual Studio 2005, but you still have to delete System
from Xml.Serialization.XmlIgnoreAttribute()
manually.