juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svi...@apache.org
Subject cvs commit: ws-juddi/src/java/org/apache/juddi/registry RegistryServlet.java
Date Tue, 01 Mar 2005 14:03:38 GMT
sviens      2005/03/01 06:03:38

  Modified:    src/java/org/apache/juddi/transport/axis AxisProcessor.java
               src/java/org/apache/juddi/registry RegistryServlet.java
  Log:
  Added comments.
  
  Revision  Changes    Path
  1.9       +12 -9     ws-juddi/src/java/org/apache/juddi/transport/axis/AxisProcessor.java
  
  Index: AxisProcessor.java
  ===================================================================
  RCS file: /home/cvs/ws-juddi/src/java/org/apache/juddi/transport/axis/AxisProcessor.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AxisProcessor.java	1 Mar 2005 03:49:57 -0000	1.8
  +++ AxisProcessor.java	1 Mar 2005 14:03:38 -0000	1.9
  @@ -228,9 +228,13 @@
         String errCode = null;
         String errMsg = null;
         
  -      // If a RegistryException was thrown dig out the
  -      // dispositionReport if one exists and set the SOAP
  -      // Fault & DispositionReport values with what we find.
  +      // All RegistryException and subclasses of RegistryException
  +      // should contain values for populating a SOAP Fault as well
  +      // as a UDDI DispositionReport with specific information 
  +      // about the problem.
  +      //
  +      // We've got to dig out the dispositionReport and populate  
  +      // the SOAP Fault 'detail' element with this information.        
         
         if (ex instanceof RegistryException)
         {
  @@ -284,12 +288,11 @@
                    "occurred. Please report this error " +
                    "to the UDDI server administrator.";
         }
  -      
  -      // All other exceptions (other than RegistryException
  -      // and subclasses) are either a jUDDI configuration 
  -      // problem or something that we *should* be catching and
  -      // converting to a RegistryException but are not (yet!).
  -        
  +            
  +      // We should have everything we need to assemble 
  +      // the SOAPFault so lets piece it together and 
  +      // send it on it's way.
  +              
         try {
           SOAPBody soapResBody = soapResEnv.getBody();
           SOAPFault soapFault = soapResBody.addFault();
  
  
  
  1.11      +17 -22    ws-juddi/src/java/org/apache/juddi/registry/RegistryServlet.java
  
  Index: RegistryServlet.java
  ===================================================================
  RCS file: /home/cvs/ws-juddi/src/java/org/apache/juddi/registry/RegistryServlet.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- RegistryServlet.java	1 Mar 2005 03:49:57 -0000	1.10
  +++ RegistryServlet.java	1 Mar 2005 14:03:38 -0000	1.11
  @@ -32,7 +32,6 @@
   import javax.xml.soap.MessageFactory;
   import javax.xml.soap.SOAPBody;
   import javax.xml.soap.SOAPElement;
  -import javax.xml.soap.SOAPException;
   import javax.xml.soap.SOAPFault;
   import javax.xml.soap.SOAPMessage;
   
  @@ -214,7 +213,7 @@
         
       SOAPMessage soapReq = null;
       SOAPMessage soapRes = null;
  -    String generic = null; // TODO (Steve) References to generic should be renamed to "UDDI
Version or UDDI Namespace"
  +    String generic = null;
   
       try 
       {
  @@ -224,7 +223,6 @@
         MessageFactory msgFactory = MessageFactory.newInstance();
         soapReq = msgFactory.createMessage(null,req.getInputStream());
         soapRes = msgFactory.createMessage();
  -      //soapReq.writeTo(System.out);
              
         // Extract the UDDI request
   
  @@ -235,6 +233,8 @@
         // Grab the generic value - we'll need it in the event
         // that an exception is thrown.
   
  +      // TODO (Steve) We need to throw a UDDI Exception if a generic value is not specified
(or if it is specified to be something other than 2.0).
  +      
         generic = uddiReq.getAttribute("generic");
         if (generic == null)
           generic = IRegistry.UDDI_V2_GENERIC;
  @@ -269,7 +269,8 @@
         
         IHandler responseHandler = maker.lookup(uddiResObj.getClass().getName());
         if (responseHandler == null)
  -        throw new RegistryException(""); // TODO (Steve) need more info in this exception.
  +        throw new RegistryException("The response object " +
  +          "type is unknown: " +uddiResObj.getClass().getName());
         
         // Create a new 'temp' XML element to use as a container 
         // in which to marshal the UDDI response data into.
  @@ -305,9 +306,13 @@
         String errCode = null;
         String errMsg = null;
         
  -      // If a RegistryException was thrown dig out the
  -      // dispositionReport if one exists and set the SOAP
  -      // Fault & DispositionReport values with what we find.
  +      // All RegistryException and subclasses of RegistryException
  +      // should contain values for populating a SOAP Fault as well
  +      // as a UDDI DispositionReport with specific information 
  +      // about the problem.
  +      //
  +      // We've got to dig out the dispositionReport and populate  
  +      // the SOAP Fault 'detail' element with this information.        
         
         if (ex instanceof RegistryException)
         {
  @@ -359,11 +364,10 @@
                    "to the UDDI server administrator.";
         }
         
  -      // All other exceptions (other than RegistryException
  -      // and subclasses) are either a jUDDI configuration 
  -      // problem or something that we *should* be catching and
  -      // converting to a RegistryException but are not (yet!).
  -        
  +      // We should have everything we need to assemble 
  +      // the SOAPFault so lets piece it together and 
  +      // send it on it's way.
  +      
         try {
           SOAPBody soapResBody = soapRes.getSOAPBody();     
           SOAPFault soapFault = soapResBody.addFault();
  @@ -385,16 +389,7 @@
           errInfo.setValue(errMsg);
         } 
         catch (Exception e) { 
  -        e.printStackTrace(); 
  -      }
  -    }
  -    finally {
  -      try {               
  -        //soapRes.writeTo(System.out);     
  -        soapRes.writeTo(res.getOutputStream());     
  -      }
  -      catch(SOAPException sex) {
  -        log.error(sex);
  +        log.error("A serious error has occured while assembling the SOAP Fault.",e);
         }
       }
     }
  
  
  

Mime
View raw message