|
From: <pe...@us...> - 2003-11-22 00:23:50
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/receiver
In directory sc8-pr-cvs1:/tmp/cvs-serv17112/src/java/org/neuclear/receiver
Modified Files:
ReceiverServlet.java UnsupportedTransaction.java
Log Message:
All unit tests in commons, id and xmlsec now work.
AssetController now successfully processes payments in the unit test.
Payment Web App has working form that creates a TransferRequest presents it to the signer
and forwards it to AssetControlServlet. (Which throws an XML Parser Exception) I think the XMLReaderServlet is bust.
Index: ReceiverServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/receiver/ReceiverServlet.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ReceiverServlet.java 21 Nov 2003 04:45:13 -0000 1.7
--- ReceiverServlet.java 22 Nov 2003 00:23:47 -0000 1.8
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.8 2003/11/22 00:23:47 pelle
+ * All unit tests in commons, id and xmlsec now work.
+ * AssetController now successfully processes payments in the unit test.
+ * Payment Web App has working form that creates a TransferRequest presents it to the signer
+ * and forwards it to AssetControlServlet. (Which throws an XML Parser Exception) I think the XMLReaderServlet is bust.
+ *
* Revision 1.7 2003/11/21 04:45:13 pelle
* EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 84,91 ****
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
- import org.neuclear.id.verifier.VerifyingReader;
import org.neuclear.commons.NeuClearException;
! import org.neuclear.xml.soap.XMLInputStreamServlet;
import org.neuclear.xml.XMLException;
import javax.servlet.ServletConfig;
--- 90,98 ----
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.neuclear.commons.NeuClearException;
! import org.neuclear.id.verifier.VerifyingReader;
! import org.neuclear.xml.ElementProxy;
import org.neuclear.xml.XMLException;
+ import org.neuclear.xml.soap.XMLInputStreamServlet;
import javax.servlet.ServletConfig;
***************
*** 95,98 ****
--- 102,106 ----
import java.io.IOException;
import java.io.InputStream;
+ import java.io.PrintWriter;
public abstract class ReceiverServlet extends XMLInputStreamServlet {
***************
*** 102,112 ****
protected final void handleInputStream(final InputStream is, final HttpServletRequest request, final HttpServletResponse response) throws IOException {
try {
! receiver.receive(VerifyingReader.getInstance().read(is));
} catch (NeuClearException e) {
! e.printStackTrace();
} catch (XMLException e) {
! e.printStackTrace();
}
}
--- 110,134 ----
protected final void handleInputStream(final InputStream is, final HttpServletRequest request, final HttpServletResponse response) throws IOException {
+ PrintWriter writer = response.getWriter();
+ final boolean isXML = request.getContentType().equals("text/xml");
+ if (isXML) {
+ response.setContentType("text/xml");
+ } else {
+ response.setContentType("text/html");
+ writer.print("<html><head><title>ReceiverServler</title></head><body>");
+ }
try {
! ElementProxy receipt = receiver.receive(VerifyingReader.getInstance().read(is));
! if (isXML)
! writer.print(receipt.canonicalize());
! else
! writer.print(receipt.getTagName());
!
} catch (NeuClearException e) {
! e.printStackTrace(writer);
} catch (XMLException e) {
! e.printStackTrace(writer);
}
+ writer.close();
}
Index: UnsupportedTransaction.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/receiver/UnsupportedTransaction.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** UnsupportedTransaction.java 21 Nov 2003 04:45:13 -0000 1.4
--- UnsupportedTransaction.java 22 Nov 2003 00:23:47 -0000 1.5
***************
*** 1,6 ****
package org.neuclear.receiver;
- import org.neuclear.id.SignedNamedObject;
import org.neuclear.commons.NeuClearException;
/*
--- 1,7 ----
package org.neuclear.receiver;
import org.neuclear.commons.NeuClearException;
+ import org.neuclear.id.SignedNamedCore;
+ import org.neuclear.id.SignedNamedObject;
/*
***************
*** 24,27 ****
--- 25,34 ----
$Id$
$Log$
+ Revision 1.5 2003/11/22 00:23:47 pelle
+ All unit tests in commons, id and xmlsec now work.
+ AssetController now successfully processes payments in the unit test.
+ Payment Web App has working form that creates a TransferRequest presents it to the signer
+ and forwards it to AssetControlServlet. (Which throws an XML Parser Exception) I think the XMLReaderServlet is bust.
+
Revision 1.4 2003/11/21 04:45:13 pelle
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 45,49 ****
/**
- *
* User: pelleb
* Date: Sep 26, 2003
--- 52,55 ----
***************
*** 52,58 ****
public final class UnsupportedTransaction extends NeuClearException {
/**
! *
! * @param obj
*/
public UnsupportedTransaction(final SignedNamedObject obj) {
super("NeuClear Transaction not Supported by this Receiver: " + obj.getClass().getName());
--- 58,67 ----
public final class UnsupportedTransaction extends NeuClearException {
/**
! * @param obj
*/
+ public UnsupportedTransaction(final SignedNamedCore obj) {
+ super("NeuClear Transaction not Supported by this Reader: " + obj.getClass().getName());
+ }
+
public UnsupportedTransaction(final SignedNamedObject obj) {
super("NeuClear Transaction not Supported by this Receiver: " + obj.getClass().getName());
|