Skip to Content.
Sympa Menu

mace-opensaml-users - Re: [OpenSAML] Changing namespace declaration

Subject: OpenSAML user discussion

List archive

Re: [OpenSAML] Changing namespace declaration


Chronological Thread 
  • From: Christina Cunningham <>
  • To:
  • Subject: Re: [OpenSAML] Changing namespace declaration
  • Date: Mon, 26 May 2008 11:13:15 +0100

Ok, thanks. Yes, I know that the other implementation we are using has issues, but thought I might be able to get around them this way.

Chad La Joie wrote:
No, I don't think it is possible. Also, if this matters to the code you're working with than that code has a horribly broken XML Namespace implementation. Knowing that probably doesn't help you, but you may want to keep an eye out for other issues as you go forward.


wrote:
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


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




Archive powered by MHonArc 2.6.16.

Top of Page