472,803 Members | 1,054 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,803 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 16013
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.