Microsoft KB Archive/820123

= BUG: &quot;No Classes Were Generated&quot; Warning Message or &quot;Error When Reading File&quot; Error Message May Occur When an XML Web Services Proxy File Is Created by Using the Web Services Description Language Tool (Wsdl.exe) =

Article ID: 820123

Article Last Modified on 4/25/2007

-

APPLIES TO


 * Microsoft Web Services Enhancements for Microsoft .NET 1.1
 * Microsoft Web Services Enhancements for Microsoft .NET 2.0

-





SYMPTOMS
When 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.



CAUSE
WSDL uses the documentation element 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 &quot;Symptoms&quot; section.



WORKAROUND
To work around this problem, you must contain the documentation elements in annotation elements. To do this, follow these steps:  Open Service1.wsdl.  Locate, and then replace with the following code:   Locate and then replace with the following code:   Service1.wsdl now contains the following code:  <definitions xmlns:http=&quot;http://schemas.xmlsoap.org/wsdl/http/&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; xmlns:s=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:s0=&quot;http://tempuri.org/&quot; xmlns:soapenc=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:tm=&quot;http://microsoft.com/wsdl/mime/textMatching/&quot; xmlns:mime=&quot;http://schemas.xmlsoap.org/wsdl/mime/&quot; targetNamespace=&quot;http://tempuri.org/&quot; xmlns=&quot;http://schemas.xmlsoap.org/wsdl/&quot;> Hello!  <s:element name=&quot;HelloWorld&quot;> <s:complexType /> </s:element> <s:element name=&quot;HelloWorldResponse&quot;> <s:complexType> <s:sequence> <s:element minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot; name=&quot;HelloWorldResult&quot; type=&quot;s:string&quot; /> </s:sequence> </s:complexType> </s:element> </s:schema> <message name=&quot;HelloWorldSoapIn&quot;> <part name=&quot;parameters&quot; element=&quot;s0:HelloWorld&quot; /> <message name=&quot;HelloWorldSoapOut&quot;> <part name=&quot;parameters&quot; element=&quot;s0:HelloWorldResponse&quot; /> <portType name=&quot;Service1Soap&quot;> <operation name=&quot;HelloWorld&quot;> <input message=&quot;s0:HelloWorldSoapIn&quot; /> <output message=&quot;s0:HelloWorldSoapOut&quot; /> </portType> <binding name=&quot;Service1Soap&quot; type=&quot;s0:Service1Soap&quot;> <soap:binding transport=&quot;http://schemas.xmlsoap.org/soap/http&quot; style=&quot;document&quot; /> <operation name=&quot;HelloWorld&quot;> <soap:operation soapAction=&quot;http://tempuri.org/HelloWorld&quot; style=&quot;document&quot; /> <soap:body use=&quot;literal&quot; /> <soap:body use=&quot;literal&quot; /> <service name=&quot;Service1&quot;> <port name=&quot;Service1Soap&quot; binding=&quot;s0:Service1Soap&quot;> <soap:address location=&quot;http://localhost/MyWebService/Service1.asmx&quot; /> </li> From the Microsoft Visual Studio .NET command prompt, change the directory path of the location of Service1.wsdl.</li> Run the following command from the command prompt:

wsdl Service1.wsdl

You may notice a message similar to the following:

Writing file ' \Service1.cs'.

An XML Web services proxy file that is named Service1.cs is created. The placeholder for the location of Service1.wsdl is .</li></ol>

Note These steps are based on the sample from the &quot;More Information&quot; section of this article. Therefore, the code and the file names in the steps may differ from your code and your file names.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

<div class="moreinformation_section">

Steps to Reproduce the Problem
<ol>  Open Notepad and then paste the following WSDL code: <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> <definitions xmlns:http=&quot;http://schemas.xmlsoap.org/wsdl/http/&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; xmlns:s=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:s0=&quot;http://tempuri.org/&quot; xmlns:soapenc=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:tm=&quot;http://microsoft.com/wsdl/mime/textMatching/&quot; xmlns:mime=&quot;http://schemas.xmlsoap.org/wsdl/mime/&quot; targetNamespace=&quot;http://tempuri.org/&quot; xmlns=&quot;http://schemas.xmlsoap.org/wsdl/&quot;> Hello!</B> <s:schema elementFormDefault=&quot;qualified&quot; targetNamespace=&quot;http://tempuri.org/&quot;> <s:element name=&quot;HelloWorld&quot;> <s:complexType /> </s:element> <s:element name=&quot;HelloWorldResponse&quot;> <s:complexType> <s:sequence> <s:element minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot; name=&quot;HelloWorldResult&quot; type=&quot;s:string&quot; /> </s:sequence> </s:complexType> </s:element> </s:schema> <message name=&quot;HelloWorldSoapIn&quot;> <part name=&quot;parameters&quot; element=&quot;s0:HelloWorld&quot; /> <message name=&quot;HelloWorldSoapOut&quot;> <part name=&quot;parameters&quot; element=&quot;s0:HelloWorldResponse&quot; /> <portType name=&quot;Service1Soap&quot;> <operation name=&quot;HelloWorld&quot;> <input message=&quot;s0:HelloWorldSoapIn&quot; /> <output message=&quot;s0:HelloWorldSoapOut&quot; /> </portType> <binding name=&quot;Service1Soap&quot; type=&quot;s0:Service1Soap&quot;> <soap:binding transport=&quot;http://schemas.xmlsoap.org/soap/http&quot; style=&quot;document&quot; /> <operation name=&quot;HelloWorld&quot;> <soap:operation soapAction=&quot;http://tempuri.org/HelloWorld&quot; style=&quot;document&quot; /> <soap:body use=&quot;literal&quot; /> <soap:body use=&quot;literal&quot; /> <service name=&quot;Service1&quot;> <port name=&quot;Service1Soap&quot; binding=&quot;s0:Service1Soap&quot;> <soap:address location=&quot;http://localhost/MyWebService/Service1.asmx&quot; /> </li> Save the file as Service1.wsdl .</li> From the Visual Studio .NET command prompt, change the directory path to the location of Service1.wsdl that you created in step 2.</li> Run the following command from the command prompt:

wsdl Service1.wsdl

You receive the warning message in the &quot;Symptoms&quot; section of this article.</li> Open Service1.wsdl.</li>  Locate and then replace Hello!</B> with the following code: Hello! World</B> </li> Save Service1.wsdl and then run the following command from the command prompt.

wsdl Service1.wsdl

You receive the error message in the &quot;Symptoms&quot; section of this article.</li></ol>

<div class="references_section">