users@jaxb.java.net

Re: Problems with SAML xsd

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Sun, 31 Jul 2011 10:41:29 +0200

The name attributes of the complexType elements in these xsd files end with
"Type", and that's, by definition of the JAXB 2.0 specification, the name
for the JAXB generated class.

There is no problem with generating an XML file from an AuthnRequestType
object wrapped into a JAXBElement<AuthnRequestType>. All required methods
are in the ObjectFactory. See
http://jaxb.java.net/tutorial/section_4_1-Building-and-Marshalling-an-XML-Document.html#The%20Object%20Factoryfor
details.

-W


On 29 July 2011 15:48, <hi_at_safri.net> wrote:

> Hi,
>
> i am new to jaxb and i am trying to build the java classes for the
> SAML2 schema.
>
> I build the following schemas into subpackages of saml:
>
> http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema
> .xsd
> get saml.core
>
> http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/xenc-schema.xsd
> gets saml.xenc
>
> http://docs.oasis-open.org/security/saml/v2.0/saml-schema-protocol-2.0.
> xsd
> gets saml.protocol
>
> http://docs.oasis-open.org/security/saml/v2.0/saml-schema-assertion-2.0
> .xsd
> gets saml.assertion
>
> But all Classes get named *Type.java instead of the class name they
> should get.
>
> If for example i use saml.protocol.AuthnRequestType (which should be
> AuthnRequest) to generate xml, i get
>
> <authnRequestType ... > ... </authnRequestType>
>
> (yes, with lowercase letter at start) instead of
>
> <AuthnRequest ...> ... </AuthnRequest>
>
> as it should be. the parameters insite the AuthnRequest tag are fine
> though.
>
> Any ideas how i can change this?
>
> Thanx,
> Heiko
>