473,563 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xsd.exe generating multiple enums for simple type of included schema file

Hi,

I'm just discovering the power of xsd.exe, so maybe I'm doing
something wrong.
>From an external provider of a web service I received several xsd
schema files describing requests and responses. So there is an extra
xsd file for each response and each request as well as some base
schemas, i.e. defining a data type for a result element. Among others
this result element contains a simple enumeration type "ResultStat e"
which can either be "OK" or "FAILED".

If I use xsd.exe to generate .cs files from the xsd files definining
the complex elements for the requests and responses and then combine
these files in an assembly I get a build error:

The namespace 'SomeNS' already contains a definition for
'ResultState'

I get this error multiple times as each of the response schemas
references the schema containing the definition of the Result element
which contains the simple datatype "ResultStat e".

I could edit all the generated .cs files and remove all but one of the
ResultState enum decl's. But I will receive every now and then an
update of the schema files as this system is still in development.

Can anybody enligthen me if I'm doing something wrong? Please note
that I have no control over the xsd schema files. I get these from the
provider of the web service. I can't generate a .cs file for the
schema defining the result element, as this schema contains no top
level element.

Thanks in advance for taking time,
Stefan

Mar 15 '07 #1
2 4115
After doing some more research in the NG's I found some references to:

- xsd.exe: seems to have it's limitations

- XSDObjectGen: tool from some guy's from microsoft. Not tested as It
requires old .NET frame work and I don't want to mess around on my dev
machine. Maybe I can test it on an older notebook...

- Dingo: tested; resolves the problem by generating only one object
for the base types of my schemas. But generates wrong code for numeric
enums. I need to do some more testing here. Also regarding
compatibility in serializing and deserializing the top level objects I
need for sending/receiving parameters to the web service.

Something I wonder is why there is more than one tool from MS. Instead
of bundling their know how and activities and develop one good tool
they seem to waste their time and effort to produce multiple tools
that have some drawbacks...

Stefan
Mar 16 '07 #2
Found another limitation of Dingo:

It cannot handle simple types that are restrictions, i.e. no code is
generated for

<xsd:simpleTy pe name="CountryCo de">
<xsd:restrictio n base="xsd:strin g">
<xsd:length value="2"/>
</xsd:restriction >
</xsd:simpleType>

Mar 16 '07 #3

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

Similar topics

1
2219
by: Steve George | last post by:
Hi, I have a scenario where I have a master schema that defines a number of complex and simple types. I then have a number of other schemas (with different namespaces) where I would like to reuse some of these master complex and simple types. This I believe will assist me in transforming between the master schema and the other smaller schemas...
6
2473
by: Stephen Cook | last post by:
Having worked through the problems around enabling the document function using an XmlUrlResolver I started work on building a useful class to hide the intricacies. Trying to generalise the process I've hit a snag. How do I resolve multiple external references? The transform method on a stylesheet only takes one resolver, not an array ...
3
4730
by: Edward Clements | last post by:
I'm looking for a good tool to generate C# classes (from XSD-schemas) to (de-)serialize XML corresponding to those schemas. XSDObjectGen almost meets these requirements -- only, I need to generate a ..cs file for each common .xsd file that is included (xsd:include) -- there are a lot schemas which include several common .xsd files (full...
0
1150
by: RJN | last post by:
Hi My web service receives an object of type say MyObject. I want to serialize this object,and then validate the xml against the main xsd. When validation happens, it should also validate against the included schema. The main schema includes one more schema and the actual types are described in the included schema.
0
1116
by: RJN | last post by:
hi My web service receives an object of type say MyObject. I want to serialize this object,and then validate the xml against the main xsd. When validation happens, it should also validate against the included schema. The main schema includes one more schema and the actual types are described in the included schema.
1
2847
by: louis_la_brocante | last post by:
Dear all, I am having trouble generating a client proxy for a webservice whose methods return a "complex" type. The type is complex in that it is a class whose members are a mix of primitive types and of more elaborate classes implementing IXmlSerializable. The resulting WSDL file for the webservice has two separate schemas in its <types>...
1
376
by: Chris Lieb | last post by:
I am new to XML Schema and am running into a bit of a snag. I have defined an XML-based scripting language for an updater program that I am working on. I would like to make a schema for this language since malformed XML documents break the updater. (I did not have time to add good error-handling code, so run-time errors can abound if the...
9
11920
by: Cesar | last post by:
Hello there, A java programmer sent me a wsdl file, which I have to use to consume his web methods. When I run the wsld.exe tool to generate the class' code, I get the following message: CODEGEN: The operation binding 'getAvaluos' from namespace 'urn:m15.AvaluosPortType' was ignored. The combination of style=rpc with use=literal is not...
3
2114
by: Jens Müller | last post by:
I have a file here with several enums: #ifndef PLANARSEP_OPTIMIZE_H #define PLANARSEP_OPTIMIZE_H enum fund_cycle_behavior_t {PASS_MODE_FIRST, PASS_MODE_BEST, PASS_MODE_ALL};
0
7658
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...
0
7877
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. ...
0
8101
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...
1
7631
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...
0
5204
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3615
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2077
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
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
912
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...

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.