users@jaxb.java.net

Re: JAXB, SOAP and attribute namespaces

From: Anthony Chater <achater_at_epo.org>
Date: Wed, 24 Mar 2004 10:06:51 +0100

Hi Kohsuke,
Thanks for your response .

My schema definition looks like this :

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="CASSIUS">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element ref="SYSTEM_ID"/>
                <xsd:element ref="SUB_SYSTEM_ID"/>
                <xsd:element ref="MESSAGE_ID"/>
            </xsd:sequence>
<!-- soap-env: *"##%& namespaces -->
            <xsd:attribute name="mustUnderstand" type="xsd:string" use=
"required" form="qualified"></xsd:attribute>
            <xsd:attribute name="actor" type="xsd:string" use="required"
form="qualified"></xsd:attribute>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="MESSAGE_ID" type="xsd:string"/>
    <xsd:element name="SUB_SYSTEM_ID" type="xsd:string"/>
    <xsd:element name="SYSTEM_ID" type="xsd:string"/>
</xsd:schema>

The fragment of XML which I wish to create looks like this :
<?xml version="1.0" encoding="UTF-8"?>
<!-- Sample Snippet of XML for a standard cassius header. -->
<CASSIUS xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
soap-env:mustUnderstand="1" soap-env:actor="CASSIUS">
        <SYSTEM_ID>NO_SYSTEM</SYSTEM_ID>
        <SUB_SYSTEM_ID>NO_SUB_SYSTEM</SUB_SYSTEM_ID>
        <MESSAGE_ID>NO_MSG</MESSAGE_ID>
</CASSIUS>

I can generate JAXB classes from the schema and create an object.
The problem is that when I marshal it to XML the soap-env namespaces for
the 2 attributes are missing

Anton





Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
19-03-2004 17:29
Please respond to
users_at_jaxb.dev.java.net


To
users_at_jaxb.dev.java.net
cc

Subject
Re: JAXB, SOAP and attribute namespaces







Specifically, what your schema definition for your <SYSTEM_ID> and what
instance you read in, and what instance do you get out from it?

regards,
--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net