You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ke...@apache.org on 2007/02/07 06:34:20 UTC

svn commit: r504443 - in /webservices/axis2/trunk/java/modules: codegen/src/org/apache/axis2/wsdl/codegen/emitter/ kernel/src/org/apache/axis2/description/

Author: keithc
Date: Tue Feb  6 21:34:18 2007
New Revision: 504443

URL: http://svn.apache.org/viewvc?view=rev&rev=504443
Log:
Fixing WSDL11ToAxisServiceBuilder to pick first soap port when no port name is given

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?view=diff&rev=504443&r1=504442&r2=504443
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Tue Feb  6 21:34:18 2007
@@ -1944,6 +1944,8 @@
         String mep = (String) getBindingPropertyFromOperation(WSDL2Constants.ATTR_WSOAP_MEP,
                                                               axisOperation.getName());
 
+        String bindingType = axisBinding.getType();
+
         if (WSDL2Constants.URI_WSOAP_MEP.equalsIgnoreCase(mep)) {
             methodElement.appendChild(generateOptionParamComponent(doc,
                                                                    "org.apache.axis2.Constants.Configuration.ENABLE_REST",
@@ -1959,7 +1961,7 @@
                                                                    "\"" +
                                                                            "org.apache.axis2.transport.http.HTTPConstants.MEDIA_TYPE_X_WWW_FORM" +
                                                                            "\""));
-        } else if (axisBinding.getType().equals(WSDL2Constants.URI_WSDL2_HTTP)) {
+        } else if (bindingType != null && bindingType.equals(WSDL2Constants.URI_WSDL2_HTTP)) {
 
             methodElement.appendChild(generateOptionParamComponent(doc,
                                                                    "org.apache.axis2.Constants.Configuration.ENABLE_REST",

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?view=diff&rev=504443&r1=504442&r2=504443
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Tue Feb  6 21:34:18 2007
@@ -298,7 +298,7 @@
 
             axisService.setName(wsdl4jService.getQName().getLocalPart());
 
-            populateEndpoints(axisService, wsdl4jService);
+            populateEndpoints(binding, wsdl4jService);
 
             return axisService;
         } catch (WSDLException e) {
@@ -314,8 +314,9 @@
      *
      *
      */
-    public void populateEndpoints(AxisService axisService, Service wsdl4jService) throws AxisFault {
+    public void populateEndpoints(Binding binding, Service wsdl4jService) throws AxisFault {
         Map wsdl4jPorts = wsdl4jService.getPorts();
+        QName soapBindingName = binding.getQName();
 
         if (wsdl4jPorts.size() < 1) {
             throw new AxisFault(
@@ -332,13 +333,16 @@
 
             axisEndpoint.setName(port.getName());
             populateEndpoint(axisEndpoint, port);
-
+            if (axisService.getEndpointName() == null && soapBindingName.equals(axisEndpoint.getBinding().getName())) {
+                axisService.setEndpointName(axisEndpoint.getName());
+                axisService.setBindingName(axisEndpoint.getBinding().getName().getLocalPart());
+            }
             axisService.addEndpoint(port.getName(), axisEndpoint);
         }
 
         if (this.portName != null) {
             axisService.setEndpointName(this.portName);
-            axisEndpoint = (AxisEndpoint) axisService.getEndpoint(portName);
+            axisEndpoint = axisService.getEndpoint(portName);
             if (axisEndpoint != null) {
                 axisService.setBindingName(axisEndpoint.getBinding().getName().getLocalPart());
             } else {
@@ -346,10 +350,6 @@
             }
 
 
-        } else {
-            // FIXME Needs to find a porper soap port and then set that ..
-            axisService.setEndpointName(axisEndpoint.getName());
-            axisService.setBindingName(axisEndpoint.getBinding().getName().getLocalPart());
         }
     }
 
@@ -476,7 +476,7 @@
 
                 axisFaultMessage = new AxisMessage();
                 axisFaultMessage.setName(wsdl4jMessage.getQName().getLocalPart());
-
+                AddQNameReference(axisFaultMessage, wsdl4jMessage);
                 if (axisOperation.getFaultAction() == null) {
                     axisOperation.addFaultAction(fault.getName(),
                             WSDL11ActionHelper.getActionFromFaultElement(
@@ -590,6 +590,7 @@
                 axisBindingFaultMessage.setParent(axisBindingOperation);
 
                 axisBindingOperation.addFault(axisBindingFaultMessage);
+                axisBinding.addChild(axisBindingOperation.getName(), axisBindingOperation);
 
                 // FIXME
                 AddQNameReference(faultMessage, wsdl4jFault.getMessage());
@@ -1435,6 +1436,7 @@
             if (null != faultMessage) {
                 axisFaultMessage
                         .setName(faultMessage.getQName().getLocalPart());
+
                 copyExtensibleElements(faultMessage.getExtensibilityElements(),
                         dif, axisFaultMessage, PORT_TYPE_OPERATION_FAULT);
 
@@ -2142,7 +2144,7 @@
 
                 String soapAction = soapOperation.getSoapActionURI();
                 if (soapAction != null) {
-                    axisBindingOperation.setProperty(WSDL2Constants.ATTR_WSOAP_ACTION, soapOperation);
+                    axisBindingOperation.setProperty(WSDL2Constants.ATTR_WSOAP_ACTION, soapAction);
                     // FIXME
                     axisBindingOperation.getAxisOperation().setSoapAction(soapAction);
                     axisService.mapActionToOperation(soapAction, axisBindingOperation.getAxisOperation());

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?view=diff&rev=504443&r1=504442&r2=504443
==============================================================================
--- 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 Tue Feb  6 21:34:18 2007
@@ -298,9 +298,14 @@
             throw new AxisFault("HTTP Binding Extention not found");
         }
 
-        axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_TYPE,soapEndpointExtensions.getHttpAuthenticationScheme());
-        axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_REALM,soapEndpointExtensions.getHttpAuthenticationRealm());
+        if (soapEndpointExtensions != null) {
 
+            axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_TYPE,
+                                     soapEndpointExtensions.getHttpAuthenticationScheme());
+            axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_REALM,
+                                     soapEndpointExtensions.getHttpAuthenticationRealm());
+
+        }
         return axisEndpoint;
 
     }



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