I've attached one. If you generate from this as supplied (using the
submission namespace) the client stub attaches the appropriate policy to
the messages:

       
(__operation).getMessage(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_OUT_VALUE).getPolicySubject().attachPolicy(getPolicy("<wsp:Policy
wsu:Id=\"UsernameToken\"
xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\";
xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\";><wsp:ExactlyOne><wsp:All><sp:SupportingTokens
xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\";><wsp:Policy><sp:UsernameToken
xmlns:sp=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702\";
sp:IncludeToken=\"http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient\";
/></wsp:Policy></sp:SupportingTokens></wsp:All></wsp:ExactlyOne></wsp:Policy>"));

If you replace all instances of the
http://schemas.xmlsoap.org/ws/2004/09/policy namespace with the
http://www.w3.org/ns/ws-policy namespace and regenerate there's no
policy attached in the stub.

  - Dennis


On 11/03/2010 12:35 AM, Sanka Samaranayake wrote:
> Can you post the WSDL that you use to generate code ?
>
> Sanka
>
> On Tue, Nov 2, 2010 at 8:57 AM, Dennis Sosnoski <[email protected]
> <mailto:[email protected]>> wrote:
>
>     Is anyone using WS-Policy 1.5 (the official W3C release,
>     http://www.w3.org/ns/ws-policy namespace) with Axis2 code
>     generation? It
>     looks like the policy is silently ignored, so the client gets
>     generated
>     with no policy attached and there's no security at runtime.
>
>      - Dennis
>
>     --
>     Dennis M. Sosnoski
>     Java SOA and Web Services
>     Axis2/CXF/Metro Training and Consulting
>     http://www.sosnoski.com - http://www.sosnoski.co.nz
>     Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: [email protected]
>     <mailto:[email protected]>
>     For additional commands, e-mail: [email protected]
>     <mailto:[email protected]>
>
>
>
>
> -- 
> Sanka Samaranayake
>
> PMC Member, Committer, Apache Software Foundation, http://www.apache.org/
>
> Telephone: +34 677 864358
> Email: sanka AT apache DOT org
> Blog: http://sankas.blogspot.com/
> Linked-in: http://lk.linkedin.com/pub/sanka-samaranayake/4/b2b/3b3

Attachment: library.wsdl
Description: application/wsdl

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to