• Post Reply Bookmark Topic Watch Topic
  • New Topic

org.w3c.dom.DOMException: Cannot find Reference in Manifest

 
santosh mudholam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I'm Consuming Web-service,When invoke service getting exception.

Error:
org.w3c.dom.DOMException: Cannot find Reference in Manifest
at org.apache.xml.security.signature.Manifest.<init>(Unknown Source)
at org.apache.xml.security.signature.SignedInfo.<init>(Unknown Source)
at org.apache.xml.security.signature.XMLSignature.<init>(Unknown Source)
at org.apache.ws.security.processor.SignatureProcessor.verifyXMLSignature(SignatureProcessor.java:223)
at org.apache.ws.security.processor.SignatureProcessor.handleToken(SignatureProcessor.java:116)
at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:328)
at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:245)
at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:198)


I have written handler,In handlemessage() appending security certificate to request.

public boolean handleMessage(SOAPMessageContext soapMessageContext)
{
Boolean outboundProperty = (Boolean) soapMessageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
SOAPMessage message = soapMessageContext.getMessage();

if(outboundProperty)
{
try
{

Document doc = toDocument(message);



Properties props = new Properties();
props.setProperty("org.apache.ws.security.crypto.provider", "org.apache.ws.security.components.crypto.Merlin");
props.setProperty("org.apache.ws.security.crypto.merlin.keystore.type", "jks");
props.setProperty("org.apache.ws.security.crypto.merlin.keystore.password","xyz");
props.setProperty("org.apache.ws.security.crypto.merlin.file","XYZt_KeyStore_E1.jks");

WSSecHeader secHeader = new WSSecHeader();
secHeader.setMustUnderstand(false);
secHeader.insertSecurityHeader(doc);
WSSecSignature sig = new WSSecSignature();
sig.setUserInfo("abc","xyz");
sig.setUseSingleCertificate(true);
sig.setKeyIdentifierType(1);
sig.setSigCanonicalization("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");
sig.setSignatureAlgorithm("http://www.w3.org/2000/09/xmldsig#rsa-sha1");
Crypto crypto = CryptoFactory.getInstance(props);
sig.prepare(doc, crypto, secHeader);
sig.prependToHeader(secHeader);
sig.prependBSTElementToHeader(secHeader);
sig.computeSignature();

soapMessageContext.put("IGNORE_RESP_SIGN",true);
soapMessageContext.put("SIGN_MANDATORY",false);
soapMessageContext.put("ALLOW_SOAP_RESP_TO_BE_LOGGED",true);
soapMessageContext.put("ALLOW_SOAP_RESP_LOG_ON_ERROR",true);


soapMessageContext.setMessage(toSOAPMessage(doc));



}
catch (Exception ex) {
System.out.println("EX:-->"+ex.getMessage());
ex.printStackTrace();
}
}

logToSystemOut(soapMessageContext);
return true;
}


I'm able to build request properly,but getting above exception.Please help on this.

Thank you.
Santosh

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!