Forum Discussion

tmulle's avatar
tmulle
Occasional Contributor
13 years ago

NullPointerException when using SAML - XML

Hi,

I'm using SOAPUI 4.5.1 and trying to use the SAML XML option when testing my Webservices.
When I paste in a valid SAML2 assertion I'm getting the error below when running the test through the UI and the assertion never gets added to the request. If I use the FORM version everything works fine, but I need the ability to add multiple attributes in the request for testing so I generate my own assertion and use the XML option instead of form.

It appears that the UI is trying to sign the request? My assertion that I pasted in is already signed and works fine.

The funny thing is that if I run the tests through the JUnit/TestNG code.. it works just fine, it's only through the UI I'm getting this error.

Here is the code I'm using for my Unit Tests and this works just fine. The master-soapui-project.xml file is the same one I'm using in the UI as well.

 @Test(groups = {"ReadOnly", "WebServices"})
public void soapUI() throws Exception {

// Create the SOAPUiTestRunner
SoapUITestCaseRunner runner = new SoapUITestCaseRunner();

// Load the main soap project from the classpath and then get the file location
URL url = Thread.currentThread().getContextClassLoader().getResource("master-soapui-project.xml");
runner.setProjectFile(url.getFile());
runner.setPrintReport(true);
runner.run();
}

Wed Aug 15 12:13:59 EDT 2012:ERROR:java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.xml.security.signature.Manifest.generateDigestValues(Unknown Source)
at org.apache.xml.security.signature.XMLSignature.sign(Unknown Source)
at org.opensaml.xml.signature.Signer.signObject(Signer.java:76)
at org.apache.ws.security.saml.ext.OpenSAMLUtil.toDom(OpenSAMLUtil.java:129)
at org.apache.ws.security.saml.ext.AssertionWrapper.toDOM(AssertionWrapper.java:373)
at org.apache.ws.security.message.WSSecSAMLToken.prependToHeader(WSSecSAMLToken.java:82)
at org.apache.ws.security.message.WSSecSAMLToken.build(WSSecSAMLToken.java:118)
at com.eviware.soapui.impl.wsdl.support.wss.entries.ManualSAMLEntry.process(ManualSAMLEntry.java:114)
at com.eviware.soapui.impl.wsdl.support.wss.OutgoingWss.processOutgoing(OutgoingWss.java:192)
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:184)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
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.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

2 Replies

  • tmulle's avatar
    tmulle
    Occasional Contributor
    Ok, I found the issue and the solution.

    You have to replace the wss4j-1.6.2.jar in the SOAPUI_HOME/lib dir with wss4j-1.6.6.jar or higher. I'm guessing there was a bug fix between the version because as soon as I replaced the old jar with the new one my UI tests worked again.

    Hope this helps..
  • Thanks for posting regarding null pointer exception. I am receiving "new" error despite replacing the wss4j jar with 1.4.6 and 1.4.7. I think the new jars are referring
    some other class which is not found.
    ERROR:java.lang.NoClassDefFoundError: org/apache/jcp/xml/dsig/internal/dom/XMLDSigRI

    Wondering if you have replaced anything else? Also, i couldn't find soapui.sh (mine is windows version)

    Thanks/