You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2006/01/02 11:14:29 UTC

svn commit: r365327 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/description/ core/src/org/apache/axis2/transport/http/ core/src/org/apache/axis2/util/ core/src/org/apache/axis2/util/threadpool/ core/webapp/ integration/test/or...

Author: deepal
Date: Mon Jan  2 02:13:57 2006
New Revision: 365327

URL: http://svn.apache.org/viewcvs?rev=365327&view=rev
Log:
- optimized imports
- fixing problems in Schema generator

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2WOM.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadPool.java
    webservices/axis2/trunk/java/modules/core/webapp/admin.jsp
    webservices/axis2/trunk/java/modules/core/webapp/engagingglobally.jsp
    webservices/axis2/trunk/java/modules/core/webapp/listService.jsp
    webservices/axis2/trunk/java/modules/core/webapp/listServices.jsp
    webservices/axis2/trunk/java/modules/core/webapp/listSingleService.jsp
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java
    webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/Java2WOM.java
    webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/SchemaGenerator.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java?rev=365327&r1=365326&r2=365327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java Mon Jan  2 02:13:57 2006
@@ -354,7 +354,8 @@
             WSDLDescription desc = axisService2WOM.generateWOM();
             
             // populate it with policy information ..
-            PolicyUtil.populatePolicy(desc, this);
+            //TODO : This gives an NPE , Sanka pls fix that
+//            PolicyUtil.populatePolicy(desc, this);
             
             WOMWriter womWriter = WOMWriterFactory.createWriter(org.apache.wsdl.WSDLConstants.WSDL_1_1);
             womWriter.setdefaultWSDLPrefix("wsdl");

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2WOM.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2WOM.java?rev=365327&r1=365326&r2=365327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2WOM.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2WOM.java Mon Jan  2 02:13:57 2006
@@ -39,20 +39,26 @@
     private XmlSchema schema;
     private AxisService axisService;
     private String url;
+    private String targetNamespece;
+    private String targetNamespecheprefix;
 
 
     public AxisService2WOM(XmlSchema schema, AxisService service,
-                           String targentNamespece,
+                           String targetNamespece,
                            String targetNamespecheprefix, String serviceURL) {
         this.schema = schema;
         this.axisService = service;
         url = serviceURL;
 
-        if (targentNamespece != null && !targentNamespece.trim().equals("")) {
-            SchemaGenerator.TARGET_NAMESPACE = targentNamespece;
+        if (targetNamespece != null && !targetNamespece.trim().equals("")) {
+            this.targetNamespece = targetNamespece;
+        } else {
+            this.targetNamespece = SchemaGenerator.TARGET_NAMESPACE;
         }
         if (targetNamespecheprefix != null && !targetNamespecheprefix.trim().equals("")) {
-            SchemaGenerator.TARGET_NAMESPACE_PREFIX = targetNamespecheprefix;
+            this.targetNamespecheprefix = targetNamespecheprefix;
+        } else {
+            this.targetNamespecheprefix = SchemaGenerator.TARGET_NAMESPACE_PREFIX;
         }
 
     }
@@ -70,18 +76,18 @@
         womDescription = wsdlComponentFactory.createDescription();
         HashMap namespaceMap = new HashMap();
         namespaceMap.put("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
-        namespaceMap.put(SchemaGenerator.TARGET_NAMESPACE_PREFIX, SchemaGenerator.TARGET_NAMESPACE);
+        namespaceMap.put(targetNamespecheprefix, targetNamespece);
         namespaceMap.put("ns1", "http://org.apache.axis2/xsd");
         namespaceMap.put("xs", "http://www.w3.org/2001/XMLSchema");
         womDescription.setNamespaces(namespaceMap);
-        womDescription.setTargetNameSpace(SchemaGenerator.TARGET_NAMESPACE);
+        womDescription.setTargetNameSpace(targetNamespece);
 
         //generating port type
         WSDLInterface portType = generatePortType(womDescription, wsdlComponentFactory, documentElement);
         womDescription.addInterface(portType);
 
-        QName bindingName = new QName(SchemaGenerator.TARGET_NAMESPACE, axisService.getName() + "Binding"
-                , SchemaGenerator.TARGET_NAMESPACE_PREFIX);
+        QName bindingName = new QName(targetNamespece, axisService.getName() + "Binding"
+                , targetNamespecheprefix);
         //generating binding
         WSDLBinding binding = generateBinding(wsdlComponentFactory,
                 portType,

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java?rev=365327&r1=365326&r2=365327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java Mon Jan  2 02:13:57 2006
@@ -25,7 +25,6 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.description.ParameterImpl;
-import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.transport.http.server.AdminAppException;
 
@@ -163,7 +162,7 @@
 
     private void engageModulesGlobally(HttpServletRequest req, HttpServletResponse res)
             throws IOException {
-        HashMap modules = ((AxisConfiguration) configContext.getAxisConfiguration()).getModules();
+        HashMap modules = configContext.getAxisConfiguration().getModules();
 
         req.getSession().setAttribute(Constants.MODULE_MAP, modules);
 
@@ -187,7 +186,7 @@
 
     private void engageModulesToOperation(HttpServletRequest req, HttpServletResponse res)
             throws IOException {
-        HashMap modules = ((AxisConfiguration) configContext.getAxisConfiguration()).getModules();
+        HashMap modules = configContext.getAxisConfiguration().getModules();
 
         req.getSession().setAttribute(Constants.MODULE_MAP, modules);
 
@@ -233,7 +232,7 @@
 
     private void engageModulesToService(HttpServletRequest req, HttpServletResponse res)
             throws IOException {
-        HashMap modules = ((AxisConfiguration) configContext.getAxisConfiguration()).getModules();
+        HashMap modules = configContext.getAxisConfiguration().getModules();
 
         req.getSession().setAttribute(Constants.MODULE_MAP, modules);
 
@@ -269,7 +268,7 @@
 
     private void engageModulesToServiceGroup(HttpServletRequest req, HttpServletResponse res)
             throws IOException {
-        HashMap modules = ((AxisConfiguration) configContext.getAxisConfiguration()).getModules();
+        HashMap modules = configContext.getAxisConfiguration().getModules();
 
         req.getSession().setAttribute(Constants.MODULE_MAP, modules);
 
@@ -417,15 +416,14 @@
 
     private void listGloballyModules(HttpServletRequest req, HttpServletResponse res)
             throws IOException {
-        Collection modules =
-                ((AxisConfiguration) configContext.getAxisConfiguration()).getEngagedModules();
+        Collection modules = configContext.getAxisConfiguration().getEngagedModules();
 
         req.getSession().setAttribute(Constants.MODULE_MAP, modules);
         res.sendRedirect(LIST_GLOABLLY_ENGAGED_MODULES_JSP_NAME);
     }
 
     private void listModules(HttpServletRequest req, HttpServletResponse res) throws IOException {
-        HashMap modules = ((AxisConfiguration) configContext.getAxisConfiguration()).getModules();
+        HashMap modules = configContext.getAxisConfiguration().getModules();
 
         req.getSession().setAttribute(Constants.MODULE_MAP, modules);
         req.getSession().setAttribute(Constants.ERROR_MODULE_MAP,
@@ -469,7 +467,7 @@
             if (serviceObj != null) {
                 if (wsdl != null) {
                     res.setContentType("text/xml");
-                    ((AxisService) serviceObj).printWSDL(out,filePart);
+                    ((AxisService) serviceObj).printWSDL(out, filePart);
 
 //                    PrintWriter out_writer = new PrintWriter(out);
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java?rev=365327&r1=365326&r2=365327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/Utils.java Mon Jan  2 02:13:57 2006
@@ -86,7 +86,8 @@
         return createSimpleService(serviceName, new RawXMLINOutMessageReceiver(), className,
                 opName);
     }
-     public static AxisService createSimpleServiceforClient(QName serviceName, String className, QName opName)
+
+    public static AxisService createSimpleServiceforClient(QName serviceName, String className, QName opName)
             throws AxisFault {
         return createSimpleServiceforClient(serviceName, new RawXMLINOutMessageReceiver(), className,
                 opName);
@@ -166,8 +167,6 @@
                                                         AxisService axisService, ConfigurationContext configurationContext) {
 
         // 2. if null, create new opCtxt
-        OperationContext operationContext = new OperationContext(axisOperation);
-
         // fill the service group context and service context info
         return fillServiceContextAndServiceGroupContext(axisService, configurationContext);
     }
@@ -240,6 +239,22 @@
             return null;
         } else {
             return (String) param.getValue();
+        }
+    }
+
+    /**
+     * To get the name of the module , where archive name is combination of module name + its version
+     * The format of the module version will be like follow
+     * moduleName-00.0000 as an exmple addressing-01.0001.aar
+     */
+
+    public static String getModuleName(String moduleName) {
+        char version_seperator = '-';
+        int version_index = moduleName.indexOf(version_seperator);
+        if (version_index > 0) {
+            return moduleName.substring(0, version_index);
+        } else {
+            return moduleName;
         }
     }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadPool.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadPool.java?rev=365327&r1=365326&r2=365327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadPool.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadPool.java Mon Jan  2 02:13:57 2006
@@ -17,21 +17,15 @@
 
 package org.apache.axis2.util.threadpool;
 
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.SynchronousQueue;
+import edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor;
+import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.i18n.Messages;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import edu.emory.mathcs.backport.java.util.concurrent.Executor;
-import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
-import edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor;
-import edu.emory.mathcs.backport.java.util.concurrent.SynchronousQueue;
-
 /**
  * This the thread pool for axis2. This class will be used a singleton
  * across axis2 engine. <code>ThreadPool</code> is accepts <code>AxisWorkers</code> which has
@@ -44,7 +38,7 @@
     private static int MAX_THREAD_COUNT = 10;
     private static boolean shutDown;
     protected ThreadPoolExecutor executor;
-    
+
     public ThreadPool() {
         setExecutor(createDefaultExecutor("Axis2 Task", Thread.NORM_PRIORITY, true));
     }

Modified: webservices/axis2/trunk/java/modules/core/webapp/admin.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/admin.jsp?rev=365327&r1=365326&r2=365327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/webapp/admin.jsp (original)
+++ webservices/axis2/trunk/java/modules/core/webapp/admin.jsp Mon Jan  2 02:13:57 2006
@@ -31,6 +31,6 @@
       }
   %>
 <jsp:include page="include/adminheader.jsp"></jsp:include>
-<h1>Welcome to the Axis2 administration system!</h1>
+<h1>Welcome to the Axis2 web admin module!</h1>
 <p>The Axis2 administration system can be used to check on the health of your Axis2 deployment as well as to change any parameters at run time. Other than changing of parameters the web interface also has the ability to upload new services into Axis2[Service hot deployment.].</p>
 <jsp:include page="include/adminfooter.jsp"></jsp:include>

Modified: webservices/axis2/trunk/java/modules/core/webapp/engagingglobally.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/engagingglobally.jsp?rev=365327&r1=365326&r2=365327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/webapp/engagingglobally.jsp (original)
+++ webservices/axis2/trunk/java/modules/core/webapp/engagingglobally.jsp Mon Jan  2 02:13:57 2006
@@ -66,6 +66,4 @@
                   <p><font color="blue"><%=status%></font></p>
                   <%
               } %>
-<jsp:include page="include/adminfooter.jsp"></jsp:include>
-
-
+<jsp:include page="include/adminfooter.jsp"></jsp:include>
\ No newline at end of file

Modified: webservices/axis2/trunk/java/modules/core/webapp/listService.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/listService.jsp?rev=365327&r1=365326&r2=365327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/webapp/listService.jsp (original)
+++ webservices/axis2/trunk/java/modules/core/webapp/listService.jsp Mon Jan  2 02:13:57 2006
@@ -47,7 +47,7 @@
          boolean status = false;
          if (serviceMap!=null && !serviceMap.isEmpty()){
              HashMap operations;
-             String serviceName = "";
+             String serviceName ;
              Collection servicecol = serviceMap.values();
              Collection operationsList;
              for (Iterator iterator = servicecol.iterator(); iterator.hasNext();) {
@@ -60,7 +60,7 @@
      <h4>Service Description : <font color="black"><%=axisService.getServiceDescription()%></h4>
            <%
                  Collection engagedModules = axisService.getEngagedModules();
-                 String moduleName = "";
+                 String moduleName;
 		boolean modules_present=false;
                  if(engagedModules.size() >0){
            %>
@@ -93,9 +93,7 @@
                 %><li><%=axisOperation.getName().getLocalPart()%></li>
 <%--                 <br>Operation EPR : <%=prifix + axisService.getName().getLocalPart() + "/"+ axisOperation.getName().getLocalPart()%>--%>
                  <%
-                     engagedModules = null;
                      engagedModules = axisOperation.getEngagedModules();
-                     moduleName = "";
                      if(engagedModules.size() >0){
                 %>
                 <br><i>Engaged Modules for the Operation</i><ul>
@@ -133,4 +131,4 @@
                     %> There seems to be no services listed! Try hitting refresh <%
                }
                     %>
-<jsp:include page="include/adminfooter.jsp"></jsp:include>
+<jsp:include page="include/adminfooter.jsp"></jsp:include>
\ No newline at end of file

Modified: webservices/axis2/trunk/java/modules/core/webapp/listServices.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/listServices.jsp?rev=365327&r1=365326&r2=365327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/webapp/listServices.jsp (original)
+++ webservices/axis2/trunk/java/modules/core/webapp/listServices.jsp Mon Jan  2 02:13:57 2006
@@ -43,7 +43,7 @@
          boolean status = false;
         if (serviceMap!=null && !serviceMap.isEmpty()){
         HashMap operations;
-        String serviceName = "";
+        String serviceName ;
         Collection servicecol = serviceMap.values();
         Collection operationsList;
        for (Iterator iterator = servicecol.iterator(); iterator.hasNext();) {

Modified: webservices/axis2/trunk/java/modules/core/webapp/listSingleService.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/webapp/listSingleService.jsp?rev=365327&r1=365326&r2=365327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/webapp/listSingleService.jsp (original)
+++ webservices/axis2/trunk/java/modules/core/webapp/listSingleService.jsp Mon Jan  2 02:13:57 2006
@@ -24,8 +24,4 @@
         %>
 
         </body>
-</html>
-
-
-<%--        <jsp:include page="include/link-footer.inc"></jsp:include>--%>
-<%--        <jsp:include page="include/footer.inc"></jsp:include>--%>
+</html>
\ No newline at end of file

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java?rev=365327&r1=365326&r2=365327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java Mon Jan  2 02:13:57 2006
@@ -21,6 +21,8 @@
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.Options;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.databinding.utils.BeanUtil;
@@ -37,6 +39,7 @@
 import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
 import org.apache.axis2.receivers.AbstractMessageReceiver;
 import org.apache.axis2.rpc.client.RPCCall;
+import org.apache.axis2.rpc.client.RPCServiceClient;
 import org.apache.axis2.rpc.receivers.RPCMessageReceiver;
 import org.apache.axis2.soap.SOAPEnvelope;
 import org.apache.axis2.soap.SOAPFactory;
@@ -127,6 +130,15 @@
 
 
         SOAPEnvelope env = call.invokeBlocking("echoString", envelope);
+
+        ConfigurationContextFactory configfactory = new ConfigurationContextFactory();
+        ConfigurationContext configContext = configfactory.buildConfigurationContext(
+                "target/test-resources/integrationRepo");
+        RPCServiceClient sender = new RPCServiceClient(configContext);
+        sender.setOptions(options);
+        options.setTo(targetEPR);
+
+
         assertEquals(env.getBody().getFirstElement().getFirstElement().getText(), "hello Axis2");
     }
 

Modified: webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/Java2WOM.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/Java2WOM.java?rev=365327&r1=365326&r2=365327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/Java2WOM.java (original)
+++ webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/Java2WOM.java Mon Jan  2 02:13:57 2006
@@ -10,9 +10,9 @@
 import org.apache.wsdl.extensions.impl.SOAPBodyImpl;
 import org.apache.wsdl.extensions.impl.SOAPOperationImpl;
 import org.apache.wsdl.impl.WSDLDescriptionImpl;
+import org.codehaus.jam.JMethod;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-import org.codehaus.jam.JMethod;
 
 import javax.xml.namespace.QName;
 import javax.xml.parsers.DocumentBuilder;
@@ -44,6 +44,8 @@
     private JMethod method [];
     private XmlSchema schema;
     private String serviceName;
+    private String targentNamespece;
+    private String targetNamespecheprefix;
 
     public Java2WOM(TypeTable table, JMethod[] method, XmlSchema schema, String serviceName,
                     String targentNamespece,
@@ -54,10 +56,10 @@
         this.serviceName = serviceName;
 
         if (targentNamespece != null && !targentNamespece.trim().equals("")) {
-            SchemaGenerator.TARGET_NAMESPACE = targentNamespece;
+            this.targentNamespece = targentNamespece;
         }
         if (targetNamespecheprefix != null && !targetNamespecheprefix.trim().equals("")) {
-            SchemaGenerator.TARGET_NAMESPACE_PREFIX = targetNamespecheprefix;
+            this.targetNamespecheprefix = targetNamespecheprefix;
         }
 
     }
@@ -75,18 +77,18 @@
         womDescription = wsdlComponentFactory.createDescription();
         HashMap namspaceMap = new HashMap();
         namspaceMap.put("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
-        namspaceMap.put(SchemaGenerator.TARGET_NAMESPACE_PREFIX, SchemaGenerator.TARGET_NAMESPACE);
+        namspaceMap.put(targetNamespecheprefix, targentNamespece);
         namspaceMap.put("ns1", "http://org.apache.axis2/xsd");
         namspaceMap.put("xs", "http://www.w3.org/2001/XMLSchema");
         womDescription.setNamespaces(namspaceMap);
-        womDescription.setTargetNameSpace(SchemaGenerator.TARGET_NAMESPACE);
+        womDescription.setTargetNameSpace(targentNamespece);
 
         //generating port type
         WSDLInterface portType = generatePortType(womDescription, wsdlComponentFactory, documentElement);
         womDescription.addInterface(portType);
 
-        QName bindingName = new QName(SchemaGenerator.TARGET_NAMESPACE, serviceName + "Binding"
-                , SchemaGenerator.TARGET_NAMESPACE_PREFIX);
+        QName bindingName = new QName(targentNamespece, serviceName + "Binding"
+                , targetNamespecheprefix);
         //generating binding
         WSDLBinding binding = generateBinding(wsdlComponentFactory,
                 portType,

Modified: webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/SchemaGenerator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/SchemaGenerator.java?rev=365327&r1=365326&r2=365327&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/SchemaGenerator.java (original)
+++ webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/SchemaGenerator.java Mon Jan  2 02:13:57 2006
@@ -39,29 +39,35 @@
 
     public static String METHOD_REQUEST_WRAPPER = "Request";
     public static String METHOD_RESPONSE_WRAPPER = "Response";
-    public static String TARGET_NAMESPACE = null;
+    public static String TARGET_NAMESPACE = "http://org.apache.axis2/";
     public static String SCHEMA_TARGET_NAMESPACE = "http://org.apache.axis2/xsd";
     public static String SCHEMA_NAMESPACE_PRFIX = "ns1";
     public static String TARGET_NAMESPACE_PREFIX = "tns";
+    private String scheamTargetNameSpace;
+    private String scheam_namespace_prefix;
 
     public SchemaGenerator(ClassLoader loader, String className,
                            String scheamtargetNamespace,
                            String scheamtargetNamespacePrefix) {
         this.classLoader = loader;
         this.className = className;
-        TARGET_NAMESPACE = "http://" + className;
+//        TARGET_NAMESPACE = "http://" + className;
         if (scheamtargetNamespace != null && !scheamtargetNamespace.trim().equals("")) {
-            SCHEMA_TARGET_NAMESPACE = scheamtargetNamespace;
+            this.scheamTargetNameSpace = scheamtargetNamespace;
+        } else {
+            this.scheamTargetNameSpace = SCHEMA_TARGET_NAMESPACE;
         }
         if (scheamtargetNamespacePrefix != null && !scheamtargetNamespacePrefix.trim().equals("")) {
-            SCHEMA_NAMESPACE_PRFIX = scheamtargetNamespacePrefix;
+            this.scheam_namespace_prefix = scheamtargetNamespacePrefix;
+        } else {
+            this.scheam_namespace_prefix = SCHEMA_NAMESPACE_PRFIX;
         }
         Hashtable prefixmap = new Hashtable();
-        prefixmap.put(SCHEMA_NAMESPACE_PRFIX, SCHEMA_TARGET_NAMESPACE);
+        prefixmap.put(this.scheam_namespace_prefix, this.scheamTargetNameSpace);
 
         XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
 
-        schema = new XmlSchema(SCHEMA_TARGET_NAMESPACE, schemaCollection);
+        schema = new XmlSchema(this.scheamTargetNameSpace, schemaCollection);
         schema.setElementFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED));
         schema.setPrefixToNamespaceMap(prefixmap);
         this.typeTable = new TypeTable();
@@ -198,8 +204,8 @@
 //        eltOuter.setSchemaTypeName(complexType.getQName());
         eltOuter.setSchemaType(complexType);
         // adding this type to the table
-        QName elementName = new QName(SchemaGenerator.SCHEMA_TARGET_NAMESPACE,
-                eltOuter.getName(), SCHEMA_NAMESPACE_PRFIX);
+        QName elementName = new QName(this.scheamTargetNameSpace,
+                eltOuter.getName(), this.scheam_namespace_prefix);
         typeTable.addComplexScheam(methodName + METHOD_REQUEST_WRAPPER, elementName);
 
         JParameter [] paras = method.getParameters();
@@ -255,8 +261,8 @@
             ret_eltOuter.setName(methodName + METHOD_RESPONSE_WRAPPER);
             schema.getItems().add(ret_eltOuter);
             ret_eltOuter.setSchemaType(retuen_com_type);
-            QName ret_comTypeName = new QName(SchemaGenerator.SCHEMA_TARGET_NAMESPACE,
-                    ret_eltOuter.getName(), SCHEMA_NAMESPACE_PRFIX);
+            QName ret_comTypeName = new QName(this.scheamTargetNameSpace,
+                    ret_eltOuter.getName(), this.scheam_namespace_prefix);
             typeTable.addComplexScheam(methodName + METHOD_RESPONSE_WRAPPER, ret_comTypeName);
             String classTypeName = retuenType.getQualifiedName();
             boolean isArryType = retuenType.isArrayType();
@@ -295,7 +301,7 @@
             XmlSchemaSequence sequence = new XmlSchemaSequence();
 
             XmlSchemaElement eltOuter = new XmlSchemaElement();
-            QName elemntName = new QName(SCHEMA_TARGET_NAMESPACE, simpleName, SCHEMA_NAMESPACE_PRFIX);
+            QName elemntName = new QName(this.scheamTargetNameSpace, simpleName, this.scheam_namespace_prefix);
             eltOuter.setName(simpleName);
             eltOuter.setQName(elemntName);
             complexType.setParticle(sequence);