473,385 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

use xsd.exe and wsdl.exe to go from XML to web service interface ?

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'.
Jan 29 '07 #1
2 16061
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="urn: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="NewDataSet" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<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.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System.Xml.Serialization;

//
// This source code was auto-generated by xsd, Version=2.0.50727.42.
//
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xs d", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Xml.Serialization.XmlTypeAttribute(Anonymou sType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespac e="", IsNullable=false)]
public partial class root {

private string empNameField;

private string empAgeField;

private string heightField;

/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string EmpName {
get {
return this.empNameField;
}
set {
this.empNameField = value;
}
}

/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string EmpAge {
get {
return this.empAgeField;
}
set {
this.empAgeField = value;
}
}

/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string Height {
get {
return this.heightField;
}
set {
this.heightField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xs d", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Xml.Serialization.XmlTypeAttribute(Anonymou sType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespac e="", IsNullable=false)]
public partial class NewDataSet {

private root[] itemsField;

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("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'.
Jan 30 '07 #2
Any updates, did you proceed further ?
Please let me know whether my post was useful.
--
Thanks & Regards,
Mark Nelson
"Mark Nelson" wrote:
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="urn: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="NewDataSet" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<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.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System.Xml.Serialization;

//
// This source code was auto-generated by xsd, Version=2.0.50727.42.
//
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xs d", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Xml.Serialization.XmlTypeAttribute(Anonymou sType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespac e="", IsNullable=false)]
public partial class root {

private string empNameField;

private string empAgeField;

private string heightField;

/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string EmpName {
get {
return this.empNameField;
}
set {
this.empNameField = value;
}
}

/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string EmpAge {
get {
return this.empAgeField;
}
set {
this.empAgeField = value;
}
}

/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string Height {
get {
return this.heightField;
}
set {
this.heightField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xs d", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Xml.Serialization.XmlTypeAttribute(Anonymou sType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespac e="", IsNullable=false)]
public partial class NewDataSet {

private root[] itemsField;

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("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'.
Feb 2 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Generic Usenet Account | last post by:
Does anyone have an opinion on how IDL and WSDL compare to each other? Are they equally powerful in their "expressive power"? Sometimes it appears to me that IDL is a little easier for humans to...
1
by: Camilla | last post by:
I'm making one of my first web services (with C#) and need help getting started. I have received an idl file and a sdl file that describes the interface I need to implement... but how do I...
0
by: Dave | last post by:
Hi, If anyone could help with this, I would greatly appreciate it! I've created my own WSDL file and referenced an XSD file too. I've generated a service side interface using wsdl /server, and...
0
by: Fraser | last post by:
In arranging a simple WSDL so that the types, messages, portTypes and bindings are in one WSDL and the service in another in the manner often described as interface and implementation, I find that...
0
by: saish | last post by:
Hello I am new to vb.net webservice. My requirement is to design a VB.net web service which will send and receive xml documents. The xml document send and received would be a very complex .xsd...
3
by: CJF | last post by:
Is there a way to build a web service from an existing wsdl? I do not wish to create a .Net web service client proxy from a wsdl, but an actual web service. I tried using the wsdl.exe utility, but...
5
by: ayaz.usman | last post by:
Hi, I've built a web services proxy server, in C# using wsdl.exe, by importing wsdl. Howeever, when I go to : http://localhost/sample.asmx?wsdl, they wsdl there does not match the wsdl I fed...
0
by: shaily | last post by:
hi I have a java web service called "Registration service" and C# client which is a consumer of that service java web service running under Tomcat has following interface API exposed ...
2
by: BillB | last post by:
Hi, I've got a WSDL file that I need to use to create a Web Service from, I have managed to create the client side of the app using the generated .cs file that WSDL.exe creates. Does anyone know...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.