On 11/22/05, Eran Chinthaka <[EMAIL PROTECTED]> wrote: > Ruchith and all, > > I improved the ADBPullParser to handle what you wanted. Please check my > last commit. > > Please do understand that, ADBPullParser was not meant to be a generic one. > We got some limited set of requirements to implement ADB and implemented > them in ADBPullParser. This "limited" set definitely will not support any > combination, but supports most of the frequently used stuff. > > Anyway, if there is a requirement to implement a new thing, I'm happy to > help.
Thanks a lot ... looking forward to bugging you more ;-), hehe Thanks again, Ruchith > -- Chinthaka > > > Ruchith Fernando wrote: > On 11/22/05, Eran Chinthaka <[EMAIL PROTECTED]> wrote: > > > Until I read the "loooooong" email, > > did u read the javadoc comment, I wrote carefully for the method : > public static XMLStreamReader createPullParser(QName adbBeansQName, > Object[] properties, Object[] attributes) ? > > Yep I did... unfortunately my IDE doesn't render that perticulart > javadoc (wired indentation:-( ) properly... > > > > Ruchith Fernando wrote: > > > > Hi Devs, > > I'm playing with the Axis2 ABD stuff and I hope to use it in > implementing the WS-Trust stuff. > I ran into a couple of issues trying to use ADB. > > 1.) ADB Beans doesn't seem to properly set unqualified attributes > 2.) ADB Beans cannot serialize qualified simple (containing a text > value) child elements. > > Explanation: > > Please have a look at this piece of code [1]. This produced the > following output: > > <wst:RequestSecurityToken > xmlns:wst="http://ws.apache.org/namespaces/axis2/trust" > wst:Context="test"><TokenType>test</TokenType></wst:RequestSecurityToken> > > Here comes the problems :-) > > First I want to make the wst:Context attribute unqualified. Simply > remove the 'wst' prefix. Therefore I tried changing line number 27 as > follows : > > attributes[0] = new String("Context"); > > But this produced the following output which is missing the 'Context' > attribute: > > <wst:RequestSecurityToken > xmlns:wst="http://ws.apache.org/namespaces/axis2/trust"><TokenType>test</TokenType></wst:RequestSecurityToken> > > Q1: Is this behaviour correct? Or am I doing somethign wrong? > > When I tried changing line 27 to: > > attributes[0] = new QName("Context"); > > It produced: > > <wst:RequestSecurityToken > xmlns:wst="http://ws.apache.org/namespaces/axis2/trust" > xmlns="" > Context="test"><TokenType > xmlns="">test</TokenType></wst:RequestSecurityToken> > > but this has xmlns="", which I think should not be there. > > > > Then I wanted to make the 'TokenType' element a qualified element > bound to 'http://ws.apache.org/namespaces/axis2/trust' > namespace. > Since this is a simple element with only a child text node, I changed > line 22 to > > properties.add(new > QName("http://ws.apache.org/namespaces/axis2/trust", > "TokenType", > "wst")); > > It produced: > > <wst:RequestSecurityToken > xmlns:wst="http://ws.apache.org/namespaces/axis2/trust" > xmlns="" > Context="test"><wst:TokenType><bytes > xmlns=""></bytes></wst:TokenType></wst:RequestSecurityToken> > > But here the value of the wst:TokenType element is missing :-( Instead > we have '<bytes xmlns=""></bytes>' > > But ... going through the ADBPullParserTest revealed that our ADB can > hanle setting OMElements... I got the required output by replacing > line 21-23 with > > OMFactory fac = OMAbstractFactory.getOMFactory(); > OMElement elem = fac.createOMElement("TokenType", > "http://ws.apache.org/namespaces/axis2/trust", "wst"); > elem.setText("test"); > > ArrayList properties = new ArrayList(); > properties.add(elem.getQName()); > properties.add(elem); > > This is quite useful but if I wanted to allow an ADBBean to accept an > unknown xml element from a user ... But for this situation, IMHO this > looks like a hack to me. > > Q2: How can I correct this to produce > '<wst:TokenType>test</wst:TokenType>' WITHOUT inserting the > OMElement? > Should I code another ADB Bean for the <wst:TokenType> element and if > so how can I simply set just a text value of that bean? > > Thanks > Ruchith > > [1] http://rafb.net/paste/results/Xp9bVP56.html > > > > > > -- > Ruchith > > > -- Ruchith
