473,785 Members | 2,465 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 16097
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'.
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="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'.
Feb 2 '07 #3

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

Similar topics

24
8700
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 follow. Also, it appears to be more compact. Are IDL and WSDL equally powerful in expressing complex data types, and describing inheritance and association relationships? What would be the most compelling reasons to choose one over the other?
1
2199
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 generate anything from these files? It seems like I have to convert one of the files to a wsdl file and then use wsdl.exe?? Thanks for your help! (I wont be back to reed your answer until monday...so no hurry! :-)
0
1953
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 created an ASMX file from this. I've then set the Binding for the class and methods and set the Location to my WSDL file. If I put the wsdl:service element in the WSDL file that points to my endpoint, I can go to Add Web Reference and my methods...
0
1924
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 when trying to 'Add a Web Reference' to the service (implementation) WSDL in VS.Net the message :- 'No Ports or Methods were found on this page' is displayed, and obviously I get no proxy code. If I merge the two WSDLs back together...
0
2132
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 file which contains multiple formats of send and receive mesages. On reading books on webservice it was says to design an interface (ie design the xsd , wsdl, then run wsdl.exe to generate interface.vb class) Since my xsd is very complex if I have...
3
11866
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 the output is class of type SoapHttpClientProtocol and not WebService. It was my understanding that you could create both client proxies and web services from an existing wsdl file? If not, what's another way of creating a .NET web service that...
5
12717
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 into wsdl.exe. Why is this? Is there something I can do to make the input and output wsdl match?
0
3579
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 public RegistrationResponse registerDevice(RegistrationRequest regReq) throws RemoteException
2
4636
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 how I can create this Web Service from the the WSDL file? Any help or info is appreciated. Thanks
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9491
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10357
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10163
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10104
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4063
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.