Author: sagara
Date: Sat Jul  7 18:08:21 2012
New Revision: 1358607

URL: http://svn.apache.org/viewvc?rev=1358607&view=rev
Log:
Applying  patch for AXIS2-5191.

Modified:
    
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService.java

Modified: 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService.java?rev=1358607&r1=1358606&r2=1358607&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService.java
 Sat Jul  7 18:08:21 2012
@@ -1166,6 +1166,23 @@ public class AxisService extends AxisDes
                }
 
        }
+       
+    public void printUserWSDL2(OutputStream out, String wsdlName, String ip) 
throws AxisFault {
+        Description description = null;
+        // first find the correct wsdl definition
+        Parameter wsdlParameter = 
getParameter(WSDLConstants.WSDL_20_DESCRIPTION);
+        if (wsdlParameter != null) {
+            description = (Description) wsdlParameter.getValue();
+            try {
+                org.apache.woden.WSDLFactory factory = 
org.apache.woden.WSDLFactory.newInstance();
+                org.apache.woden.WSDLWriter writer = factory.newWSDLWriter();
+                writer.writeWSDL(description.toElement(), out);
+            } catch (org.apache.woden.WSDLException e) {
+                throw AxisFault.makeFault(e);
+            }
+        }
+
+}
 
        /**
         * find the defintion object for given name
@@ -1784,6 +1801,11 @@ public class AxisService extends AxisDes
         * @throws AxisFault
         */
        public void printWSDL2(OutputStream out, String requestIP) throws 
AxisFault {
+        // If we're looking for pre-existing WSDL, use that.
+        if (isUseUserWSDL()) {
+            printUserWSDL2(out, null, requestIP);
+            return;
+        }
                AxisService2WSDL20 axisService2WSDL2 = new 
AxisService2WSDL20(this);
                
                // If we find a WSDLSupplier with WSDL 2.0 content, use that


Reply via email to