In tMighty Mark,
The following steps 1 - 3 does not have any problem
Step1
-----------------------------
Create the following XML
<root>
<EmpName>Sundar </EmpName>
<EmpAge>25</EmpAge>
<Height>173.5 </Height>
</root>
Step2
-------
.. use the xsd.exe to generate the XSD:
C:\>xsd my.xml
Step3:
--------
my.xsd is generated. It looks like the following
In the step3 i got the following xsd
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="NewDataSet " xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="u rn:schemas-microsoft-com:xml-msdata">
<xs:element name="root">
<xs:complexType >
<xs:sequence>
<xs:element name="EmpName" type="xs:string " minOccurs="0" />
<xs:element name="EmpAge" type="xs:string " minOccurs="0" />
<xs:element name="Height" type="xs:string " minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NewDataSe t" msdata:IsDataSe t="true"
msdata:UseCurre ntLocale="true" >
<xs:complexType >
<xs:choice minOccurs="0" maxOccurs="unbo unded">
<xs:element ref="root" />
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
Step4
-------
Please use the Xsd tool again for the step4 in the following way.
Xsd My.xsd /C
The generated class interface looks like the following
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.507 27.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Xml.Seri alization;
//
// This source code was auto-generated by xsd, Version=2.0.507 27.42.
//
/// <remarks/>
[System.CodeDom. Compiler.Genera tedCodeAttribut e("xsd", "2.0.50727. 42")]
[System.Serializ ableAttribute()]
[System.Diagnost ics.DebuggerSte pThroughAttribu te()]
[System.Componen tModel.Designer CategoryAttribu te("code")]
[System.Xml.Seri alization.XmlTy peAttribute(Ano nymousType=true )]
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="", IsNullable=fals e)]
public partial class root {
private string empNameField;
private string empAgeField;
private string heightField;
/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public string EmpName {
get {
return this.empNameFie ld;
}
set {
this.empNameFie ld = value;
}
}
/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public string EmpAge {
get {
return this.empAgeFiel d;
}
set {
this.empAgeFiel d = value;
}
}
/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public string Height {
get {
return this.heightFiel d;
}
set {
this.heightFiel d = value;
}
}
}
/// <remarks/>
[System.CodeDom. Compiler.Genera tedCodeAttribut e("xsd", "2.0.50727. 42")]
[System.Serializ ableAttribute()]
[System.Diagnost ics.DebuggerSte pThroughAttribu te()]
[System.Componen tModel.Designer CategoryAttribu te("code")]
[System.Xml.Seri alization.XmlTy peAttribute(Ano nymousType=true )]
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="", IsNullable=fals e)]
public partial class NewDataSet {
private root[] itemsField;
/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( "root")]
public root[] Items {
get {
return this.itemsField ;
}
set {
this.itemsField = value;
}
}
}
Please ket me know if this answers your question
--
Thanks & Regards,
Mark Nelson
"Mighty Mark" wrote:
I'd like to generate my WebService interface from an XSD schema. Here's what
I've done:
1. created a XML file
2. use the xsd.exe to generate the XSD:
C:\>xsd my.xml
3. my.xsd is generated
4. try to generate the WebService interface using wsdl.exe:
C:\>wsdl /serverInterface /protocol:SOAP my.xsd
5. An error occurs and no classes are generated (see below) and Interface.cs
is empty.
What have I done wrong? Can wsdl.exe be used to generate the server
interface from xsd files?
======
C:\>wsdl /serverInterface /protocol:SOAP my.xsd
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Warning: This web reference does not conform to WS-I Basic Profile v1.1.
SOAP 1.1 binding was not found: WS-I's Basic Profile 1.1 consists of implemen
ion guidelines that recommend how a set of core Web services specifications s
ld be used together to develop interoperable Web services. For the 1.1 Profil
those specifications are SOAP 1.1, WSDL 1.1, UDDI 2.0, XML 1.0 and XML Schema
For more details on the WS-I Basic Profile v1.1, see the specification
at http://www.ws-i.org/Profiles/BasicProfile-1.1.html.
Warning: no classes were generated.
Warnings were encountered. Review generated source comments for more details.
Writing file 'C:\Interfaces. cs'.