|
From: Ronald v. K. <rv...@ab...> - 2003-07-04 21:39:54
|
Hi,
In the PKISignatureImpl.java you do the following:
DocumentResult docResult = new DocumentResult();
TransformerFactory.newInstance().newTransformer().
transform(soapPart.getContent(), docResult);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
(new XMLWriter(baos)).write(docResult.getDocument());
DocumentBuilderFactory factory = DocumentBuilderFactory.
newInstance();
factory.setNamespaceAware(true);
// soapPartDocument is a DOM equivilance of soapPart
final Document soapPartDocument = factory.newDocumentBuilder().
parse(new ByteArrayInputStream(baos.toByteArray()));
Just to get from a soapPart to a soapPartDocument. According to the
specs (well the tutorial at least):
Moreover, the |SOAPPart| of a |SOAPMessage| is also a DOM Level 2
|Document|, and can be manipulated as such by applications, tools and
libraries that use DOM. See Chapter 6
<http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPDOM.html#wp79996>
for details about DOM. See Adding Content to the SOAPPart Object
<http://java.sun.com/j2ee/1.4/docs/tutorial/doc/SAAJ3.html#wp64119> and
Adding a Document to the SOAP Body
<http://java.sun.com/j2ee/1.4/docs/tutorial/doc/SAAJ3.html#wp78963> for
details on how to use DOM documents with the SAAJ API.
final Document soapPartDocument = (Document) soapPart;
Should work as well. Maybe the 'axis' problem is solved then as well.
Eclipse does not complain about the casting and is really good at
checking this, I'll try running it later (have currently no server
configured for using certificates).
Ronald
|