axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r372716 - in /webservices/axis2/trunk/java/modules: codegen/src/org/apache/axis2/rpc/receivers/ core/src/org/apache/axis2/deployment/ core/src/org/apache/axis2/deployment/util/ core/src/org/apache/axis2/description/ integration/test/org/apa...
Date Fri, 27 Jan 2006 03:41:02 GMT
Author: deepal
Date: Thu Jan 26 19:40:33 2006
New Revision: 372716

URL: http://svn.apache.org/viewcvs?rev=372716&view=rev
Log:
- added capability of adding namespace for service so if some one wants to give his name space
for service and schema ha can do that using folling way
  <service name="foo" scope="transport" targetNamespace="http://x.y.z"  namespacePrefix="ns1">
   <schema schemaNamespace="http://x.y.z"  namespacePrefix="ns2"/>
 </service> 
- improved RPCMessageReceiver to handle namespace correctly.

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/rpc/receivers/RPCInOnlyMessageReceiver.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceCreateTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/WSDLClientTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/TestingUtils.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCServiceClass.java
    webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/java2wsdl/SchemaGenerator.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/rpc/receivers/RPCInOnlyMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/rpc/receivers/RPCInOnlyMessageReceiver.java?rev=372716&r1=372715&r2=372716&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/rpc/receivers/RPCInOnlyMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/rpc/receivers/RPCInOnlyMessageReceiver.java
Thu Jan 26 19:40:33 2006
@@ -4,6 +4,7 @@
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.databinding.utils.BeanUtil;
 import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
 import org.apache.axis2.engine.DependencyManager;
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.receivers.AbstractInMessageReceiver;
@@ -35,7 +36,6 @@
     public void invokeBusinessLogic(MessageContext inMessage) throws AxisFault {
         try {
             // get the implementation class for the Web Service
-            //todo namespace   , checking
             Object obj = getTheImplementationObject(inMessage);
 
             Class ImplClass = obj.getClass();
@@ -43,12 +43,17 @@
 
             AxisOperation op = inMessage.getOperationContext().getAxisOperation();
 
+            AxisService service = inMessage.getAxisService();
             OMElement methodElement = inMessage.getEnvelope().getBody()
                     .getFirstElement();
+
+            if (!service.getSchematargetNamespace().equals(methodElement.getNamespace().getName()))
{
+                throw new AxisFault("namespace mismatch require " +
+                        service.getSchematargetNamespace() +
+                        " found " + methodElement.getNamespace().getName());
+            }
             String methodName = op.getName().getLocalPart();
             Method[] methods = ImplClass.getMethods();
-            //todo method validation has to be done
-            //Todo if we find the method it should be store , in AxisOperation
             for (int i = 0; i < methods.length; i++) {
                 if (methods[i].getName().equals(methodName)) {
                     this.method = methods[i];

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java?rev=372716&r1=372715&r2=372716&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
Thu Jan 26 19:40:33 2006
@@ -26,6 +26,7 @@
 import org.apache.axis2.databinding.typemapping.SimpleTypeMapper;
 import org.apache.axis2.databinding.utils.BeanUtil;
 import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
 import org.apache.axis2.engine.DependencyManager;
 import org.apache.axis2.om.OMAbstractFactory;
 import org.apache.axis2.om.OMElement;
@@ -71,20 +72,24 @@
     public void invokeBusinessLogic(MessageContext inMessage, MessageContext outMessage)
throws AxisFault {
         try {
             // get the implementation class for the Web Service
-            //todo namespace   , checking
             Object obj = getTheImplementationObject(inMessage);
 
             Class ImplClass = obj.getClass();
             DependencyManager.configureBusinessLogicProvider(obj, inMessage, null);
 
             AxisOperation op = inMessage.getOperationContext().getAxisOperation();
-
+            AxisService service = inMessage.getAxisService();
             OMElement methodElement = inMessage.getEnvelope().getBody()
                     .getFirstElement();
+
+            OMNamespace namespace = methodElement.getNamespace();
+            if (namespace==null || !service.getSchematargetNamespace().equals(namespace.getName()))
{
+                throw new AxisFault("namespace mismatch require " +
+                        service.getSchematargetNamespace() +
+                        " found " + methodElement.getNamespace().getName());
+            }
             String methodName = op.getName().getLocalPart();
             Method[] methods = ImplClass.getMethods();
-            //todo method validation has to be done
-            //Todo if we find the method it should be store , in AxisOperation
             for (int i = 0; i < methods.length; i++) {
                 if (methods[i].getName().equals(methodName)) {
                     this.method = methods[i];
@@ -98,14 +103,15 @@
             SOAPFactory fac = getSOAPFactory(inMessage);
 
             // Handling the response
-            //todo NameSpace has to be taken from the AxisService
-            OMNamespace ns = fac.createOMNamespace(
-                    "http://soapenc/", "res");
+            OMNamespace ns = fac.createOMNamespace(service.getSchematargetNamespace(),
+                    service.getSchematargetNamespacePrefix());
             SOAPEnvelope envelope = fac.getDefaultEnvelope();
             OMElement bodyContent = null;
 
             if (resObject instanceof Object[]) {
-                QName resName = new QName("http://soapenc/", method.getName() + "Response",
"res");
+                QName resName = new QName(service.getSchematargetNamespace(),
+                        method.getName() + "Response",
+                        service.getSchematargetNamespacePrefix());
                 OMElement bodyChild = getResponseElement(resName, (Object[]) resObject);
                 envelope.getBody().addChild(bodyChild);
             } else {
@@ -125,12 +131,14 @@
     }
 
     private OMElement getResponseElement(QName resname, Object [] objs) {
-        return BeanUtil.getOMElement(resname, objs,RETURN_WRAPPER);
+        return BeanUtil.getOMElement(resname, objs, RETURN_WRAPPER);
     }
 
-    private void processResponse(SOAPFactory fac, Object resObject, OMElement bodyContent,
OMNamespace ns, SOAPEnvelope envelope) {
+    private void processResponse(SOAPFactory fac, Object resObject,
+                                 OMElement bodyContent,
+                                 OMNamespace ns,
+                                 SOAPEnvelope envelope) {
         if (resObject != null) {
-            //todo first check to see where the desrilizer for the return object
             //simple type
             if (resObject instanceof OMElement) {
                 bodyContent = (OMElement) resObject;

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java?rev=372716&r1=372715&r2=372716&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
Thu Jan 26 19:40:33 2006
@@ -72,6 +72,11 @@
     // for parameters
     String ATTRIBUTE_NAME = "name";
     String TARGET_NAME_SPACE = "targetNamespace";
+    String TARGET_NAME_SPACE_PREFIX = "namespacePrefix";
+    String SCHEMA_NAME_SPACE_PREFIX = "namespacePrefix";
+    String SCHEMA_NAME_SPACE = "schemaNamespace";
+    String SCHEMA = "schema";
+
     String ATTRIBUTE_DEFAULT_VERSION = "version";
     String ATTRIBUTE_SCOPE = "scope";
     String ATTRIBUTE_LOCKED = "locked";

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java?rev=372716&r1=372715&r2=372716&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
Thu Jan 26 19:40:33 2006
@@ -89,11 +89,50 @@
                 }
             }
 
-            OMAttribute targetNameSpace = service_element.getAttribute(new QName(TARGET_NAME_SPACE));
+            //Setting service tratget namespace if any
+            OMAttribute targetNameSpace = service_element.
+                    getAttribute(new QName(TARGET_NAME_SPACE));
             if (targetNameSpace != null) {
                 String nameSpeceVale = targetNameSpace.getAttributeValue();
+                if (nameSpeceVale != null && !"".equals(nameSpeceVale)) {
+                    service.setTargetNamespace(nameSpeceVale);
+                }
+            }
+
+            //Setting service tratget namespace prefix if any
+            OMAttribute targetNameSpaceprfix = service_element.
+                    getAttribute(new QName(TARGET_NAME_SPACE_PREFIX));
+            if (targetNameSpaceprfix != null) {
+                String prefix = targetNameSpace.getAttributeValue();
+                if (prefix != null && !"".equals(prefix)) {
+                    service.setTargetNamespacePrefix(prefix);
+                }
             }
 
+            //Setting schema namespece if any
+            OMElement scheamElement = service_element.getFirstChildWithName(new QName(SCHEMA));
+            if (scheamElement != null) {
+                OMAttribute schemaNameSpace = service_element.
+                        getAttribute(new QName(SCHEMA_NAME_SPACE));
+                if (schemaNameSpace != null) {
+                    String nameSpeceVale = schemaNameSpace.getAttributeValue();
+                    if (nameSpeceVale != null && !"".equals(nameSpeceVale)) {
+                        service.setSchematargetNamespace(nameSpeceVale);
+                    }
+                }
+
+                OMAttribute scheamNameSpaceprfix = service_element.
+                        getAttribute(new QName(SCHEMA_NAME_SPACE_PREFIX));
+                if (scheamNameSpaceprfix != null) {
+                    String prefix = scheamNameSpaceprfix.getAttributeValue();
+                    if (prefix != null && !"".equals(prefix)) {
+                        service.setSchematargetNamespacePrefix(prefix);
+                    }
+                }
+            }
+
+            //<schema targetNamespace="http://x.y.z"/>
+
             // setting the PolicyInclude
 
             // processing <wsp:Policy> .. </..> elements
@@ -175,23 +214,6 @@
                             DeploymentErrorMsgs.OPERATION_PROCESS_ERROR, axisFault.getMessage()));
         }
         return service;
-    }
-
-
-    /**
-     * To get url and prefix from a given atribute
-     *
-     * @param value
-     * @return
-     */
-    private String[] splitAttribute(String value) {
-        int splitindex = value.indexOf(':');
-        if (splitindex > 0) {
-            return new String[]{value.substring(0, splitindex - 1),
-                    value.substring(splitindex + 1, value.length())};
-        } else {
-            return new String[]{value};
-        }
     }
 
     private void processMessages(Iterator messages, AxisOperation operation)

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java?rev=372716&r1=372715&r2=372716&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
Thu Jan 26 19:40:33 2006
@@ -3,14 +3,7 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.deployment.DeploymentException;
-import org.apache.axis2.description.AxisMessage;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisOperationFactory;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.Flow;
-import org.apache.axis2.description.HandlerDescription;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.description.ParameterImpl;
+import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.Handler;
 import org.apache.axis2.engine.MessageReceiver;
@@ -157,7 +150,8 @@
         String serviceClass = (String) implInfoParam.getValue();
         ClassLoader serviceClassLoader = axisService.getClassLoader();
         SchemaGenerator schemaGenerator = new SchemaGenerator(serviceClassLoader,
-                serviceClass, null, null);
+                serviceClass, axisService.getSchematargetNamespace(),
+                axisService.getSchematargetNamespacePrefix());
         axisService.setSchema(schemaGenerator.generateSchema());
 
         JMethod [] method = schemaGenerator.getMethods();
@@ -237,7 +231,8 @@
 
         ClassLoader serviceClassLoader = axisService.getClassLoader();
         SchemaGenerator schemaGenerator = new SchemaGenerator(serviceClassLoader,
-                implClass, null, null);
+                implClass, axisService.getSchematargetNamespace(),
+                axisService.getSchematargetNamespacePrefix());
         try {
             axisService.setSchema(schemaGenerator.generateSchema());
         } catch (Exception e) {

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=372716&r1=372715&r2=372716&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
Thu Jan 26 19:40:33 2006
@@ -88,13 +88,12 @@
     private boolean active = true;
 
     //to keep the service target name space
-    private QName targetNamespace = new QName(SchemaGenerator.TARGET_NAMESPACE,
-            "targetNamespace",
-            SchemaGenerator.TARGET_NAMESPACE_PREFIX);
+    private String targetNamespace = SchemaGenerator.TARGET_NAMESPACE;
+    private String targetNamespacePrefix = SchemaGenerator.TARGET_NAMESPACE_PREFIX;
+
     // to store the target namespace for the schema
-    private QName schematargetNamespace = new QName(SchemaGenerator.SCHEMA_TARGET_NAMESPACE,
-            "schematargetNamespace",
-            SchemaGenerator.SCHEMA_NAMESPACE_PRFIX);
+    private String schematargetNamespace = SchemaGenerator.SCHEMA_TARGET_NAMESPACE;
+    private String schematargetNamespacePrefix = SchemaGenerator.SCHEMA_NAMESPACE_PRFIX;
 
     /**
      * Constructor AxisService.
@@ -305,11 +304,11 @@
     }
 
     public void printWSDL(OutputStream out, String serviceURL) throws AxisFault {
-//        if (getWSDLDefinition() != null) {
-//            printUsingWSDLDefinition(out, serviceURL);
-//        } else {
-        printUsingWOM(out, serviceURL);
-//        }
+        if (getWSDLDefinition() != null) {
+            printUsingWSDLDefinition(out, serviceURL);
+        } else {
+            printUsingWOM(out, serviceURL);
+        }
     }
 
     public void printUsingWSDLDefinition(OutputStream out, String serviceURL) throws AxisFault
{
@@ -343,8 +342,11 @@
     }
 
     public void printUsingWOM(OutputStream out, String serviceURL) throws AxisFault {
-        //todo : This is a tempory hack pls imporve me : Deepal
-        AxisService2WOM axisService2WOM = new AxisService2WOM(getSchema(), this, null, null,
serviceURL);
+        AxisService2WOM axisService2WOM = new AxisService2WOM(getSchema(),
+                this,
+                targetNamespace,
+                targetNamespacePrefix,
+                serviceURL);
         try {
             WSDLDescription desc = axisService2WOM.generateWOM();
 
@@ -617,19 +619,35 @@
         this.active = active;
     }
 
-    public QName getSchematargetNamespace() {
+    public String getSchematargetNamespace() {
         return schematargetNamespace;
     }
 
-    public void setSchematargetNamespace(QName schematargetNamespace) {
+    public void setSchematargetNamespace(String schematargetNamespace) {
         this.schematargetNamespace = schematargetNamespace;
     }
 
-    public QName getTargetNamespace() {
+    public String getSchematargetNamespacePrefix() {
+        return schematargetNamespacePrefix;
+    }
+
+    public void setSchematargetNamespacePrefix(String schematargetNamespacePrefix) {
+        this.schematargetNamespacePrefix = schematargetNamespacePrefix;
+    }
+
+    public String getTargetNamespace() {
         return targetNamespace;
     }
 
-    public void setTargetNamespace(QName targetNamespace) {
+    public void setTargetNamespace(String targetNamespace) {
         this.targetNamespace = targetNamespace;
+    }
+
+    public String getTargetNamespacePrefix() {
+        return targetNamespacePrefix;
+    }
+
+    public void setTargetNamespacePrefix(String targetNamespacePrefix) {
+        this.targetNamespacePrefix = targetNamespacePrefix;
     }
 }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceCreateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceCreateTest.java?rev=372716&r1=372715&r2=372716&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceCreateTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceCreateTest.java
Thu Jan 26 19:40:33 2006
@@ -41,7 +41,8 @@
     protected void setUp() throws Exception {
         UtilServer.start();
         configContext = UtilServer.getConfigurationContext();
-        clinetConfigurationctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("target/test-resources/integrationRepo",null);
+        clinetConfigurationctx = ConfigurationContextFactory.
+                createConfigurationContextFromFileSystem("target/test-resources/integrationRepo",null);
     }
 
     public void testServiceCreate() throws AxisFault {
@@ -69,7 +70,7 @@
         args.add("100");
         args.add("200");
 
-        OMElement response = client.invokeBlocking(new QName("add"), args.toArray());
+        OMElement response = client.invokeBlocking(new QName("http://org.apache.axis2/xsd","add","ns1"),
args.toArray());
         assertEquals(Integer.parseInt(response.getFirstElement().getText()), 300);
     }
 }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/WSDLClientTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/WSDLClientTest.java?rev=372716&r1=372715&r2=372716&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/WSDLClientTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/WSDLClientTest.java
Thu Jan 26 19:40:33 2006
@@ -58,7 +58,7 @@
                     "EchoXMLServicePortType");
             OMElement payload = TestingUtils.createDummyOMElement();
             OMElement response = serviceClient.sendReceive(
-                    new QName("http://org.apache.axis2/", "echoOMElement"), payload);
+                    new QName("http://org.apache.axis2/xsd", "echoOMElement"), payload);
             assertNotNull(response);
             String textValue = response.getText();
             assertEquals(textValue, "Isaac Asimov, The Foundation Trilogy");

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/TestingUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/TestingUtils.java?rev=372716&r1=372715&r2=372716&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/TestingUtils.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/TestingUtils.java
Thu Jan 26 19:40:33 2006
@@ -25,7 +25,7 @@
 public class TestingUtils {
     public static OMElement createDummyOMElement() {
         OMFactory fac = OMAbstractFactory.getOMFactory();
-        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+        OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2/xsd", "ns1");
         OMElement method = fac.createOMElement("echoOMElement", omNs);
         OMElement value = fac.createOMElement("myValue", omNs);
         value.addChild(

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=372716&r1=372715&r2=372716&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
Thu Jan 26 19:40:33 2006
@@ -65,8 +65,8 @@
                     + "/axis/services/EchoXMLService/concat");
     protected Log log = LogFactory.getLog(getClass());
     protected QName serviceName = new QName("EchoXMLService");
-    protected QName operationName = new QName("http://localhost/my", "concat");
-    protected QName transportName = new QName("http://localhost/my",
+    protected QName operationName = new QName("http://org.apache.axis2/xsd", "concat");
+    protected QName transportName = new QName("http://org.apache.axis2/xsd",
             "NullTransport");
 
     protected AxisConfiguration engineRegistry;
@@ -92,7 +92,7 @@
                         + (UtilServer.TESTING_PORT)
                         + "/axis/services/EchoXMLService/" + opName);
         String className = "org.apache.axis2.rpc.RPCServiceClass";
-        operationName = new QName("http://localhost/my", opName, "req");
+        operationName = new QName("http://org.apache.axis2/xsd", opName, "req");
         AxisService service = new AxisService(serviceName.getLocalPart());
         service.setClassLoader(Thread.currentThread().getContextClassLoader());
         service.addParameter(new ParameterImpl(AbstractMessageReceiver.SERVICE_CLASS,
@@ -108,7 +108,7 @@
         configureSystem("echoString");
         OMFactory fac = OMAbstractFactory.getOMFactory();
 
-        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+        OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2/xsd", "my");
         OMElement method = fac.createOMElement("echoString", omNs);
         OMElement value = fac.createOMElement("arg0", null);
         value.addAttribute(fac.createOMAttribute("href", null, "#1"));
@@ -152,7 +152,7 @@
         configureSystem("add");
         OMFactory fac = OMAbstractFactory.getOMFactory();
 
-        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+        OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2/xsd", "my");
         OMElement method = fac.createOMElement("add", omNs);
         OMElement value = fac.createOMElement("arg0", null);
         value.addAttribute(fac.createOMAttribute("href", null, "#1"));
@@ -205,7 +205,7 @@
         configureSystem("add");
         OMFactory fac = OMAbstractFactory.getOMFactory();
 
-        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+        OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2/xsd", "my");
         OMElement method = fac.createOMElement("add", omNs);
         OMElement value = fac.createOMElement("arg0", null);
         value.addAttribute(fac.createOMAttribute("href", null, "#1"));
@@ -252,7 +252,7 @@
             configureSystem("add");
             OMFactory fac = OMAbstractFactory.getOMFactory();
 
-            OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+            OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2/xsd", "my");
             OMElement method = fac.createOMElement("add", omNs);
             OMElement value = fac.createOMElement("arg0", null);
             value.addAttribute(fac.createOMAttribute("href", null, "#1"));
@@ -308,7 +308,7 @@
         configureSystem("editBean");
         OMFactory fac = OMAbstractFactory.getOMFactory();
 
-        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+        OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2/xsd", "my");
         OMElement method = fac.createOMElement("editBean", omNs);
         OMElement value = fac.createOMElement("arg0", null);
         value.addAttribute(fac.createOMAttribute("href", null, "#1"));
@@ -368,7 +368,7 @@
         configureSystem("beanOM");
         OMFactory fac = OMAbstractFactory.getOMFactory();
 
-        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+        OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2/xsd", "my");
         OMElement method = fac.createOMElement("beanOM", omNs);
         OMElement value = fac.createOMElement("arg0", null);
         value.addAttribute(fac.createOMAttribute("href", null, "#1"));
@@ -428,7 +428,7 @@
         configureSystem("omrefs");
         OMFactory fac = OMAbstractFactory.getOMFactory();
 
-        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+        OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2/xsd", "my");
         OMElement method = fac.createOMElement("omrefs", omNs);
 
         OMElement value = fac.createOMElement("arg0", null);
@@ -508,7 +508,7 @@
         configureSystem("echoEmployee");
         OMFactory fac = OMAbstractFactory.getOMFactory();
 
-        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+        OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2/xsd", "my");
         OMElement method = fac.createOMElement("echoEmployee", omNs);
 
         OMElement value = fac.createOMElement("arg0", null);
@@ -562,7 +562,7 @@
         configureSystem("handleArrayList");
         OMFactory fac = OMAbstractFactory.getOMFactory();
 
-        OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+        OMNamespace omNs = fac.createOMNamespace("http://org.apache.axis2/xsd", "my");
         OMElement method = fac.createOMElement("handleArrayList", omNs);
 
         OMElement value = fac.createOMElement("arg0", null);

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java?rev=372716&r1=372715&r2=372716&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java
Thu Jan 26 19:40:33 2006
@@ -67,8 +67,8 @@
                     + "/axis/services/EchoXMLService/concat");
     protected Log log = LogFactory.getLog(getClass());
     protected QName serviceName = new QName("EchoXMLService");
-    protected QName operationName = new QName("http://localhost/my", "concat");
-    protected QName transportName = new QName("http://localhost/my",
+    protected QName operationName = new QName("http://org.apache.axis2/xsd", "concat");
+    protected QName transportName = new QName("http://org.apache.axis2/xsd",
             "NullTransport");
 
     protected AxisConfiguration engineRegistry;
@@ -133,11 +133,10 @@
     private void configureSystem(String opName) throws AxisFault {
         targetEPR =
                 new EndpointReference("http://127.0.0.1:"
-//                        + (5000)
                         + (UtilServer.TESTING_PORT)
                         + "/axis/services/EchoXMLService/" + opName);
         String className = "org.apache.axis2.rpc.RPCServiceClass";
-        operationName = new QName("http://localhost/my", opName, "req");
+        operationName = new QName("http://org.apache.axis2/xsd", opName, "req");
         AxisService service = new AxisService(serviceName.getLocalPart());
         service.setClassLoader(Thread.currentThread().getContextClassLoader());
         service.addParameter(new ParameterImpl(AbstractMessageReceiver.SERVICE_CLASS,
@@ -491,14 +490,14 @@
     }
 
     private OMElement getpayLoad() throws AxisFault {
-        String str = "<handleArrayList>\n" +
+        String str = "<req:handleArrayList xmlns:req=\"http://org.apache.axis2/xsd\">\n"
+
                 "  <arg0>\n" +
                 "    <item0>abc</item0>\n" +
                 "    <item0>def</item0>\n" +
                 "    <item0>ghi</item0>\n" +
                 "    <item0>klm</item0>\n" +
                 "  </arg0><arg1>10</arg1>" +
-                "</handleArrayList>";
+                "</req:handleArrayList>";
         StAXOMBuilder staxOMBuilder;
         try {
             XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(new

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCServiceClass.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCServiceClass.java?rev=372716&r1=372715&r2=372716&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCServiceClass.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCServiceClass.java
Thu Jan 26 19:40:33 2006
@@ -27,6 +27,7 @@
 import javax.xml.stream.XMLStreamException;
 import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.Date;
 
 public class RPCServiceClass {
 
@@ -157,6 +158,10 @@
         }
         com.setPersons(tems);
         return com;
+    }
+
+    public void handlAnyThing(String value1, int abc, Date date){
+
     }
 
 }

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=372716&r1=372715&r2=372716&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
Thu Jan 26 19:40:33 2006
@@ -250,6 +250,7 @@
                 sequence.getItems().add(elt1);
                 if (isArryType) {
                     elt1.setMaxOccurs(Long.MAX_VALUE);
+                    elt1.setMinOccurs(0);
                 }
             } else {
                 XmlSchemaElement elt1 = new XmlSchemaElement();
@@ -258,6 +259,7 @@
                 sequence.getItems().add(elt1);
                 if (isArryType) {
                     elt1.setMaxOccurs(Long.MAX_VALUE);
+                    elt1.setMinOccurs(0);
                 }
             }
         }
@@ -292,6 +294,7 @@
                 sequence.getItems().add(elt1);
                 if (isArryType) {
                     elt1.setMaxOccurs(Long.MAX_VALUE);
+                    elt1.setMinOccurs(0);
                 }
             } else {
                 XmlSchemaElement elt1 = new XmlSchemaElement();
@@ -300,6 +303,7 @@
                 sequence.getItems().add(elt1);
                 if (isArryType) {
                     elt1.setMaxOccurs(Long.MAX_VALUE);
+                    elt1.setMinOccurs(0);
                 }
             }
         }



Mime
View raw message