Changes SAML Exception handling
authordousti <dousti@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 12 Jun 2002 17:08:11 +0000 (17:08 +0000)
committerdousti <dousti@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 12 Jun 2002 17:08:11 +0000 (17:08 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@87 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/AASaml.java
src/edu/internet2/middleware/shibboleth/aa/AAServlet.java

index 61a8b32..644aeca 100755 (executable)
@@ -24,11 +24,16 @@ public class AASaml {
     SAMLBinding binding;
     
 
-    public AASaml(HttpServletRequest req, String myName)
-       throws SAMLException{
-
+    public AASaml(String myName){
+       
+       Init.init();
        binding = SAMLBindingFactory.getInstance(protocol, policies);
        this.myName = myName;
+    }
+
+    public void receive(HttpServletRequest req)
+       throws SAMLException{
+
        sharName=new StringBuffer();
        SAMLRequest sReq = binding.receive(req, sharName);
        SAMLAttributeQuery q = (SAMLAttributeQuery)sReq.getQuery();
@@ -36,7 +41,7 @@ public class AASaml {
        reqID = sReq.getRequestId();
        sub = q.getSubject();
     }
-       
+
     public String getHandle(){
        return sub.getName();
     }
@@ -105,5 +110,4 @@ public class AASaml {
            binding.respond(resp,sResp,ourSE);      
        }
     }
-
 }
index ae2a044..56d05ef 100755 (executable)
@@ -76,7 +76,10 @@ public class AAServlet extends HttpServlet {
        AASaml saml = null;
 
        try{
-           saml = new AASaml(req, myName);
+           System.out.println("AA about to make a saml obj");
+           saml = new AASaml(myName);
+           saml.receive(req);
+           System.out.println("AA received a query");
            String resource = saml.getResource();
            String handle = saml.getHandle();
            String shar = saml.getShar();
@@ -90,14 +93,12 @@ public class AAServlet extends HttpServlet {
 
        }catch (org.opensaml.SAMLException se) {
            ourSE = se;
+           
            //  }catch (HandleException he) {
            //      ourSE = new org.opensaml.SAMLException(org.opensaml.SAMLException.RESPONDER,"Bad Handle or Handle Service Problem: "+he);
        }catch (Exception e) {
            ourSE = new org.opensaml.SAMLException(org.opensaml.SAMLException.RESPONDER,"AA Failed with: "+e);
        }finally{
-
-           if(saml == null)
-               throw new ServletException("AA failed to build a request: "+ourSE);
            saml.respond(resp, attrs, ourSE);
        }
     }