I guess that you know in your application when to unmarshal a request, and
when a response. So, I think that you'll have to compile the two schemas
separately, putting the result into different packages. This does not mean
that they can't share things that are indeed identical. But from the schema
snippets I can't really say.
For instance: is getEvnByNumber an XML document tag or an element that's
always contained in some parent?
-W
On Fri, Apr 16, 2010 at 2:14 PM, Nussbaum Daniel, Bedag <
Daniel.Nussbaum_at_bedag.ch> wrote:
> Hi @all
>
> I have following two XSD's:
>
> 1) Request:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="
> http://www.bedag.ch/evn/mofis" targetNamespace="
> http://www.bedag.ch/evn/mofis" elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <xs:element name="getEvnByNumber">.
> .
> .
>
>
> 2) Response:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="
> http://www.bedag.ch/evn/mofis" targetNamespace="
> http://www.bedag.ch/evn/mofis" elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <xs:include schemaLocation="mofis-datentypen.xsd"/>
> <xs:element name="getEvnByNumber">
> .
> .
>
> The element "getEvnByNumber" is defined in two different XSD's, using the
> same Namespace, but having a different structure.
>
> By using binding-files I try to create two different classes
> (GetEvnByNumberRequest and GetEvnByNumberResponse) inside the same package.
>
> Using the maven-jaxb2-plugin I get following error message during code
> generation:
> [ERROR] Error while parsing schema(s).Location [
> file:...../mofis-ws1-getEvnByNumber-request.xsd{60,14}].
> org.xml.sax.SAXParseException: 'getEvnByNumber' is already defined
> at com.sun.xml.xsom.impl.parser
> .ParserContext$1.reportError(ParserContext.java:176)
> at
> com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.reportError(NGCCRuntimeEx.java:170)
> at
> com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.reportError(NGCCRuntimeEx.java:173)
> at com.sun.xml.xsom.impl.parser.NGCCRun
> timeEx.checkDoubleDefError(NGCCRuntimeEx.java:145)
>
>
> Btw, editing the XSD's and defining two different namespaces (or a
> different element name) is not an option, because these files are defined
> on the customer side and they won't change them.
>
> Is there a way to solve this problem?
>
> Regards,
>
> Daniel
>
>