Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Placed a full Spring config file to show how policies are added--concerned this was not obvious for most users.

...

Note: for Symmetric bindings that specify a protection token, the ws-security-encryption properties are used.

Configuring via

...

Spring

The properties are easily configured as client or endpoint properties--use the latter for web service provider configuration:

Code Block
xml
xml

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:jaxws="http://cxf.apache.org/jaxws"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
    http://cxf.apache.org/jaxws 
    http://cxf.apache.org/schemas/jaxws.xsd">

<jaxws:client name="{http://cxf.apache.org}MyService" createdFromAPI="true">
    <jaxws:properties>
        <entry key="ws-security.username" value="Alice"/>
        <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
        <entry key="ws-security.signature.properties" value="etc/alice.properties"/>
        <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>
    </jaxws:properties>
</jaxws:client>

</beans>
Code Block
xml
xml

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:jaxws="http://cxf.apache.org/jaxws"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
    http://cxf.apache.org/jaxws 
    http://cxf.apache.org/schemas/jaxws.xsd">

   <jaxws:endpoint 
      id="MyService"
      address="https://localhost:9001/MyService" 
      serviceName="interop:MyService"
      endpointName="interop:MyServiceEndpoint"
      implementor="com.foo.MyService">
        
      <jaxws:properties>
         <entry key="ws-security.username" value="Alice"/>
         <entry key="ws-security.callback-handler" value="interop.client.UTPasswordCallback"/>
      </jaxws:properties> 
     
   </jaxws:endpoint> 
</beans>

Configuring via API's

Configuring the properties for the client just involves setting the properties in the clients RequestContext:

...