axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r636600 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
Date Thu, 13 Mar 2008 01:48:45 GMT
Author: dims
Date: Wed Mar 12 18:48:40 2008
New Revision: 636600

URL: http://svn.apache.org/viewvc?rev=636600&view=rev
Log:
Fix for AXIS2-3148 - Endpoint Extension handling bug in WSDL20ToAxisServiceBuilder


Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java?rev=636600&r1=636599&r2=636600&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
Wed Mar 12 18:48:40 2008
@@ -64,6 +64,7 @@
 import org.apache.woden.wsdl20.extensions.http.HTTPBindingFaultExtensions;
 import org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensions;
 import org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions;
+import org.apache.woden.wsdl20.extensions.http.HTTPEndpointExtensions;
 import org.apache.woden.wsdl20.extensions.http.HTTPHeader;
 import org.apache.woden.wsdl20.extensions.http.HTTPLocation;
 import org.apache.woden.wsdl20.extensions.rpc.RPCInterfaceOperationExtensions;
@@ -383,32 +384,57 @@
         AxisEndpoint axisEndpoint = new AxisEndpoint();
         axisEndpoint.setName(endpoint.getName().toString());
         axisEndpoint.setEndpointURL(endpoint.getAddress().toString());
-        if (processedBindings.containsKey(endpoint.getBinding().getName())) {
-            axisEndpoint.setBinding(
-                    (AxisBinding) processedBindings.get(endpoint.getBinding().getName()));
+        Binding binding = endpoint.getBinding();
+        AxisBinding axisBinding = null;
+        if (processedBindings.containsKey(binding.getName())) {
+            axisBinding = (AxisBinding) processedBindings.get(binding.getName());
         } else {
-            axisEndpoint.setBinding(processBinding(endpoint.getBinding(), serviceInterface));
+            axisBinding = processBinding(binding, serviceInterface);
         }
+        axisEndpoint.setBinding(axisBinding);
+        
+        String bindingType = binding.getType().toString();
+        if (bindingType.equals(WSDL2Constants.URI_WSDL2_SOAP)) {
+            processSOAPBindingEndpointExtensions(endpoint, axisEndpoint);
+        } else if (bindingType.equals(WSDL2Constants.URI_WSDL2_HTTP)) {
+            processHTTPBindingEndpointExtensions(endpoint, axisEndpoint);
+        }
+        addDocumentation(axisEndpoint, endpoint.toElement());
+        return axisEndpoint;
+    }
 
-        SOAPEndpointExtensions soapEndpointExtensions;
+    private void processSOAPBindingEndpointExtensions(Endpoint endpoint, AxisEndpoint axisEndpoint)
throws AxisFault {
+        SOAPEndpointExtensions soapEndpointExtensions = null;
         try {
             soapEndpointExtensions = (SOAPEndpointExtensions) endpoint
                     .getComponentExtensionContext(new URI(WSDL2Constants.URI_WSDL2_SOAP));
         } catch (URISyntaxException e) {
-            throw new AxisFault("HTTP Binding Extention not found");
+            throw new AxisFault("SOAP Binding Endpoint Extension not found");
         }
 
         if (soapEndpointExtensions != null) {
-
             axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_TYPE,
                                      soapEndpointExtensions.getHttpAuthenticationScheme());
             axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_REALM,
                                      soapEndpointExtensions.getHttpAuthenticationRealm());
+        }
+    }
 
+    private void processHTTPBindingEndpointExtensions(Endpoint endpoint, AxisEndpoint axisEndpoint)
throws AxisFault {
+        HTTPEndpointExtensions httpEndpointExtensions = null;
+        try {
+            httpEndpointExtensions = (HTTPEndpointExtensions) endpoint
+                    .getComponentExtensionContext(new URI(WSDL2Constants.URI_WSDL2_HTTP));
+        } catch (URISyntaxException e) {
+            throw new AxisFault("HTTP Binding Endpoint Extension not found");
         }
-        addDocumentation(axisEndpoint, endpoint.toElement());
-        return axisEndpoint;
 
+        if (httpEndpointExtensions != null) {
+            axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_TYPE,
+                                     httpEndpointExtensions.getHttpAuthenticationScheme());
+            axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_REALM,
+                                     httpEndpointExtensions.getHttpAuthenticationRealm());
+        }
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message