BUG: "No Classes Were Generated" Warning Message or "Error When Reading File" Error Message May Occur When an XML Web Services Proxy File Is Created by Using the Web Services Description Language Tool (Wsdl.exe) (820123)
The information in this article applies to:
- Microsoft Web Services (included with the .NET Framework 1.1)
- Microsoft Web Services (included with the .NET Framework) 1.0
SYMPTOMSWhen you try to create an XML Web services proxy file for a Web
Services Description Language (WSDL) file by using the Web Services Description Language Tool (Wsdl.exe), you may receive the following warning message or the following error message: Warning: no classes were
generated. Error: Error when reading file
'Service1.wsdl'. - There is an error in XML document (3, 23). -
'Element' is an invalid node type. Line 3, position 23. CAUSEWSDL uses the documentation element (<documentation>) to make human-readable documentation. The
human-readable documentation may include HTML tags. However, when your WSDL file has HTML tags
in documentation elements, and then you try to create an XML Web services
proxy file for your WSDL file by using Wsdl.exe, you may receive the warning message or
the error message in the "Symptoms" section.WORKAROUNDTo work around this problem, you must contain the
documentation elements in annotation elements (<annotation>). To do this, follow these steps: - Open Service1.wsdl.
- Locate, and then replace
<documentation> with the following code: <annotation>
<documentation> - Locate and then replace
</documentation> with the following code: </documentation>
</annotation> - Service1.wsdl now contains the following code:
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<annotation>
<documentation><B>Hello!</B>
</documentation>
</annotation>
<types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="HelloWorld">
<s:complexType />
</s:element>
<s:element name="HelloWorldResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="HelloWorldResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</types>
<message name="HelloWorldSoapIn">
<part name="parameters" element="s0:HelloWorld" />
</message>
<message name="HelloWorldSoapOut">
<part name="parameters" element="s0:HelloWorldResponse" />
</message>
<portType name="Service1Soap">
<operation name="HelloWorld">
<input message="s0:HelloWorldSoapIn" />
<output message="s0:HelloWorldSoapOut" />
</operation>
</portType>
<binding name="Service1Soap" type="s0:Service1Soap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="HelloWorld">
<soap:operation soapAction="http://tempuri.org/HelloWorld" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="Service1">
<port name="Service1Soap" binding="s0:Service1Soap">
<soap:address location="http://localhost/MyWebService/Service1.asmx" />
</port>
</service>
</definitions> - From the Microsoft Visual Studio .NET command prompt, change the
directory path of the location of Service1.wsdl.
- Run the following command from the command
prompt:
You may
notice a message similar to the following:
Writing file
'%File Path%\Service1.cs'.
An XML Web services proxy file that is
named Service1.cs is created. The
placeholder for the location of Service1.wsdl is %File Path%. Note These steps are based on the sample from the "More Information" section of this article. Therefore, the code and the file names in the steps may differ from your code and your file names. STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 6/3/2003 |
---|
Keywords: | kbXML kbSchema kbCommandLine kbProxyDev kbCodeGen kbMiscTools kbDeployment kbConfig kbClient kberrmsg kbWebServices kbCompiler kbbug KB820123 kbAudDeveloper |
---|
|