Announcement Announcement Module
Collapse
No announcement yet.
Spring-WS: Add security info in SOAP Header Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring-WS: Add security info in SOAP Header

    I tried the configure declarative in context.xml but with no luck
    Code:
     <bean id= "SecurityHeaderInterceptor" class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
            <property name="securementActions" value="UsernameToken"/>
            <property name="securementUsername" value="zzzzzz"/>
            <property name="securementPassword" value="password"/>
         </bean>
    <bean id=XXRequestContextHeaderInterceptor" class="com.XX.payment.ws.security.XXRequestContextHeaderInterceptor">
    		<property name="interfaceId" value="12.4" />
    		<property name="returnProcessingNodesHeader" value="${aacom.etds.fulfillment.returnProcessingNodeHeader}" />
    		<property name="processingMode" value="${xx.yy.zz}" />
    	</bean>
    Code:
     <bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate">
     
        <property name="marshaller" ref="jaxbMarshaller" />
        <property name="unmarshaller" ref="jaxbMarshaller" />
        <property name="defaultUri"   value="http://10.62.45.124/vvvv/ttttt/V1" />
         <property name="interceptors">
            <list>
                 <ref bean="xxRequestContextSoapHeaderInterceptor" />
                 <ref bean="xxSecuritySoapHeaderInterceptor" />
            </list>
        </property>
        <property  name="defaultUri"  value="${webservice.endpoint}"/>
        
        </bean>
    I wanted to build the soapheader request
    Code:
       <soapenv:Header>
          <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
             <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-24">
                <wsse:Username>zzzzzz</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
              </wsse:UsernameToken>
             <wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" wsu:Id="SecurityToken"></wsse:BinarySecurityToken>
          </wsse:Security>
          <ns3:RequestContextHeader xmlns:ns3="http://www.xx.com/Services/SOAPHeaders">
             <ProcessingDirectives>
                <InterfaceID>1.2.0</InterfaceID>
                <Timeout>PT30.000S</Timeout>
                <ProcessingMode>Sync</ProcessingMode>
                <ReturnProcessingNodesHeader>true</ReturnProcessingNodesHeader>
             </ProcessingDirectives>
          </ns3:RequestContextHeader>
       </soapenv:Header>
    Looking forward for your suggestion
Working...
X