I have been trying to properly implement a Java method using Canonicalizer. I pulled down the xmlsec-2.3.0.jar file and placed it in my build path. I have no initial errors showing up in esclipse until I compile and the error in my opinion makes no sense. I would greatly appreciate a second pair of eyes to see if I made a dumb mistake. The examples I have seen before only has one parm for canonicalize(byte[]), but this version of xmlsec has 3 parms. Your insight is appreciated.
byte[] b = xmldata.getBytes();
OutputStream writer = null;
Init.init();
Canonicalizer canon = null;
try {
canon = Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
} catch (InvalidCanonicalizerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
canon.canonicalize(b, writer, false);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Error
IntegrationServer\instances\default\packages\FibTest\code\source\work.java:56: error: method canonicalize in class Canonicalizer cannot be applied to given types;
canon.canonicalize(b, writer, false);
^
required: byte[]
found: byte[],OutputStream,boolean
reason: actual and formal argument lists differ in length