Error implementing WS Security in SOAP

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

Error implementing WS Security in SOAP

Jorge Zapata

I am trying to use WS Security (Wss4jSecurityInterceptor) in a SOAP WebService client for signing and encrypting an XML message. I have followed the SOAP SSL sample to achieve this and already have tailored it to my own keystore. The code seems to be ok but when I run the test the following error comes out

Could not access header: HeaderElements must be namespace qualified;
 nested exception is com.sun.xml.messaging.saaj.SOAPExceptionImpl: HeaderElements must be namespace qualified

This is my context file:

<citrus-ws:client id="SoapEndPoint1"

<bean id="webServiceTemplate" class=""> 
    <property name="interceptors"> 
          <ref bean="wsClientSecurityInterceptor"/> 
<bean id="wsClientSecurityInterceptor"  
    <property name="securementActions" value="Timestamp Signature Encrypt" /> 
    <property name="securementUsername" value="client" /> 
    <property name="securementPassword" value="" /> 
    <property name="securementSignatureCrypto" ref="clientCrypto"/> 
    <property name="securementEncryptionCrypto" ref="clientCrypto"/> 
    <property name="securementEncryptionUser" value="server"/> 
    <property name="validationActions" value="Signature" /> 
    <property name="validationSignatureCrypto" ref="clientCrypto"/> 
    <property name="securementEncryptionParts" value="{Content}{}namespace"/> 
<bean id="clientCrypto" class=""> 
    <property name="keyStorePassword" value="password"/> 
    <property name="keyStoreLocation" value="classpath:src/test/resources/keys/keystore.jks"/> 
  <citrus-http:client id="SoapEndPoint2"

I have validated that my message does actually have header elements well defined but still don't figure out why this is happening.

Thanks in advance, any help is appreciated.
Reply | Threaded
Open this post in threaded view

Re: Error implementing WS Security in SOAP

Christoph Deppisch
Can you please give the complete stacktrace information of that error? In addition to that logging information and small outline of your test actions might be helpful.