You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by anshuk pal chaudhuri <an...@yahoo.com> on 2006/02/08 14:03:30 UTC

Getting Error with Signing

I am trying to sign a soap envelope using the wss4j
apis.I am getting some errors.
This is the code.I am getting the following error at
the crypto getting instance.I am using the sample
crypto.properties file.What extra configuration do I
need to make

public static void main(String a[]) throws Exception
	{
		String soapMsg = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>" + "<SOAP-ENV:Envelope
xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"
+ "<SOAP-ENV:Body>" + "<add
xmlns=\"http://addservice\">" + "<value
xmlns=\"\">15</value>" + "</add>" +
"</SOAP-ENV:Body>\r\n       \r\n" +
"</SOAP-ENV:Envelope>";

SOAP11Constants soapConstants = new SOAP11Constants();

Document envelope = stringToDOM(soapMsg);
WSSignEnvelope signer = new WSSignEnvelope();

Crypto crypto =
CryptoFactory.getInstance("crypto.properties");

Vector parts = new Vector();

WSEncryptionPart part = new
WSEncryptionPart(soapConstants.getBodyQName().getLocalPart(),
       soapConstants.getEnvelopeURI(),"Content");

parts.add(part);

signer.setParts(parts); 
envelope = signer.build(envelope, crypto);
// this is optional since the body is signed by
default
	}


THE ERROR:

java.lang.reflect.InvocationTargetException
	at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
	at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
	at
org.apache.ws.security.components.crypto.CryptoFactory.loadClass(CryptoFactory.java:117)
	at
org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFactory.java:101)
	at varun.Signer.main(Signer.java:44)
Caused by:
org.apache.ws.security.components.crypto.CredentialException:
Proxy file (keys/x509.PFX.MSFT) not found.[]
	at
org.apache.ws.security.components.crypto.Merlin.<init>(Merlin.java:108)
	... 7 more
java.lang.InstantiationException:
org.apache.ws.security.components.crypto.Merlin
	at java.lang.Class.newInstance0(Class.java:293)
	at java.lang.Class.newInstance(Class.java:261)
	at
org.apache.ws.security.components.crypto.CryptoFactory.loadClass(CryptoFactory.java:125)
	at
org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFactory.java:101)
	at varun.Signer.main(Signer.java:44)
java.lang.RuntimeException:
org.apache.ws.security.components.crypto.Merlin cannot
create instance
	at
org.apache.ws.security.components.crypto.CryptoFactory.loadClass(CryptoFactory.java:130)
	at
org.apache.ws.security.components.crypto.CryptoFactory.getInstance(CryptoFactory.java:101)
	at varun.Signer.main(Signer.java:44)
Exception in thread "main" 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org