You are viewing a plain text version of this content. The canonical link for it is here.
Posted to savan-dev@ws.apache.org by Amila Jayasekara <am...@wso2.com> on 2010/07/04 08:37:44 UTC
Issue in wsdl2java ?
Hi All,
I am working on issue, rampart-225. While working on it, I encountered
an unusual structure in messages generated by the client. Later I found
out that this unusual behavior is due to the way wsdl2java generates code.
I have attached the policy which I am using. (policy.xml)
According to attached policy file, my intension is to use asymmetric
binding with a single user name token as a supporting token. But in the
code generated by wsdl2java I found somewhat different policy. The
policy-generated.xml contains the policy text used by generated client.
If you inspect generated policy, you would see that all top level policy
components are duplicated. (See comment <!-- Repeating element –> comment.)
Within Rampart, most of the policy components are initialized using set
methods. Therefore having a duplicate policy component has not much
effect on generated messages. But problem occurs when an user wants to
use supporting tokens, because supporting tokens are added to a list (or
array). Therefore the output message generated by client will have two
supporting tokens with the same structure. But policy defines only one.
The sample1.xml contains a message generated by client. Sample1.xml
contains two user name tokens. But ideally there should only be one user
name token element.
This problem will not surface when I purposefully load a policy and use
it in client code. It seems that the issue lies within wsdl2java tool.
Is this an actual issue or an expected behavior ?
If it is an expected behavior, why we need to have that ?(Something to
do with policy normalization ?)
If this is an expected behavior we definitely have work to do in rampart
end.
Also policy components are not duplicate every time. I couldn't isolate
a specific scenario and also couldn't fathom why it is duplicating for
few cases and not for all.
Appreciate if someone with better knowledge about wsdl2java can give
feedback.
Thank you
Regards,
AmilaJ