Skip to Content.
Sympa Menu

mace-opensaml-users - Changing namespace declaration

Subject: OpenSAML user discussion

List archive

Changing namespace declaration


Chronological Thread 
  • From:
  • To:
  • Subject: Changing namespace declaration
  • Date: Tue, 20 May 2008 18:27:21 -0400 (EDT)

To enable greater compatibility with some of our existing implementations of
code, I am looking to change the namespace declaration on the marshalled
objects but haven't found a way to do this.

Currently have (for example):
<xacml-context:Request
xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os">

Ideally would like to have:
<Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os">

I have tried to clear the namespaces and add a new namespace with no prefix
as follows...

<code>
RequestTypeImplBuilder xacmlRequest = (RequestTypeImplBuilder)builderFactory
.getBuilder(RequestType.DEFAULT_ELEMENT_NAME);

RequestType request = xacmlRequest.buildObject();
request.getNamespaces().clear();
request.getNamespaces().add(new
Namespace("urn:oasis:names:tc:xacml:2.0:context:schema:os", ""));
</code>

...but I get an java.lang.UnsupportedOperationException thrown on
request.getNamespaces().clear();. I have also tried passing in a new
QName("urn:oasis:names:tc:xacml:2.0:context:schema:os", "Request", "") in
place of the RequestType.DEFAULT_ELEMENT_NAME to the builderFactory but that
has no effect.

Is it possible to do this? I am using opensaml 2.1.0.

Thanks,


Christina

--
Christina Cunningham
Software Engineer
Belfast eScience Centre (BeSC)
Queen's University, Belfast
e: c.cunningham [at] besc.ac.uk
w: www.besc.ac.uk



Archive powered by MHonArc 2.6.16.

Top of Page