473,322 Members | 1,523 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,322 software developers and data experts.

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 "ResultState"
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 "ResultState".

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 4097
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:simpleType name="CountryCode">
<xsd:restriction base="xsd:string">
<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
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...
6
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...
3
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...
0
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...
0
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...
1
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...
1
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...
9
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: ...
3
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.