all groups > dotnet xml > january 2006 >
You're in the

dotnet xml

group:

Complex Type Collision with XSD.exe


Complex Type Collision with XSD.exe brian.gabriel NO[at]SPAM gmail.com
1/30/2006 10:53:09 AM
dotnet xml: I am having difficulty coming up with an elegant solution to a problem
that I am having. I have a web service that processes different types
of requests and return the appropriate response. Each request and
response type has its own schema, and requests and responses are in
different namespaces.

The problem is that there are several common global complex types among
the requests and responses. For example each response has an
ErrorDetails collection for reporting non-fatal errors, and each
request has a named value pair type called ValuePair. When I generate
the classes for these schemas with XSD and import them, there is a
conflict because there are multiple classes with the same name.

What is the best way to handle this so that I am able to properly
deserialize and serialize the XML documents? I don't want to change
the name of the types in each request, I like having consistency across
schemas. I also don't want to create a new namespace for each
request/response type.

Thanks,

Brian Gabriel
brian.gabriel@gmail.com
Re: Complex Type Collision with XSD.exe Priya Lakshminarayanan
1/30/2006 3:12:26 PM
You should put your common complex types in another XSD (eg:
CommonResponse.xsd) and include this schema in your other schemas.

Thanks,
Priya

[quoted text, click to view]

Re: Complex Type Collision with XSD.exe brian.gabriel NO[at]SPAM gmail.com
1/31/2006 5:55:04 AM
The problem is when I compile those schemas with XSD.exe. I tried
moving the common types to a seperate schema and including it, however
when the classes are generated the common types are included in all
requests.

Thanks,

Brian
AddThis Social Bookmark Button