[OpenSaml] normalize namespace
alessio.lunardelli at iit.cnr.it
alessio.lunardelli at iit.cnr.it
Fri Mar 23 17:09:17 GMT 2012
Thx Brent,
i also tryed somethings with namespacemanager but with no success:
Namespace ns1=new Namespace("testURI","testPrefix");
rt.getNamespaceManager().registerAttributeName(ResponseType.DEFAULT_ELEMENT_NAME);
rt.getNamespaceManager().registerElementName(ResponseType.DEFAULT_ELEMENT_NAME);
rt.getNamespaceManager().registerNamespace(ns1);
rt.getNamespaceManager().registerNamespaceDeclaration(ns1);
nothing happen :)
so you know what? The answer from pdp it's correcly handled by pep, so
give up :)
Thx again for attention.
Il 23.03.2012 17:49 Brent Putman ha scritto:
> If the first example is the way it came back from the PDP, then that
> must be what the PDP emitted, so that's what the parsed DOM looks
> like,
> before you unmarshall using OpenSAML.
>
> OpenSAML should handle them equivalently, in terms of the XMLObject
> tree
> that it builds when it unmarshalls. The only delta would be the
> cached DOM.
>
> Question: why do you think it's necessary to "normalize the
> namespace"? If the recipient is just going to process the response
> as
> the XMLObject tree, then the namespace decl usage really won't
> matter.
>
> But if you really, really wanted to make the response you got from
> the
> PDP look like what you built, you could (I think) just drop the
> cached
> DOM from the XMLObject tree, and then re-marshall it. That's
> inefficient but it's the only obvious easy way. You could also just
> fix
> up the parsed DOM before you unmarshall it, but that then becomes a
> DOM
> API question, not an OpenSAML one.
>
> --Brent
>
>
> On 3/23/12 10:54 AM, alessio.lunardelli at iit.cnr.it wrote:
>> After a lot of trouble i successfully transform a ResponseCtx from
>> SunXAML PDP to org.opensaml.xacml.ctx.ResponseType.
>>
>> But now the situation is:
>> <xacml-context:Response
>>
>> xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os">
>> <Result ResourceId="ID_REID"
>>
>> xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os">
>> <Decision>NotApplicable</Decision>
>> <Status>
>> <StatusCode Value="urn:oasis:names:tc:xacml:1.0:status:ok"/>
>> </Status>
>> </Result>
>> </xacml-context:Response>
>>
>> Is there a way to normalize namespace like:
>> <xacml-context:Response
>>
>> xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os">
>> <xacml-context:Result ResourceId="REID">
>>
>> <xacml-context:Decision>NotApplicable</xacml-context:Decision>
>> <xacml-context:Status>
>> <xacml-context:StatusCode
>> Value="urn:oasis:names:tc:xacml:1.0:status:ok"/>
>> </xacml-context:Status>
>> </xacml-context:Result>
>> </xacml-context:Response>
>>
>> the second one was hand-made by me with:
>> XMLObjectBuilderFactory xmlfac= Configuration.getBuilderFactory();
>> ResponseTypeImplBuilder builder=(ResponseTypeImplBuilder)
>> xmlfac.getBuilder(ResponseType.DEFAULT_ELEMENT_NAME);
>> ResponseType testresponse=builder.buildObject();
>>
>> ResultTypeImplBuilder b1=(ResultTypeImplBuilder)
>> xmlfac.getBuilder(ResultType.DEFAULT_ELEMENT_NAME);
>> ResultType resulttype=b1.buildObject();
>> DecisionTypeImplBuilder b2=(DecisionTypeImplBuilder)
>> xmlfac.getBuilder(DecisionType.DEFAULT_ELEMENT_NAME);
>> DecisionType decisiontype=b2.buildObject();
>> StatusTypeImplBuilder b3=(StatusTypeImplBuilder)
>> xmlfac.getBuilder(StatusType.DEFAULT_ELEMENT_NAME);
>> StatusType statustype=b3.buildObject();
>>
>> StatusCodeTypeImplBuilder b4=(StatusCodeTypeImplBuilder)
>> xmlfac.getBuilder(StatusCodeType.DEFAULT_ELEMENT_NAME);
>> StatusCodeType statuscodetype=b4.buildObject();
>>
>> statuscodetype.setValue(StatusCodeType.SC_OK);
>>
>> statustype.setStatusCode(statuscodetype);
>> decisiontype.setDecision(DECISION.NotApplicable);
>>
>> resulttype.setDecision(decisiontype);
>> resulttype.setStatus(statustype);
>> resulttype.setResourceId("REs IDID");
>>
>>
>> testresponse.setResult(resulttype);
>>
>>
>> Thx in advice at all.
>> Bye,
>> Alessio
>> --
>> To unsubscribe from this list send an email to
>> dev-unsubscribe at shibboleth.net
> --
> To unsubscribe from this list send an email to
> dev-unsubscribe at shibboleth.net
More information about the dev
mailing list