Configuring via Spring - 8.0

Talend ESB Service Developer Guide

Version
8.0
Language
English
Product
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Module
Talend ESB
Talend Runtime
Content
Design and Development
Installation and Upgrade
Last publication date
2023-11-06

The properties are easily configured as client or endpoint properties--use the former for the SOAP client, the latter for the web service provider.

<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}MyPortName" 
      createdFromAPI="true">
      <jaxws:properties>
         <entry key="ws-security.callback-handler" 
            value="interop.client.KeystorePasswordCallback"/>
         <entry key="ws-security.signature.properties" 
            value="etc/client.properties"/>
         <entry key="ws-security.encryption.properties" 
            value="etc/service.properties"/>
         <entry key="ws-security.encryption.username" 
            value="servicekeyalias"/>
      </jaxws:properties>
   </jaxws:client>

</beans>

For the jaxws:client's name attribute above, use the namespace of the WSDL along with the name attribute of the desired wsdl:port element under the WSDL's service section. (See http://tinyurl.com/yatskw4here and here for an example.)

<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.callback-handler" 
            value="interop.client.UTPasswordCallback"/>
         <entry key="ws-security.signature.properties" 
            value="etc/keystore.properties"/>
         <entry key="ws-security.encryption.properties" 
            value="etc/truststore.properties"/>
         <entry key="ws-security.encryption.username" 
            value="useReqSigCert"/>
      </jaxws:properties> 
     
   </jaxws:endpoint> 
</beans>