axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r480531 - in /webservices/axis2/branches/java/WSDL_2_0/modules: codegen/src/org/apache/axis2/wsdl/codegen/emitter/ kernel/src/org/apache/axis2/description/
Date Wed, 29 Nov 2006 11:31:37 GMT
Author: chinthaka
Date: Wed Nov 29 03:31:36 2006
New Revision: 480531

URL: http://svn.apache.org/viewvc?view=rev&rev=480531
Log:
Making two distinct methods to set the endpoint name and endpoint URL

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

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=480531&r1=480530&r2=480531
==============================================================================
--- 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 03:31:36 2006
@@ -682,7 +682,7 @@
 
         Element endpointElement = doc.createElement("endpoint");
 
-        String endpoint = axisService.getEndpointName();
+        String endpoint = axisService.getEndpointURL();
         Text text = doc.createTextNode((endpoint != null)
                 ? endpoint
                 : "");

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=480531&r1=480530&r2=480531
==============================================================================
--- 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 03:31:36 2006
@@ -172,7 +172,8 @@
     private NamespaceMap nameSpacesMap;
 
     private String soapNsUri;
-    private String endpoint;
+    private String endpointName;
+    private String endpointURL;
 
     // Flag representing whether WS-Addressing is required to use this service.
     // Reflects the wsaw:UsingAddressing wsdl extension element
@@ -267,7 +268,7 @@
      * @return name of the port type
      */
     public String getPortTypeName() {
-        return endpoint;
+        return endpointName;
     }
 
     /**
@@ -275,7 +276,7 @@
      * @param portTypeName
      */
     public void setPortTypeName(String portTypeName) {
-        this.endpoint = portTypeName;
+        this.endpointName = portTypeName;
     }
 
     public String getBindingName() {
@@ -298,14 +299,14 @@
     }
 
     /**
-     * get the endpoint
+     * get the endpointName
      */
     public String getEndpointName() {
-        return endpoint;
+        return endpointName;
     }
 
     public void setEndpointName(String endpoint) {
-        this.endpoint = endpoint;
+        this.endpointName = endpoint;
     }
 
     /**
@@ -723,8 +724,8 @@
             }
         } else {
             setWsdlFound(true);
-            //pick the endpoint and take it as the epr for the WSDL
-            getWSDL(out, new String[]{this.endpoint}, "services");
+            //pick the endpointName and take it as the epr for the WSDL
+            getWSDL(out, new String[]{this.endpointName}, "services");
         }
     }
 
@@ -804,8 +805,8 @@
             }
         } else {
             setWsdlFound(true);
-            //pick the endpoint and take it as the epr for the WSDL
-            getWSDL2(out, new String[]{this.endpoint});
+            //pick the endpointName and take it as the epr for the WSDL
+            getWSDL2(out, new String[]{this.endpointName});
         }
     }
 
@@ -1845,5 +1846,13 @@
 
     public void addmessageNameToOperationMapping(String messageName, AxisOperation operation)
{
         messageNameToOperationsMap.put(messageName, operation);
+    }
+
+    public String getEndpointURL() {
+        return endpointURL;
+    }
+
+    public void setEndpointURL(String endpointURL) {
+        this.endpointURL = endpointURL;
     }
 }

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=480531&r1=480530&r2=480531
==============================================================================
--- 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 03:31:36 2006
@@ -1710,10 +1710,10 @@
                 // the items directly
             } else if (wsdl4jElement instanceof SOAP12Address) {
                 SOAP12Address soapAddress = (SOAP12Address) wsdl4jElement;
-                axisService.setEndpointName(soapAddress.getLocationURI());
+                axisService.setEndpointURL(soapAddress.getLocationURI());
             } else if (wsdl4jElement instanceof SOAPAddress) {
                 SOAPAddress soapAddress = (SOAPAddress) wsdl4jElement;
-                axisService.setEndpointName(soapAddress.getLocationURI());
+                axisService.setEndpointURL(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=480531&r1=480530&r2=480531
==============================================================================
--- 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 03:31:36 2006
@@ -202,6 +202,7 @@
                     endpoint = endpoints[i];
                     axisService.setEndpointName(endpoint.getName().toString());
                     axisService.setBindingName(endpoint.getBinding().getName().getLocalPart());
+                    axisService.setEndpointURL(endpoint.getAddress().toString());
                     break;  // found it.  Stop looking
                 }
             }
@@ -869,192 +870,6 @@
             axisService
                     .addmessageNameToOperationMapping(elementQName.getLocalPart(), axisOperation);
         }
-    }
-
-    /**
-     * CAUTION : Do not call this method. This is just for reference and will be deleted,
ASAP.
-     *
-     * @param extensionElement
-     * @param descriptionElement
-     * @param description
-     * @param originOfExtensibilityElements
-     */
-    private void copyExtensibleElements(ExtensionElement[] extensionElement,
-                                        DescriptionElement descriptionElement,
-                                        AxisDescription description,
-                                        String originOfExtensibilityElements) {
-        for (int i = 0; i < extensionElement.length; i++) {
-            ExtensionElement element = extensionElement[i];
-
-            if (element instanceof UnknownExtensionElement) {
-                UnknownExtensionElement unknown = (UnknownExtensionElement) element;
-
-                // look for the SOAP 1.2 stuff here. WSDL4j does not understand
-                // SOAP 1.2 things
-                // TODO this is wrong. Compare this with WSDL 2.0 QName
-                if (WSDLConstants.WSDL11Constants.SOAP_12_OPERATION.equals(unknown
-                        .getExtensionType())) {
-                    XMLElement unknownElement = unknown.getElement();
-                    if (description instanceof AxisOperation) {
-                        AxisOperation axisOperation = (AxisOperation) description;
-                        String style = unknownElement.getAttributeValue("style");
-                        if (style != null) {
-                            axisOperation.setStyle(style);
-                        }
-                        axisOperation.setSoapAction(unknownElement
-                                .getAttributeValue("soapAction"));
-                    }
-                } else if (WSDLConstants.WSDL11Constants.SOAP_12_HEADER.equals(unknown
-                        .getExtensionType())) {
-                    // TODO : implement thid
-                } else if (WSDLConstants.WSDL11Constants.SOAP_12_BINDING.equals(unknown
-                        .getExtensionType())) {
-                    style = unknown.getElement().getAttributeValue("style");
-                    axisService.setSoapNsUri(element.getExtensionType()
-                            .getNamespaceURI());
-                } else if (WSDLConstants.WSDL11Constants.SOAP_12_ADDRESS.equals(unknown
-                        .getExtensionType())) {
-                    axisService.setEndpointName(unknown.getElement().getAttributeValue(
-                            "location"));
-
-                }
-
-                // } else if (element instanceof SOAPAddress) {
-                // SOAPAddress soapAddress = (SOAPAddress) wsdl4jElement;
-                // axisService.setEndpointName(soapAddress.getLocationURI());
-                // } else if (wsdl4jElement instanceof Schema) {
-                // Schema schema = (Schema) wsdl4jElement;
-                // //just add this schema - no need to worry about the imported
-                // ones
-                // axisService.addSchema(getXMLSchema(schema.getElement(),
-                // wsdl4jDefinition.getDocumentBaseURI()));
-                // } else if
-                // (SOAPConstants.Q_ELEM_SOAP_OPERATION.equals(wsdl4jElement
-                // .getElementType())) {
-                // SOAPOperation soapOperation = (SOAPOperation) wsdl4jElement;
-                // if (description instanceof AxisOperation) {
-                // AxisOperation axisOperation = (AxisOperation) description;
-                // if (soapOperation.getStyle() != null) {
-                // axisOperation.setStyle(soapOperation.getStyle());
-                // }
-                // axisOperation.setSoapAction(soapOperation
-                // .getSoapActionURI());
-                // }
-                // } else if
-                // (SOAPConstants.Q_ELEM_SOAP_HEADER.equals(wsdl4jElement
-                // .getElementType())) {
-                // SOAPHeader soapHeader = (SOAPHeader) wsdl4jElement;
-                // SOAPHeaderMessage headerMessage = new SOAPHeaderMessage();
-                // headerMessage.setNamespaceURI(soapHeader.getNamespaceURI());
-                // headerMessage.setUse(soapHeader.getUse());
-                // Boolean required = soapHeader.getRequired();
-                // if (null != required) {
-                // headerMessage.setRequired(required.booleanValue());
-                // }
-                // if (null != wsdl4jDefinition) {
-                // //find the relevant schema part from the messages
-                // Message msg = wsdl4jDefinition.getMessage(soapHeader
-                // .getMessage());
-                // Part msgPart = msg.getPart(soapHeader.getPart());
-                // headerMessage.setElement(msgPart.getElementName());
-                // }
-                // headerMessage.setMessage(soapHeader.getMessage());
-                //
-                // headerMessage.setPart(soapHeader.getPart());
-                // if (description instanceof AxisMessage) {
-                // ((AxisMessage) description).addSoapHeader(headerMessage);
-                // }
-                // } else if
-                // (SOAPConstants.Q_ELEM_SOAP_BINDING.equals(wsdl4jElement
-                // .getElementType())) {
-                // SOAPBinding soapBinding = (SOAPBinding) wsdl4jElement;
-                // style = soapBinding.getStyle();
-                // axisService.setSoapNsUri(soapBinding.getElementType()
-                // .getNamespaceURI());
-                // }
-            }
-        }
-    }
-
-
-    private Binding findBinding() throws AxisFault {
-        Service[] services = description.getServices();
-        wsdlService = null;
-        Endpoint endpoint = null;
-        Binding binding = null;
-
-        if (services.length == 0) {
-            throw new AxisFault("No wsdlService found in the WSDL");
-        }
-
-        if (serviceName != null) {
-            for (int i = 0; i < services.length; i++) {
-                if (serviceName.equals(services[i].getName())) {
-                    wsdlService = services[i];
-                    break;  // found it. Stop looking.
-                }
-            }
-            if (wsdlService == null) {
-                throw new AxisFault("Service not found the WSDL "
-                        + serviceName.getLocalPart());
-            }
-        } else {
-            // If no particular wsdlService is mentioned select the first one.
-            wsdlService = services[0];
-        }
-        Endpoint[] endpoints = wsdlService.getEndpoints();
-        if (this.interfaceName != null) {
-
-            if (endpoints.length == 0) {
-                throw new AxisFault("No Endpoints/Ports found in the wsdlService:"
-                        + wsdlService.getName().getLocalPart());
-            }
-
-            for (int i = 0; i < endpoints.length; ++i) {
-                if (this.interfaceName.equals(endpoints[i].getName().toString())) {
-                    endpoint = endpoints[i];
-                    break;  // found it.  Stop looking
-                }
-            }
-            if (endpoint == null) {
-                throw new AxisFault("No port found for the given name :"
-                        + this.interfaceName);
-            }
-        } else {
-            // if no particular endpoint is specified use the first one.
-            endpoint = endpoints[0];
-
-        }
-        axisService.setName(wsdlService.getName().getLocalPart());
-        if (endpoint != null) {
-            axisService.setEndpointName(endpoint.getAddress().toString());
-            binding = endpoint.getBinding();
-        }
-        return binding;
-    }
-
-    private Element[] generateWrapperSchema(
-            DescriptionElement wodenDescription, BindingElement binding) {
-
-        List schemaElementList = new ArrayList();
-        String targetNamespaceUri = wodenDescription.getTargetNamespace()
-                .toString();
-
-        // ///////////////////////////////////////////////////////////////////////////////////////////
-        // if there are any bindings present then we have to process them. we
-        // have to generate a schema
-        // per binding (that is the safest option). if not we just resolve to
-        // the good old port type
-        // list, in which case we'll generate a schema per porttype
-        // //////////////////////////////////////////////////////////////////////////////////////////
-
-        // FIXME @author Chathura Once this method is done we could run the
-        // basic codgen
-        schemaElementList.add(createSchemaForInterface(binding
-                .getInterfaceElement(), targetNamespaceUri,
-                findWrapForceable(binding)));
-        return (Element[]) schemaElementList
-                .toArray(new Element[schemaElementList.size()]);
     }
 
     private Element createSchemaForInterface(InterfaceElement interfaceElement,



---------------------------------------------------------------------
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