Author: jkaputin
Date: Thu Nov 16 09:12:00 2006
New Revision: 475820

URL: http://svn.apache.org/viewvc?view=rev&rev=475820
Log:
WODEN-89 Added support for SOAP extensions to 
Endpoint when underlying protocol is HTTP
(i.e. for HTTP Auth Scheme and HTTP Auth Realm).

Added:
    
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPEndpointExtensionsImpl.java
    
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/soap/SOAPEndpointExtensions.java
Modified:
    
incubator/woden/trunk/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java
    
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java

Modified: 
incubator/woden/trunk/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java?view=diff&rev=475820&r1=475819&r2=475820
==============================================================================
--- 
incubator/woden/trunk/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java
 (original)
+++ 
incubator/woden/trunk/java/src/org/apache/woden/internal/util/ComponentModelBuilder.java
 Thu Nov 16 09:12:00 2006
@@ -40,7 +40,6 @@
 import org.apache.woden.internal.wsdl20.TypesImpl;
 import org.apache.woden.internal.wsdl20.extensions.ComponentExtensionsImpl;
 import org.apache.woden.internal.wsdl20.extensions.rpc.RPCConstants;
-import org.apache.woden.internal.wsdl20.extensions.soap.SOAPConstants;
 import org.apache.woden.wsdl20.Binding;
 import org.apache.woden.wsdl20.BindingFault;
 import org.apache.woden.wsdl20.BindingFaultReference;
@@ -50,7 +49,6 @@
 import org.apache.woden.wsdl20.InterfaceOperation;
 import org.apache.woden.wsdl20.extensions.ComponentExtensions;
 import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
-import org.apache.woden.wsdl20.extensions.soap.SOAPBindingExtensions;
 import org.apache.woden.wsdl20.xml.BindingElement;
 import org.apache.woden.wsdl20.xml.BindingFaultElement;
 import org.apache.woden.wsdl20.xml.BindingFaultReferenceElement;
@@ -102,8 +100,6 @@
     
     private URI fBindingType = null;
     
-    private boolean fIsSoapUnderlyingProtocolHttp = false;
-    
        public ComponentModelBuilder(DescriptionImpl desc) {
                fDesc = desc;
                // TODO fErrorRpt = errorRpt; see todo in 
buildElementDeclarations()
@@ -494,43 +490,13 @@
        private void buildEndpointExtensions(EndpointImpl endpoint) {
                
         /*
-         * Create a ComponentExtensions object for each registered extension
-         * namespace used within this endpoint by extension 
-         * elements or attributes.
+         * Create a ComponentExtensions subtype specific to the binding type.
          */
-               ExtensionRegistry er = fDesc.getExtensionRegistry();
-               URI[] extNamespaces = er
-                               
.queryComponentExtensionNamespaces(Endpoint.class);
-
-               for (int i = 0; i < extNamespaces.length; i++) {
-                       URI extNS = extNamespaces[i];
-                       if (endpoint.hasExtensionAttributesForNamespace(extNS)
-                                       || 
endpoint.hasExtensionElementsForNamespace(extNS)) {
-                               ComponentExtensions compExt = 
createComponentExtensions(
-                                               Endpoint.class, endpoint, 
extNS);
-                               endpoint.setComponentExtensions(extNS, compExt);
-                       }
-               }
         
-        if ((ComponentExtensions.URI_NS_SOAP.equals(fBindingType) && 
-                fIsSoapUnderlyingProtocolHttp) 
-                ||
-             ComponentExtensions.URI_NS_HTTP.equals(fBindingType)) {
-            
-            /*
-             * If the binding type is SOAP and the {soap underlying protocol}
-             * property is HTTP or if the binding type is HTTP, then if an 
-             * HTTPEndpointExtensions object has not already been created, 
-             * create one now.
-             */
-            if (endpoint
-                    
.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP) == null) {
-                ComponentExtensions compExt = createComponentExtensions(
-                        Endpoint.class, endpoint,
-                        ComponentExtensions.URI_NS_HTTP);
-                endpoint.setComponentExtensions(
-                        ComponentExtensions.URI_NS_HTTP, compExt);
-            }
+        if(fBindingType != null) {
+            ComponentExtensions compExt = createComponentExtensions(
+                    Endpoint.class, endpoint, fBindingType);
+            endpoint.setComponentExtensions(fBindingType, compExt);
         }
        }
 

Modified: 
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java?view=diff&rev=475820&r1=475819&r2=475820
==============================================================================
--- 
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java
 (original)
+++ 
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java
 Thu Nov 16 09:12:00 2006
@@ -31,6 +31,7 @@
 import 
org.apache.woden.internal.wsdl20.extensions.soap.SOAPBindingMessageReferenceExtensionsImpl;
 import 
org.apache.woden.internal.wsdl20.extensions.soap.SOAPBindingOperationExtensionsImpl;
 import org.apache.woden.internal.wsdl20.extensions.soap.SOAPConstants;
+import 
org.apache.woden.internal.wsdl20.extensions.soap.SOAPEndpointExtensionsImpl;
 import 
org.apache.woden.internal.wsdl20.extensions.soap.SOAPHeaderBlockDeserializer;
 import org.apache.woden.internal.wsdl20.extensions.soap.SOAPHeaderBlockImpl;
 import org.apache.woden.internal.wsdl20.extensions.soap.SOAPModuleDeserializer;
@@ -205,6 +206,10 @@
                registerComponentExtension(BindingFaultReference.class,
                                ComponentExtensions.URI_NS_SOAP,
                                SOAPBindingFaultReferenceExtensionsImpl.class);
+
+        registerComponentExtension(Endpoint.class,
+                ComponentExtensions.URI_NS_SOAP,
+                SOAPEndpointExtensionsImpl.class);
 
                // ------------ HTTP extension attributes ------------
 

Added: 
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPEndpointExtensionsImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPEndpointExtensionsImpl.java?view=auto&rev=475820
==============================================================================
--- 
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPEndpointExtensionsImpl.java
 (added)
+++ 
incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/soap/SOAPEndpointExtensionsImpl.java
 Thu Nov 16 09:12:00 2006
@@ -0,0 +1,63 @@
+/**
+ * Copyright 2006 Apache Software Foundation 
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); 
+ * you may not use this file except in compliance with the License. 
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0 
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+package org.apache.woden.internal.wsdl20.extensions.soap;
+
+import org.apache.woden.internal.wsdl20.extensions.ComponentExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.http.HTTPConstants;
+import org.apache.woden.wsdl20.extensions.http.HTTPAuthenticationScheme;
+import org.apache.woden.wsdl20.extensions.soap.SOAPEndpointExtensions;
+import org.apache.woden.wsdl20.xml.WSDLElement;
+import org.apache.woden.xml.HTTPAuthenticationSchemeAttr;
+import org.apache.woden.xml.StringAttr;
+
+/**
+ * This interface represents the properties from the HTTP namespace added to 
the
+ * WSDL 2.0 <code>Endpoint</code> component when the binding type is SOAP and 
the
+ * underlying protocol is HTTP.
+ * 
+ * @author Arthur Ryman ([EMAIL PROTECTED], [EMAIL PROTECTED])
+ * 
+ */
+public class SOAPEndpointExtensionsImpl extends ComponentExtensionsImpl
+               implements SOAPEndpointExtensions {
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see 
org.apache.woden.wsdl20.extensions.soap.SOAPEndpointExtensions#getHttpAuthenicationScheme()
+        */
+       public HTTPAuthenticationScheme getHttpAuthenicationScheme() {
+
+               HTTPAuthenticationSchemeAttr scheme = 
(HTTPAuthenticationSchemeAttr) ((WSDLElement) fParent)
+                               
.getExtensionAttribute(HTTPConstants.Q_ATTR_AUTHENTICATION_TYPE);
+
+               return scheme != null ? scheme.getScheme() : null;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see 
org.apache.woden.wsdl20.extensions.soap.SOAPEndpointExtensions#getHttpAuthenticationRealm()
+        */
+       public String getHttpAuthenticationRealm() {
+
+               StringAttr realm = (StringAttr) ((WSDLElement) fParent)
+                               
.getExtensionAttribute(HTTPConstants.Q_ATTR_AUTHENTICATION_REALM);
+
+               return realm != null ? realm.getString() : null;
+       }
+
+}

Added: 
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/soap/SOAPEndpointExtensions.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/soap/SOAPEndpointExtensions.java?view=auto&rev=475820
==============================================================================
--- 
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/soap/SOAPEndpointExtensions.java
 (added)
+++ 
incubator/woden/trunk/java/src/org/apache/woden/wsdl20/extensions/soap/SOAPEndpointExtensions.java
 Thu Nov 16 09:12:00 2006
@@ -0,0 +1,40 @@
+/**
+ * Copyright 2006 Apache Software Foundation 
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); 
+ * you may not use this file except in compliance with the License. 
+ * You may obtain a copy of the License at 
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0 
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ */
+package org.apache.woden.wsdl20.extensions.soap;
+
+import org.apache.woden.wsdl20.extensions.ComponentExtensions;
+import org.apache.woden.wsdl20.extensions.http.HTTPAuthenticationScheme;
+
+/**
+ * This interface represents the properties from the HTTP namespace added to 
the
+ * WSDL 2.0 <code>Endpoint</code> component when the binding type is SOAP and 
the
+ * underlying protocol is HTTP.
+ * <p>
+ * These include:
+ * <ul>
+ * <li>{http authentication scheme}</li>
+ * <li>{http authentication realm}</li>
+ * </ul>
+ * 
+ * @author Arthur Ryman ([EMAIL PROTECTED], [EMAIL PROTECTED])
+ * 
+ */
+public interface SOAPEndpointExtensions extends ComponentExtensions {
+
+       public HTTPAuthenticationScheme getHttpAuthenicationScheme();
+
+       public String getHttpAuthenticationRealm();
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to