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 2006/11/29 10:35:03 UTC

svn commit: r480495 - in /webservices/axis2/branches/java/WSDL_2_0/modules: codegen/src/org/apache/axis2/wsdl/codegen/emitter/ kernel/src/org/apache/axis2/description/

Author: keithc
Date: Wed Nov 29 01:35:01 2006
New Revision: 480495

URL: http://svn.apache.org/viewvc?view=rev&rev=480495
Log:
Added Binding

Modified:
    webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
    webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
    webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL2Constants.java

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?view=diff&rev=480495&r1=480494&r2=480495
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Wed Nov 29 01:35:01 2006
@@ -19,7 +19,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.neethi.Policy;
 import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.woden.internal.util.dom.DOM2Writer;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.SOAP11Constants;
 //import org.apache.woden.internal.util.dom.DOM2Writer;
@@ -79,6 +78,8 @@
     protected static Map mepToClassMap;
     protected static Map mepToSuffixMap;
 
+    protected AxisBinding axisBinding;
+
     protected int uniqueFaultNameCounter = 0;
     /**
      * Field constructorMap
@@ -171,6 +172,7 @@
     public void setCodeGenConfiguration(CodeGenConfiguration configuration) {
         this.codeGenConfiguration = configuration;
         this.axisService = codeGenConfiguration.getAxisService();
+        this.axisBinding = axisService.getEndpoit(axisService.getEndpointName()).getBinding();
         resolver = new XSLTIncludeResolver(codeGenConfiguration);
     }
 
@@ -676,7 +678,7 @@
 
         Element endpointElement = doc.createElement("endpoint");
 
-        String endpoint = axisService.getEndpoint();
+        String endpoint = axisService.getEndpointName();
         Text text = doc.createTextNode((endpoint != null)
                 ? endpoint
                 : "");
@@ -1200,6 +1202,9 @@
 
         for (Iterator operationsIterator = axisService.getOperations();operationsIterator.hasNext();) {
             AxisOperation axisOperation = (AxisOperation) operationsIterator.next();
+
+            // Get the correct AxisBindingOperation coresponding to the AxisOperation
+            AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisBinding.getChild(axisOperation.getName());
             // Add the parameters to a map with their type as the key
             // this step is needed to remove repetitions
 

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/AxisService.java?view=diff&rev=480495&r1=480494&r2=480495
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/AxisService.java Wed Nov 29 01:35:01 2006
@@ -196,7 +196,7 @@
         return (AxisEndpoint)endpoitMap.get(key);
     }
 
-    public void addEndpoit(String key,AxisEndpoint axisEndpoint) {
+    public void addEndpoint(String key,AxisEndpoint axisEndpoint) {
         this.endpoitMap.put(key,axisEndpoint);
     }
 
@@ -294,11 +294,11 @@
     /**
      * get the endpoint
      */
-    public String getEndpoint() {
+    public String getEndpointName() {
         return endpoint;
     }
 
-    public void setEndpoint(String endpoint) {
+    public void setEndpointName(String endpoint) {
         this.endpoint = endpoint;
     }
 
@@ -1289,7 +1289,7 @@
                 new WSDL11ToAxisServiceBuilder(wsdlDefinition, wsdlServiceName, portName);
         serviceBuilder.setServerSide(false);
         AxisService axisService = serviceBuilder.populateService();
-        options.setTo(new EndpointReference(axisService.getEndpoint()));
+        options.setTo(new EndpointReference(axisService.getEndpointName()));
         options.setSoapVersionURI(axisService.getSoapNsUri());
         return axisService;
     }

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?view=diff&rev=480495&r1=480494&r2=480495
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java (original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Wed Nov 29 01:35:01 2006
@@ -1710,10 +1710,10 @@
                 // the items directly
             } else if (wsdl4jElement instanceof SOAP12Address) {
                 SOAP12Address soapAddress = (SOAP12Address) wsdl4jElement;
-                axisService.setEndpoint(soapAddress.getLocationURI());
+                axisService.setEndpointName(soapAddress.getLocationURI());
             } else if (wsdl4jElement instanceof SOAPAddress) {
                 SOAPAddress soapAddress = (SOAPAddress) wsdl4jElement;
-                axisService.setEndpoint(soapAddress.getLocationURI());
+                axisService.setEndpointName(soapAddress.getLocationURI());
             } else if (wsdl4jElement instanceof Schema) {
                 Schema schema = (Schema) wsdl4jElement;
                 // just add this schema - no need to worry about the imported

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java?view=diff&rev=480495&r1=480494&r2=480495
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java (original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java Wed Nov 29 01:35:01 2006
@@ -4,20 +4,17 @@
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.namespace.Constants;
-import org.apache.axis2.wsdl.SOAPHeaderMessage;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.woden.*;
 import org.apache.woden.internal.DOMWSDLFactory;
 import org.apache.woden.internal.wsdl20.extensions.soap.SOAPBindingExtensionsImpl;
 import org.apache.woden.internal.wsdl20.extensions.http.HTTPBindingExtensionsImpl;
 import org.apache.woden.schema.Schema;
-import org.apache.woden.types.NCName;
 import org.apache.woden.wsdl20.*;
 import org.apache.woden.wsdl20.enumeration.Direction;
 import org.apache.woden.wsdl20.enumeration.MessageLabel;
 import org.apache.woden.wsdl20.extensions.ExtensionElement;
 import org.apache.woden.wsdl20.extensions.UnknownExtensionElement;
-import org.apache.woden.wsdl20.extensions.http.HTTPEndpointExtensions;
 import org.apache.woden.wsdl20.extensions.http.HTTPBindingFaultExtensions;
 import org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions;
 import org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensions;
@@ -203,6 +200,8 @@
             for (int i = 0; i < endpoints.length; ++i) {
                 if (this.interfaceName.equals(endpoints[i].getName().toString())) {
                     endpoint = endpoints[i];
+                    axisService.setEndpointName(endpoint.getName().toString());
+                    axisService.setBindingName(endpoint.getBinding().getName().getLocalPart());
                     break;  // found it.  Stop looking
                 }
             }
@@ -212,14 +211,14 @@
             }
 
             axisService
-                    .addEndpoit(endpoint.getName().toString(), processEndpoint(endpoint));
+                    .addEndpoint(endpoint.getName().toString(), processEndpoint(endpoint));
         }
         else{
 
 
         for (int i = 0; i < endpoints.length; i++) {
             axisService
-                    .addEndpoit(endpoints[i].getName().toString(), processEndpoint(endpoints[i]));
+                    .addEndpoint(endpoints[i].getName().toString(), processEndpoint(endpoints[i]));
         }
         }
 
@@ -776,6 +775,19 @@
         // assuming the style of the operations of WSDL 2.0 is always document, for the time being :)
         axisOperation.setStyle("document");
 
+
+        // The following can be used to capture the wsdlx:safe attribute
+
+//        InterfaceOperationExtensionsImpl interfaceOperationExtensions;
+//        try {
+//            interfaceOperationExtensions = (InterfaceOperationExtensionsImpl)operation.getComponentExtensionsForNamespace(new URI(WSDL2Constants.URI_WSDL2_EXTENSIONS));
+//        } catch (URISyntaxException e) {
+//            throw new AxisFault("WSDL2 extensions not defined for this operation");
+//        }
+//
+//        interfaceOperationExtensions.isSafety();
+
+
         InterfaceMessageReference[] interfaceMessageReferences = operation
                 .getInterfaceMessageReferences();
         for (int i = 0; i < interfaceMessageReferences.length; i++) {
@@ -902,14 +914,14 @@
                             .getNamespaceURI());
                 } else if (WSDLConstants.WSDL11Constants.SOAP_12_ADDRESS.equals(unknown
                         .getExtensionType())) {
-                    axisService.setEndpoint(unknown.getElement().getAttributeValue(
+                    axisService.setEndpointName(unknown.getElement().getAttributeValue(
                             "location"));
 
                 }
 
                 // } else if (element instanceof SOAPAddress) {
                 // SOAPAddress soapAddress = (SOAPAddress) wsdl4jElement;
-                // axisService.setEndpoint(soapAddress.getLocationURI());
+                // axisService.setEndpointName(soapAddress.getLocationURI());
                 // } else if (wsdl4jElement instanceof Schema) {
                 // Schema schema = (Schema) wsdl4jElement;
                 // //just add this schema - no need to worry about the imported
@@ -1015,7 +1027,7 @@
         }
         axisService.setName(wsdlService.getName().getLocalPart());
         if (endpoint != null) {
-            axisService.setEndpoint(endpoint.getAddress().toString());
+            axisService.setEndpointName(endpoint.getAddress().toString());
             binding = endpoint.getBinding();
         }
         return binding;

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL2Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL2Constants.java?view=diff&rev=480495&r1=480494&r2=480495
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL2Constants.java (original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL2Constants.java Wed Nov 29 01:35:01 2006
@@ -24,6 +24,7 @@
     String DESCRIPTION = "description";
     String URI_WSDL2_SOAP = "http://www.w3.org/2006/01/wsdl/soap";
     String URI_WSDL2_HTTP = "http://www.w3.org/2006/01/wsdl/http";
+    String URI_WSDL2_EXTENSIONS = "http://www.w3.org/2006/01/wsdl-extensions";
     String SOAP_PREFIX = "wsoap";
     String URI_WSDL2_SOAP_ENV = "http://www.w3.org/2003/05/soap-envelope";
     String SOAP_ENV_PREFIX = "soap";



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