djencks     2005/05/16 20:29:27

  Modified:    modules/core/src/java/org/openejb/server/xfire
                        WSContainer.java WSContainerGBean.java
  Log:

  GERONIMO-648 ejb web services security
  
  Revision  Changes    Path
  1.11      +24 -12    
openejb/modules/core/src/java/org/openejb/server/xfire/WSContainer.java
  
  Index: WSContainer.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/server/xfire/WSContainer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- WSContainer.java  8 May 2005 19:37:08 -0000       1.10
  +++ WSContainer.java  17 May 2005 00:29:27 -0000      1.11
  @@ -88,7 +88,7 @@
       private final DefaultJavaService service;
       private final SoapHandler soapHandler;
       private final Byte wsdlMutext = new Byte((byte)0);
  -    
  +
       private transient WSDLWriter wsdlWriter;
       private transient Definition definition;
   
  @@ -100,7 +100,18 @@
           this.soapHandler = null;
       }
   
  -    public WSContainer(EJBContainer ejbContainer, Definition definition, URI 
location, URL wsdlURL, String namespace, String encoding, String style, 
SoapHandler soapHandler) throws Exception {
  +    public WSContainer(EJBContainer ejbContainer,
  +                       Definition definition,
  +                       URI location,
  +                       URL wsdlURL,
  +                       String namespace,
  +                       String encoding,
  +                       String style,
  +                       SoapHandler soapHandler,
  +                       String securityRealmName,
  +                       String realmName,
  +                       String transportGuarantee,
  +                       String authMethod) throws Exception {
           this.ejbContainer = ejbContainer;
           this.location = location;
           this.wsdlURL = wsdlURL;
  @@ -123,7 +134,8 @@
           configurator.configure();
           this.soapHandler = soapHandler;
           if (soapHandler != null) {
  -            soapHandler.addWebService(location.getPath(), this);
  +            ClassLoader classLoader = ejbContainer.getClassLoader();
  +            soapHandler.addWebService(location.getPath(), this, 
securityRealmName, realmName, transportGuarantee, authMethod, classLoader);
           }
       }
   
  @@ -161,15 +173,15 @@
       }
   
       public void getWsdl(Request request, Response response) throws Exception 
{
  -        
  +
           // Avoid concurrent modification of the WSDL dom.
           synchronized(wsdlMutext) {
  -            
  -            // Read in the the WSDL in once. 
  +
  +            // Read in the the WSDL in once.
               if( definition == null ) {
                   initWSDLDom();
               }
  -            
  +
               // Update all the service port soap address elements.
               Map services = definition.getServices();
               for (Iterator iter1 = services.values().iterator(); 
iter1.hasNext();) {
  @@ -181,12 +193,12 @@
                           ExtensibilityElement element = 
(ExtensibilityElement) iter3.next();
                           if (element instanceof SOAPAddress ) {
                               SOAPAddress soapAddress = (SOAPAddress)element;
  -                            URI realLocation = request.getURI();             
               
  +                            URI realLocation = request.getURI();
                               // We replace the host and port here.
                               URI updated = new URI(
                                       realLocation.getScheme(),
  -                                    realLocation.getUserInfo(), 
  -                                    realLocation.getHost(), 
  +                                    realLocation.getUserInfo(),
  +                                    realLocation.getHost(),
                                       realLocation.getPort(),
                                       realLocation.getPath(), // Humm is this 
right?
                                       null,
  @@ -196,7 +208,7 @@
                       }
                   }
               }
  -            
  +
               // Dump the WSDL dom to the output stream
               OutputStream out = response.getOutputStream();
               wsdlWriter.writeWSDL(definition, out);
  
  
  
  1.6       +10 -2     
openejb/modules/core/src/java/org/openejb/server/xfire/WSContainerGBean.java
  
  Index: WSContainerGBean.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/server/xfire/WSContainerGBean.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WSContainerGBean.java     8 May 2005 19:37:09 -0000       1.5
  +++ WSContainerGBean.java     17 May 2005 00:29:27 -0000      1.6
  @@ -77,6 +77,10 @@
           infoFactory.addAttribute("namespace", String.class, true);
           infoFactory.addAttribute("encoding", String.class, true);
           infoFactory.addAttribute("style", String.class, true);
  +        infoFactory.addAttribute("securityRealmName", String.class, true);
  +        infoFactory.addAttribute("realmName", String.class, true);
  +        infoFactory.addAttribute("transportGuarantee", String.class, true);
  +        infoFactory.addAttribute("authMethod", String.class, true);
           infoFactory.addReference("WebServiceContainer", SoapHandler.class, 
NameFactory.GERONIMO_SERVICE);
   
           infoFactory.setConstructor(new String[]{
  @@ -87,7 +91,11 @@
               "namespace",
               "encoding",
               "style",
  -            "WebServiceContainer"
  +            "WebServiceContainer",
  +            "securityRealmName",
  +            "realmName",
  +            "transportGuarantee",
  +            "authMethod"
           });
   
           GBEAN_INFO = infoFactory.getBeanInfo();
  
  
  

Reply via email to