Hi Christian,
This is the code snippet I committed. My logic is I
first try with the Final ""http://www.w3.org/2005/08/addressing"
namespace and if that doesn't succeed, I am trying with the Submission
""http://schemas.xmlsoap.org/ws/2004/08/addressing" namespace.
// Extract Issuer
OMElement issuerElem =
element.getFirstChildWithName(SP11Constants.ISSUER);
if(issuerElem != null) {
OMElement issuerEpr = issuerElem.getFirstChildWithName(new
QName(AddressingConstants.Final.WSA_NAMESPACE,"Address"));
//try the other addressing namespace
if (issuerEpr == null) {
issuerEpr = issuerElem.getFirstChildWithName(new
QName(AddressingConstants.Submission.WSA_NAMESPACE,"Address"));
}
issuedToken.setIssuerEpr(issuerEpr);
}
//TODO check why this returns an Address element
//iter = issuerElem.getChildrenWithLocalName("Metadata");
if (issuerElem != null ) {
OMElement issuerMex = issuerElem.getFirstChildWithName(new
QName(AddressingConstants.Final.WSA_NAMESPACE,"Metadata"));
//try the other addressing namespace
if (issuerMex == null) {
issuerMex = issuerElem.getFirstChildWithName(new
QName(AddressingConstants.Submission.WSA_NAMESPACE,"Metadata"));
}
issuedToken.setIssuerMex(issuerMex);
}
thanks,
/nandana
On Wed, Mar 5, 2008 at 1:09 PM, Christian Mielke <[EMAIL PROTECTED]> wrote:
> Hello Nandana!
>
> I saw that you fixed it but in your fix you use the Submission-Version for
> the namespace. This is the namespace with 2004 inside it. But I think it has
> to be the final version with 2005 inside the namespace. Or is this wrong?
>
> You have:
> OMElement issuerEpr = issuerElem.getFirstChildWithName(new
> QName(AddressingConstants.Submission.WSA_NAMESPACE,"Address"));
>
> I would fix it to:
> OMElement issuerEpr = issuerElem.getFirstChildWithName(new
> QName(AddressingConstants.Final.WSA_NAMESPACE,AddressingConstants.EPR_ADDRESS));
>
> When getting the Metadata-element inside the same method in the class
> IssuedTokenBuilder, you also use th final version of WS-Addressing.
>
> Normally you can use both versions inside the policy but I think it would be
> the best to be consequent and use ONE version for both: Getting the Metadata
> and getting the Address-EPR. Mixing two namespaces is not so good.
>
> Greetings
> Chris
> ----- original Nachricht --------
>
> Betreff: Re: Invalid Issuer Address SOLVED!!!!!!!!!!!!!!!!!!
> Gesendet: Mi, 05. Mär 2008
> Von: Nandana Mihindukulasooriya<[EMAIL PROTECTED]>
>
>
>
> > Hi Christian,
> > Thanks for pointing that out. I will fix it and commit it now.
> >
> > thanks,
> > /nandana
> >
> > On Tue, Mar 4, 2008 at 9:31 PM, Christian Mielke <[EMAIL PROTECTED]> wrote:
> > > Ok I found the problem:
> > >
> > > In the current version of RAMPART in the class IssuedTokenBuilder.java
> in
> > the method build() it is looked for the "Address"-element as following:
> > >
> > > OMElement issuerEpr = issuerElem.getFirstChildWithName(new
> > QName("Address"));
> > >
> > > This returns always NULL for "issuerEpr". I changed it to this:
> > >
> > > OMElement issuerEpr = issuerElem.getFirstChildWithName(new
> > QName("http://www.w3.org/2005/08/addressing","Address"));
> > >
> > > When adding the namespace to the QName-constructor, the
> > "Address"-elements gets found and so "issuerEpr" is not NULL.
> > >
> > > Greetings
> > > Christian
> > >
> > > ----- original Nachricht --------
> > >
> > > Betreff: Invalid Issuer Address
> > > Gesendet: Di, 04. Mär 2008
> > > Von: Christian Mielke<[EMAIL PROTECTED]>
> > >
> > > > Hi,
> > > >
> > > > when calling a service with the policy, attached to this mail as file,
> > the
> > > > class RampartUtil.java throws a RampartException in the method
> > > > processIssuerAddress().
> > > >
> > > > I am using the latest Rampart version of the trunk. When I use a
> backup
> > of
> > > > Ramaprt, which is nearly one week old, everything works fine.
> > > >
> > > > The problem seems to be that the paramter "issuerEpr" in the instance
> > of the
> > > > class IssuedToken is NULL. It seems for me that the current Rampart
> > version
> > > > has a problem to find the Issuer-Address-Element inside the policy ?!?
> > > >
> > > > Now I am using something like this:
> > > >
> > > > <issuer>
> > > > <address>http://....</address>
> > > > </issuer>
> > > >
> > > > You can see this when looking at the attached policy. Must I change
> > > > something inside the policy at this position?
> > > >
> > > > Greetings
> > > > Christian
> > > >
> > > >
> > >
> > > --- original Nachricht Ende ----
> > >
> > >
> >
>
> --- original Nachricht Ende ----
>
>
--
Nandana Mihindukulasooriya
Software Engineer
WSO2 inc.
http://nandana83.blogspot.com/
http://nandanasm.wordpress.com/