If you want to attach a policy to a particular binding you should do that in
the services.xml as follows.

<service>

<wsp:PolicyAttachment xmlns:wsp="
http://schemas.xmlsoap.org/ws/2004/09/policy";>
      <wsp:AppliesTo>
        <policy-subject identifier="binding:soap11" />
        <policy-subject identifier="binding:soap12" />
      </wsp:AppliesTo>

      <wsp:Policy wsu:Id="UToverHTTP" ...> ...   </wsp:Policy>

 </wsp:PolicyAttachment>

</service>

HTH

Sanka





On Sun, May 4, 2008 at 2:48 PM, jason zhang <[EMAIL PROTECTED]>
wrote:

> Hi, all
> I am using axis2 1.4 with rampart 1.4 RC1. My services.xml is like this
> ----------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <serviceGroup>
>   <service name="programws">
>        ...
>       <wsp:Policy wsu:Id="UToverHTTP"
>          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";
>           xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
>           ....
>       </wsp:Policy>
>   </service>
> </serviceGroup>
>
> Then I retrieve the generated wsdl from web interface (
> http://localhost:8080/cmdportal1/services/programws?wsdl)
> My wsdl is like this
> -----------------
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions >
>   <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy";
> xmlns:wsu="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit
> y-1.0.xsd" wsu:Id="UToverHTTP">
>       ...
>   </wsp:Policy>
>   <wsdl:documentation>programws</wsdl:documentation>
>   <wsdl:types>
>    ...
>  <wsdl:types>
>  ....
> </wsdl:definitions>
>
> Should the policy element  be the first element of <wsdl:binding>?
>
> thanks
>
> -jason
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Sanka Samaranayake
WSO2 Inc.

http://sankas.blogspot.com/
http://www.wso2.org/

Reply via email to