|
From: <pe...@us...> - 2003-11-19 23:33:55
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/soap In directory sc8-pr-cvs1:/tmp/cvs-serv12757/src/java/org/neuclear/xml/soap Modified Files: SOAPTools.java Log Message: Signers now can generatekeys via the generateKey() method. Refactored the relationship between SignedNamedObject and NamedObjectBuilder a bit. SignedNamedObject now contains the full xml which is returned with getEncoded() This means that it is now possible to further send on or process a SignedNamedObject, leaving NamedObjectBuilder for its original purposes of purely generating new Contracts. NamedObjectBuilder.sign() now returns a SignedNamedObject which is the prefered way of processing it. Updated all major interfaces that used the old model to use the new model. Index: SOAPTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/soap/SOAPTools.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SOAPTools.java 11 Nov 2003 16:33:23 -0000 1.1.1.1 --- SOAPTools.java 19 Nov 2003 23:33:16 -0000 1.2 *************** *** 1,4 **** --- 1,13 ---- /* $Id$ * $Log$ + * Revision 1.2 2003/11/19 23:33:16 pelle + * Signers now can generatekeys via the generateKey() method. + * Refactored the relationship between SignedNamedObject and NamedObjectBuilder a bit. + * SignedNamedObject now contains the full xml which is returned with getEncoded() + * This means that it is now possible to further send on or process a SignedNamedObject, leaving + * NamedObjectBuilder for its original purposes of purely generating new Contracts. + * NamedObjectBuilder.sign() now returns a SignedNamedObject which is the prefered way of processing it. + * Updated all major interfaces that used the old model to use the new model. + * * Revision 1.1.1.1 2003/11/11 16:33:23 pelle * Moved over from neudist.org *************** *** 90,96 **** */ - import org.dom4j.Element; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.io.SAXReader; import org.neuclear.commons.NeuClearException; --- 99,105 ---- */ import org.dom4j.Document; import org.dom4j.DocumentException; + import org.dom4j.Element; import org.dom4j.io.SAXReader; import org.neuclear.commons.NeuClearException; *************** *** 112,116 **** } } ! public static InputStream soapRequest(String endpoint, Element request, String soapAction) throws NeuClearException { try { return soapRequest(new URL(endpoint), request, soapAction); --- 121,126 ---- } } ! ! public static InputStream soapRequest(String endpoint, String request, String soapAction) throws NeuClearException { try { return soapRequest(new URL(endpoint), request, soapAction); *************** *** 119,122 **** --- 129,133 ---- } } + public static Element soapRequestElement(URL endpoint, Element request, String soapAction) throws NeuClearException { try { *************** *** 127,131 **** } ! public static InputStream soapRequest(URL endpoint, Element request, String soapAction) throws NeuClearException { try { return soapRequest(endpoint.openConnection(), request, soapAction); --- 138,143 ---- } ! ! public static InputStream soapRequest(URL endpoint, String request, String soapAction) throws NeuClearException { try { return soapRequest(endpoint.openConnection(), request, soapAction); *************** *** 136,139 **** --- 148,155 ---- public static InputStream soapRequest(URLConnection conn, Element request, String soapAction) throws NeuClearException { + return soapRequest(conn, request.asXML(), soapAction); + } + + public static InputStream soapRequest(URLConnection conn, String request, String soapAction) throws NeuClearException { try { //Set Headers *************** *** 147,153 **** OutputStream out = conn.getOutputStream(); out.write(SOAP_START); ! out.write(request.asXML().getBytes()); ! System.out.println("Request"); ! System.out.println(request.asXML()); out.write(SOAP_END); out.close(); --- 163,167 ---- OutputStream out = conn.getOutputStream(); out.write(SOAP_START); ! out.write(request.getBytes()); out.write(SOAP_END); out.close(); *************** *** 162,166 **** BufferedReader in = new BufferedReader( new InputStreamReader( ! soapRequest(conn,request,soapAction) )); SAXReader reader = new SAXReader(); --- 176,180 ---- BufferedReader in = new BufferedReader( new InputStreamReader( ! soapRequest(conn, request, soapAction) )); SAXReader reader = new SAXReader(); |