473,836 Members | 1,372 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 4131
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
2239
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 that contain a subset of the elements in the master schema. I understand that I can import an...
6
2496
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 Stephen
3
4746
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 schema at http://www.witsml.org/schemas/WITSML120_2003-01-30.zip). The "/s" switch would have beein...
0
1168
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
1131
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
2865
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> sections, and the client proxy (generated with wsdl.exe) is missing the definitions of the...
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 document is malformed.) A sample doc might look something like this: <manifest>
9
11941
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 supported.
3
2151
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
9825
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
9673
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
9388
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...
0
6984
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5829
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4463
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
2
4023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
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.