[java-identity-provider COMMIT] in /trunk: idp-conf/src/main/resources/views/error.vm idp-war/src/main/webapp/WEB-INF...
noreply at shibboleth.net
noreply at shibboleth.net
Wed Jun 4 15:37:15 EDT 2014
Author: scantor
Date: Wed Jun 4 15:37:14 2014
New Revision: 6043
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6043&view=rev
Log:
Add some initial support for SOAP faults.
Modified:
trunk/idp-conf/src/main/resources/views/error.vm
trunk/idp-war/src/main/webapp/WEB-INF/jsp/error.jsp
Modified: trunk/idp-conf/src/main/resources/views/error.vm
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/views/error.vm?rev=6043&r1=6042&r2=6043&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/views/error.vm (original)
+++ trunk/idp-conf/src/main/resources/views/error.vm Wed Jun 4 15:37:14 2014
@@ -4,6 +4,15 @@
## Velocity context will contain the following properties
## flowRequestContext - the Spring Web Flow RequestContext
+#if (!$profileRequestContext.isBrowserProfile())
+ $flowRequestContext.getExternalContext().getNativeResponse().setStatus(500)
+ $flowRequestContext.getExternalContext().getNativeResponse().setContentType('text/xml')
+<S:Fault xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
+ <faultcode>S:Server</faultcode>
+ <faultstring>SOAP fault</faultstring>
+<S:Fault>
+
+#else
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<body>
@@ -17,4 +26,6 @@
#end
</body>
-</html>
+</html>
+
+#end
Modified: trunk/idp-war/src/main/webapp/WEB-INF/jsp/error.jsp
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-war/src/main/webapp/WEB-INF/jsp/error.jsp?rev=6043&r1=6042&r2=6043&view=diff
==============================================================================
--- trunk/idp-war/src/main/webapp/WEB-INF/jsp/error.jsp (original)
+++ trunk/idp-war/src/main/webapp/WEB-INF/jsp/error.jsp Wed Jun 4 15:37:14 2014
@@ -1,17 +1,34 @@
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="net.shibboleth.utilities.java.support.codec.HTMLEncoder" %>
+<%@ page import="org.opensaml.profile.context.ProfileRequestContext" %>
<%@ page import="org.springframework.webflow.execution.RequestContext" %>
+
+<%
+final ProfileRequestContext prc = (ProfileRequestContext) request.getAttribute("opensamlProfileRequestContext");
+if (!prc.isBrowserProfile()) {
+ response.setContentType("text/xml");
+ response.setStatus(500);
+%>
+
+<S:Fault xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
+ <faultcode>S:Server</faultcode>
+ <faultstring>SOAP fault</faultstring>
+<S:Fault>
+
+<% } else { %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<body>
<h2>ERROR</h2>
-<% RequestContext rc = (RequestContext) request.getAttribute("flowRequestContext");
- if ( rc != null && rc.getCurrentEvent() != null) { %>
- <p>ERROR: <%= HTMLEncoder.encodeForHTML(rc.getCurrentEvent().getId()) %></p>
-<% } %>
+ <% final RequestContext rc = (RequestContext) request.getAttribute("flowRequestContext");
+ if ( rc != null && rc.getCurrentEvent() != null) { %>
+ <p>ERROR: <%= HTMLEncoder.encodeForHTML(rc.getCurrentEvent().getId()) %></p>
+ <% } %>
</body>
-</html>
+</html>
+
+<% } %>
More information about the commits
mailing list