Commit 5edd6e7c authored by Tony Schaller's avatar Tony Schaller

Small enhancements for the demo output

git-svn-id: https://svn.code.sf.net/p/ehealthconnector/code/trunk@1694 e99adb7c-5e35-42fd-8d1b-cdb378af05e8
parent 94dd7023
......@@ -538,13 +538,12 @@ namespace eHealthConnectorDemo
}
catch (Exception e)
{
if (e.GetType() == typeof(ClientSendException)) {
if (e.getCause().GetType() == typeof(java.lang.NullPointerException))
txtLog.AppendText(
"Error: client.invokeUserAuthentication timed out. Note: This demo will not work on windows machines.\n");
} else {
if (e.GetType() == typeof(ClientSendException))
{
log.error("Error running the program,", e);
txtLog.AppendText("Error: " + e.getMessage() + "\n");
if (e.getMessage().contains("No SAML response found"))
txtLog.AppendText("Note: This demo will not work on windows machines.\n");
}
}
......@@ -1392,7 +1391,7 @@ namespace eHealthConnectorDemo
txtLog.AppendText("\t]\n");
}
txtLog.AppendText("\tHas valid signature: " + valid + "\n");
txtLog.AppendText("\tHas valid signature: " + valid.toString().ToLower() + "\n");
}
}
else
......
......@@ -505,12 +505,11 @@ public class DemoXua {
response = client.invokeUserAuthentication(authnRequest, clientConfiguration);
} catch (Exception e) {
if (e instanceof ClientSendException) {
if (e.getCause() instanceof NullPointerException)
System.out.print(
"Error: client.invokeUserAuthentication timed out. Note: This demo will not work on windows machines.\n");
} else {
log.error("Error running the program,", e);
System.out.print("Error: " + e.getMessage() + "\n");
if (e.getMessage().contains("No SAML response found"))
System.out
.print("Note: This demo will not work on windows machines.\n");
}
}
......@@ -1279,7 +1278,8 @@ public class DemoXua {
System.out.print("\t]\n");
}
System.out.print("\tHas valid signature: " + valid + "\n");
System.out.print(
"\tHas valid signature: " + Boolean.toString(valid).toLowerCase() + "\n");
}
} else {
System.out.print("No valid authentication response\n");
......
......@@ -295,7 +295,7 @@ public abstract class AbstractSoapClient<T> {
final NodeList childs = faultnode.getChildNodes();
for (int j = 0; j < childs.getLength(); ++j) {
final Node child = childs.item(j);
System.out.println("NodeName: " + child.getNodeName());
// System.out.println("NodeName: " + child.getNodeName());
if ("faultcode".equalsIgnoreCase(child.getNodeName())) {
faultCode = child.getTextContent();
} else if ("faultstring".equalsIgnoreCase(child.getNodeName())) {
......
......@@ -166,6 +166,8 @@ public class IdpClientByBrowserAndProtocolHandler implements IdpClient {
private Response startWaitForResponse()
throws IOException, ClientSendException, DeserializeException {
final Calendar end = Calendar.getInstance();
// This is the timeout to wait for the SAML response
end.add(Calendar.MINUTE, 1);
final File tempFile = new File(System.getProperty("java.io.tmpdir"),
......@@ -189,8 +191,6 @@ public class IdpClientByBrowserAndProtocolHandler implements IdpClient {
tempFile.delete();
}
if (line == null) {
// maybe add this restriction, later:
// (!line.startsWith(config.getProtocolHandlerName()))
throw new ClientSendException("No SAML response found");
}
line = java.net.URLDecoder.decode(line, "UTF-8");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment