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 de...@apache.org on 2005/08/12 15:31:28 UTC

svn commit: r232284 - /webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java

Author: deepal
Date: Fri Aug 12 06:31:18 2005
New Revision: 232284

URL: http://svn.apache.org/viewcvs?rev=232284&view=rev
Log:
Fixed 145

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java?rev=232284&r1=232283&r2=232284&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/description/ServiceDescription.java Fri Aug 12 06:31:18 2005
@@ -608,35 +608,29 @@
         try {
             Definition wsdlDefinition = this.getWSDLDefinition();
             if (wsdlDefinition != null) {
-                Iterator sreviceitr = wsdlDefinition.getServices().keySet()
-                        .iterator();
-                while (sreviceitr.hasNext()) {
-                    wsdlDefinition.removeService((QName) sreviceitr.next());
-                }
+//                Iterator sreviceitr = wsdlDefinition.getServices().keySet()
+//                        .iterator();
+//                while (sreviceitr.hasNext()) {
+//                    wsdlDefinition.removeService((QName) sreviceitr.next());
+//                }
 
                 //  wsdlDefinition.removeService(this.getName());
+                Collection services =  wsdlDefinition.getServices().values();
 
-                Service service = wsdlDefinition.createService();
-                service.setQName(this.getName());
-
-                Port port = wsdlDefinition.createPort();
-                SOAPAddress soapAddress = new SOAPAddressImpl();
-                soapAddress.setElementType(SOAPConstants.Q_ELEM_SOAP_ADDRESS);
-                soapAddress.setLocationURI(PortURL);
-                port.addExtensibilityElement(soapAddress);
-                port.setName(this.getName().getLocalPart() + "Port");
-
-                Map bindingsMap = wsdlDefinition.getBindings();
-                Collection bind_col = bindingsMap.values();
-                for (Iterator iterator = bind_col.iterator();
-                     iterator.hasNext();) {
-                    Binding binding = (Binding) iterator.next();
-                    port.setBinding(binding);
-                    break;
+                for (Iterator iterator = services.iterator(); iterator.hasNext();) {
+                    Service service = (Service) iterator.next();
+                    Collection ports =  service.getPorts().values();
+                    for (Iterator iterator1 = ports.iterator(); iterator1.hasNext();) {
+                        Port port = (Port) iterator1.next();
+                        service.setQName(this.getName());
+                        SOAPAddress soapAddress = new SOAPAddressImpl();
+                        soapAddress.setElementType(SOAPConstants.Q_ELEM_SOAP_ADDRESS);
+                        soapAddress.setLocationURI(PortURL);
+                        port.getExtensibilityElements().clear();
+                        port.addExtensibilityElement(soapAddress);
+                    }
                 }
-                service.addPort(port);
 
-                wsdlDefinition.addService(service);
                 WSDLFactory.newInstance().newWSDLWriter().writeWSDL(
                         wsdlDefinition, out);
                 out.flush();