Forum Discussion

Finan's avatar
Finan
Frequent Contributor
13 years ago

[Resolved] WS-Sec signing of soap-messages does not work

Hi,

I have a non-composite project (not allowed to share) which requires WS-Sec signing on soap messages. The project works (tested) in 3.6.1, 3.6 and 3.5.1.
In 4.0 beta 1 it does not work. (also 3.6.2 snapshots)

On project level I have set the keystore and added the Outgoing-ws-security configurations and signature settings.
The configuration is applied for each WSDL that requires the signing.

The keystore is referenced as ${projectDir}/subdir/certificate.p12 in the project.xml

The webservice returns a Message is not signed error for the 4.0 beta 1 and 3.6.2 snapshots versions.

7 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    thanks for this; do you get any errors in the error log when sending the request? Can you see in the Raw request tab after sending if the message has actually been signed!? (ie is it being signed incorrectly or not being signed at all...)

    regards!

    /Ole
    eviware.com
  • Finan's avatar
    Finan
    Frequent Contributor
    Hi,


    Error log:
    Mon May 23 10:17:55 CEST 2011:ERROR:org.apache.ws.security.WSSecurityException: Signature creation failed (Cannot setup signature data structure); nested exception is: 
    org.apache.xml.security.signature.XMLSignatureException: The algorithm URI "null" could not be mapped to a JCE algorithm
    org.apache.ws.security.WSSecurityException: Signature creation failed (Cannot setup signature data structure); nested exception is:
    org.apache.xml.security.signature.XMLSignatureException: The algorithm URI "null" could not be mapped to a JCE algorithm
    at org.apache.ws.security.message.WSSecSignature.addReferencesToSign(WSSecSignature.java:608)
    at org.apache.ws.security.message.WSSecSignature.build(WSSecSignature.java:769)
    at com.eviware.soapui.impl.wsdl.support.wss.entries.AddSignatureEntry.process(AddSignatureEntry.java:198)
    at com.eviware.soapui.impl.wsdl.support.wss.OutgoingWss.processOutgoing(OutgoingWss.java:157)
    at com.eviware.soapui.impl.wsdl.submit.filters.WssRequestFilter.filterWsdlRequest(WssRequestFilter.java:58)
    at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterAbstractHttpRequest(AbstractRequestFilter.java:37)
    at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterRequest(AbstractRequestFilter.java:31)
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:133)
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:76)
    at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:238)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:366)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:232)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:141)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:42)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: org.apache.xml.security.signature.XMLSignatureException: The algorithm URI "null" could not be mapped to a JCE algorithm
    at org.apache.xml.security.algorithms.MessageDigestAlgorithm.getDigestInstance(Unknown Source)
    at org.apache.xml.security.algorithms.MessageDigestAlgorithm.getInstance(Unknown Source)
    at org.apache.xml.security.signature.Reference.<init>(Unknown Source)
    at org.apache.xml.security.signature.Manifest.addDocument(Unknown Source)
    at org.apache.xml.security.signature.XMLSignature.addDocument(Unknown Source)
    at org.apache.ws.security.message.WSSecSignature.addReferencesToSign(WSSecSignature.java:601)
    ... 22 more


    and raw request
    POST "wsdl_endpoint"
    Accept-Encoding: gzip,deflate
    Content-Type: text/xml;charset=UTF-8
    SOAPAction: "wsdl_endpoint"
    User-Agent: Jakarta Commons-HttpClient/3.1
    Host: host
    Content-Length: 110144

    <soapenv:Envelope xmlns:mes="servicelibrary" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>

    </soapenv:Header>
    <soapenv:Body>
    <mes:leverAan>
    body
    </mes:leverAan>
    </soapenv:Body>
    </soapenv:Envelope>
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    hmm.. this usually occurs if you haven't selected a (correct) value in one of the WS-Security configuration panels.. could you check that all are set, and to a valid value!?

    regards,

    /Ole
    eviware.com
  • Finan's avatar
    Finan
    Frequent Contributor
    I have visually checked all settings, all are valid and available.
    I use the same project for the 4 different soapUI pro versions and only for 3.6.2 snapshots and the 4.0 beta 1 version, the error message is returned.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    ok.. we should be able to reproduce this with our own keystore then; would it be possible for to attach or mail your project to support@eviware.com so we can have a look?

    regards!

    /Ole
    eviware.com
  • Finan's avatar
    Finan
    Frequent Contributor
    Mail send with an example project included.
    Retested with the example project, works in 3.5.1 and 3.6.1, same error in 3.6.2 snapshots and 4.0 beta 1.
  • Finan's avatar
    Finan
    Frequent Contributor
    Thanks for the replay over mail, adjusting the digest algorithm fixes the problem.
    Although I'm curious why having the digest algorithm set to default works for older versions, but not for 3.6.2 and later?