Op Sep 30, 2014, om 1:36 AM heeft Hiranya Jayathilaka <[email protected]> 
het volgende geschreven:
> This is most likely a bug in Axis2, Rampart or Neethi. A similar issue has 
> been discussed at [1]. Chances are this is fixed on the latest trunk. May be 
> somebody who understands Rampart/Neethi frameworks better than me can suggest 
> a workaround for Synapse 2.1.
> 
> Thanks,
> Hiranya
> 
> [1] - 
> http://axis2.867.x6.nabble.com/Policy-not-supported-is-it-a-bug-td4340911.html
> 
> On Sep 29, 2014, at 6:43 AM, Sean McEligot <[email protected]> wrote:
> 
>> Sorry, to cross post, but I didn't get a response on stackoverflow and
>> don't know the best place to get synpase questions answered. Please
>> let me know if any additional information would help.
>> 
>> http://stackoverflow.com/questions/26059411/synapse-transporttoken-is-not-a-wsppolicy-element
>> 
>> I'm upgrading a project from synapse 1.1.1 to synapse 2.1. I get the
>> following error if I remove TransportToken, the next element will give
>> the same "is not a Policy element" error. I need a custom password
>> callback in order to authenticate the user from the database.
>> 
>> 13:05:26 | java.lang.IllegalArgumentException:
>> {http://schemas.xmlsoap.org/ws/2005/07/securitypolicy}TransportToken
>> is not a <wsp:Policy> element.
>> 13:05:26 |     at
>> org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:177)
>> 13:05:26 |     at ...

The Neethi class StaxToOMConverter uses the OMXMLBuilderFactory to create an 
OMElement. The OMXMLBuilderFactory uses a StAXOMBuilder to create the OMElement 
based on the supplied XMLStreamReader but ignores the current state of the 
reader (which is START_ELEMENT). Due to this behavior only the child elements 
of TransportToken are created instead of TransportToken and it's child elements.

We had to patch the StaxToOMConverter class in order to use Rampart in Synapse 
2.1.

Auke

Reply via email to