axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaime Hablutzel Egoavil <hablutz...@gmail.com>
Subject Re: Policy not supported: is it a bug ?
Date Mon, 09 Apr 2012 22:10:19 GMT
I had a similar problem to this... but this was happening in axis2 1.4 and
it got fixed in newer versions... your problem seems to be different..
altought UsernameToken is well supported... I'm not sure about your
problem, but I suggest you a couple of things, first try stepping with a
debugger through

org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:177)

download the source for that (if using maven that is really easy) and check
around, check well the versions for libraries you are using... specially
neethi version for your axis2 version.

Another suggestion would be to download the last development version of
axis from their subversion trunk and try using that... it is packaged with
maven so if you know maven you won't have too much problems.

GOod luck


On Mon, Apr 9, 2012 at 4:53 PM, Gordon2 <gordon_dakin2@yahoo.com> wrote:

> Yes, it's on the client side generated using Dennis Sosnoski's
> library-granular.wsdl.  It generates and compiles ok, but the client java
> code hits this exception in neethi:
>
>     [java] Connecting to
> http://localhost:8080/axis2/services/library-granular
>     [java] Exception in thread "main" java.lang.IllegalArgumentException:
> {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200
> 702}UsernameToken is not a <wsp:Policy> element.
>     [java]     at
> org.apache.neethi.PolicyBuilder.getPolicyOperator(PolicyBuilder.java:177)
>     [java]     at
> org.apache.neethi.PolicyBuilder.getPolicy(PolicyBuilder.java:125)
>     [java]     at
> org.apache.neethi.PolicyEngine.getPolicy(PolicyEngine.java:102)
>
> Here's the security policy from the wsdl:
>
> <wsp:Policy wsu:Id="UsernameTokenHashPassword" xmlns:wsu=
>
> "
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
> "
>      xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
>    <wsp:ExactlyOne>
>      <wsp:All>
>        <sp:SupportingTokens
>
> xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
>          <wsp:Policy>
>            <sp:UsernameToken sp:IncludeToken=
>
> "
> http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient
> ">
>              <wsp:Policy>
>                <sp:HashPassword/>
>              </wsp:Policy>
>            </sp:UsernameToken>
>          </wsp:Policy>
>        </sp:SupportingTokens>
>      </wsp:All>
>    </wsp:ExactlyOne>
>  </wsp:Policy>
>
> and the binding operation referencing the policy:
>
>    <wsdl:operation name="getBook">
>      <wsp:PolicyReference
> xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
>          URI="#UsernameTokenHashPassword"/>
>      <wsdlsoap:operation soapAction="urn:getBook"/>
>
>   ... etc. ...
>
>    </wsdl:operation>
>
>
>
> Jaime Hablutzel Egoavil wrote
> >
> > When you receive that error?? when you try to generate a client from a
> > wsdl
> > including the policy??
> >
>
>
> --
> View this message in context:
> http://axis2.867.n6.nabble.com/Policy-not-supported-is-it-a-bug-tp4340911p4717508.html
> Sent from the Axis2-user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


-- 
Jaime Hablutzel - 9-9956-3299

(tildes omitidas intencionalmente)

Mime
View raw message