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 am...@apache.org on 2007/08/21 05:06:13 UTC

svn commit: r567923 [3/3] - in /webservices/axis2/trunk/java/modules/rmi: src/org/apache/axis2/rmi/ src/org/apache/axis2/rmi/config/ src/org/apache/axis2/rmi/databind/ src/org/apache/axis2/rmi/deploy/ src/org/apache/axis2/rmi/deploy/config/ src/org/apa...

Added: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/databind/dto/TestRestrictionBean.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/databind/dto/TestRestrictionBean.java?rev=567923&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/databind/dto/TestRestrictionBean.java (added)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/databind/dto/TestRestrictionBean.java Mon Aug 20 20:06:10 2007
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.rmi.databind.dto;
+
+import org.apache.axis2.rmi.databind.AbstractRMIBean;
+import org.apache.axis2.rmi.databind.JavaObjectSerializer;
+import org.apache.axis2.rmi.databind.XmlStreamParser;
+import org.apache.axis2.rmi.databind.type.TestRestrictionType;
+import org.apache.axis2.rmi.exception.XmlParsingException;
+import org.apache.axis2.rmi.exception.XmlSerializingException;
+import org.apache.axis2.rmi.util.NamespacePrefix;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+
+public class TestRestrictionBean extends AbstractRMIBean {
+
+    private String param1;
+
+    public TestRestrictionBean(String param1) {
+        this.param1 = param1;
+    }
+
+    public void serialize(XMLStreamWriter writer,
+                          JavaObjectSerializer serializer,
+                          QName parentQName,
+                          NamespacePrefix namespacePrefix)
+            throws XMLStreamException, XmlSerializingException {
+        writeStartElement(writer, parentQName.getNamespaceURI(), parentQName.getLocalPart(), namespacePrefix);
+        writer.writeCharacters(param1);
+        writer.writeEndElement();
+    }
+
+    public static Class getBeanClass(){
+        return TestRestrictionType.class;
+    }
+
+    public static Object parse(XMLStreamReader reader,
+                               XmlStreamParser parser)
+            throws XMLStreamException, XmlParsingException {
+
+       reader.next();
+       TestRestrictionBean testRestrictionBean = new TestRestrictionBean(reader.getText());
+       while (reader.isEndElement()){
+           reader.next();
+       }
+       return testRestrictionBean;
+    }
+
+
+    public String getParam1() {
+        return param1;
+    }
+
+    public void setParam1(String param1) {
+        this.param1 = param1;
+    }
+}

Added: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/databind/type/TestRestrictionType.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/databind/type/TestRestrictionType.java?rev=567923&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/databind/type/TestRestrictionType.java (added)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/databind/type/TestRestrictionType.java Mon Aug 20 20:06:10 2007
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.rmi.databind.type;
+
+import org.apache.axis2.rmi.metadata.AbstractType;
+import org.apache.axis2.rmi.metadata.xml.XmlSchema;
+import org.apache.axis2.rmi.metadata.type.xml.SimpleRestrictionXmlType;
+import org.apache.axis2.rmi.metadata.service.dto.SimpleRestriction;
+import org.apache.axis2.rmi.Configurator;
+import org.apache.axis2.rmi.databind.dto.TestRestrictionBean;
+import org.apache.axis2.rmi.exception.SchemaGenerationException;
+import org.apache.axis2.rmi.exception.MetaDataPopulateException;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
+
+
+public class TestRestrictionType extends AbstractType {
+
+    public void populateMetaData(Configurator configurator,
+                                 Map processedTypeMap)
+            throws MetaDataPopulateException {
+        this.javaClass = TestRestrictionBean.class;
+        this.namespace = "http://ws.apache.org/axis2/rmi/simpletypes";
+        this.name = "simpleRestriction";
+
+    }
+
+    public void generateSchema(Configurator configurator,
+                               Map schemaMap)
+            throws SchemaGenerationException {
+
+        this.isSchemaGenerated = true;
+        this.xmlType = new SimpleRestrictionXmlType();
+        this.xmlType.setQname(new QName(this.namespace, this.name));
+        // add this to the schema map
+        // get the schema to add the complex type
+        registerXmlType(schemaMap);
+    }
+
+
+}

Added: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/databind/type/TestRestrictionXmlType.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/databind/type/TestRestrictionXmlType.java?rev=567923&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/databind/type/TestRestrictionXmlType.java (added)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/databind/type/TestRestrictionXmlType.java Mon Aug 20 20:06:10 2007
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.rmi.databind.type;
+
+import org.apache.axis2.rmi.metadata.xml.AbstractXmlType;
+import org.apache.axis2.rmi.exception.SchemaGenerationException;
+import org.apache.axis2.rmi.util.Constants;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import java.util.Map;
+
+
+public class TestRestrictionXmlType extends AbstractXmlType {
+
+    public void generateWSDLSchema(Document document,
+                                   Map namespacesToPrefixMap)
+            throws SchemaGenerationException {
+        // generate the simple type Element here
+        String xsdPrefix = (String) namespacesToPrefixMap.get(Constants.URI_2001_SCHEMA_XSD);
+        this.typeElement = document.createElementNS(Constants.URI_2001_SCHEMA_XSD, "simpleType");
+        this.typeElement.setPrefix(xsdPrefix);
+        this.typeElement.setAttribute("name", this.qname.getLocalPart());
+
+        Element restrictionElement = document.createElementNS(Constants.URI_2001_SCHEMA_XSD, "restriction");
+        restrictionElement.setPrefix(xsdPrefix);
+        restrictionElement.setAttribute("base", xsdPrefix + ":string");
+        this.typeElement.appendChild(restrictionElement);
+
+        Element enumerationElement = null;
+        for (int i = 1; i < 5; i++) {
+            enumerationElement = document.createElementNS(Constants.URI_2001_SCHEMA_XSD, "enumeration");
+            enumerationElement.setPrefix(xsdPrefix);
+            enumerationElement.setAttribute("value", "testValue" + i);
+            restrictionElement.appendChild(enumerationElement);
+        }
+    }
+}

Added: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/CustomBeanTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/CustomBeanTest.java?rev=567923&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/CustomBeanTest.java (added)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/CustomBeanTest.java Mon Aug 20 20:06:10 2007
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.rmi.metadata;
+
+import junit.framework.TestCase;
+import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
+import org.apache.axis2.rmi.Configurator;
+import org.apache.axis2.rmi.exception.MetaDataPopulateException;
+import org.apache.axis2.rmi.exception.SchemaGenerationException;
+import org.apache.axis2.rmi.metadata.service.dto.CustomBeanClass;
+import org.apache.axis2.rmi.metadata.service.dto.SimpleRestriction;
+import org.apache.axis2.rmi.metadata.service.CustomBeanService;
+import org.apache.axis2.rmi.metadata.type.SimpleRestrictionType;
+import org.apache.axis2.rmi.wsdl.WSDL11DefinitionBuilder;
+
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLWriter;
+import java.io.IOException;
+
+
+public class CustomBeanTest extends TestCase {
+
+    public void testGenerateSchema() {
+        Configurator configurator = new Configurator();
+
+        Service service = new Service(CustomBeanService.class, configurator);
+        try {
+            service.populateMetaData();
+            service.generateSchema();
+            WSDL11DefinitionBuilder definitionBuilder = new WSDL11DefinitionBuilder(service);
+            Definition definition = definitionBuilder.generateWSDL();
+
+//            WSDLWriter wsdlWriter = WSDLFactory.newInstance().newWSDLWriter();
+//            wsdlWriter.writeWSDL(definition, System.out);
+
+            WSDL11ToAxisServiceBuilder bulder = new WSDL11ToAxisServiceBuilder(definition, null, null);
+            bulder.populateService();
+
+        } catch (MetaDataPopulateException e) {
+            fail();
+        } catch (SchemaGenerationException e) {
+            fail();
+        } catch (IOException e) {
+            fail();
+        }
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/CustomMappingServiceTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/CustomMappingServiceTest.java?rev=567923&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/CustomMappingServiceTest.java (added)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/CustomMappingServiceTest.java Mon Aug 20 20:06:10 2007
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.rmi.metadata;
+
+import junit.framework.TestCase;
+import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
+import org.apache.axis2.rmi.Configurator;
+import org.apache.axis2.rmi.config.ClassInfo;
+import org.apache.axis2.rmi.config.FieldInfo;
+import org.apache.axis2.rmi.exception.MetaDataPopulateException;
+import org.apache.axis2.rmi.exception.SchemaGenerationException;
+import org.apache.axis2.rmi.metadata.service.CustomMappingService;
+import org.apache.axis2.rmi.metadata.service.dto.ComplexType3;
+import org.apache.axis2.rmi.wsdl.WSDL11DefinitionBuilder;
+
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLWriter;
+import java.io.IOException;
+
+
+public class CustomMappingServiceTest extends TestCase {
+
+    public void testGenerateSchema() {
+
+        Configurator configurator = new Configurator();
+
+        ClassInfo classInfo = new ClassInfo(ComplexType3.class);
+        FieldInfo fieldInfo = new FieldInfo("param1","xmlparam1",false);
+        classInfo.addFieldInfo(fieldInfo);
+        configurator.addClassInfo(classInfo);
+
+        Service service = new Service(CustomMappingService.class, configurator);
+        try {
+            service.populateMetaData();
+            service.generateSchema();
+            WSDL11DefinitionBuilder definitionBuilder = new WSDL11DefinitionBuilder(service);
+            Definition definition = definitionBuilder.generateWSDL();
+
+//            WSDLWriter wsdlWriter = WSDLFactory.newInstance().newWSDLWriter();
+//            wsdlWriter.writeWSDL(definition, System.out);
+
+            WSDL11ToAxisServiceBuilder bulder = new WSDL11ToAxisServiceBuilder(definition, null, null);
+            bulder.populateService();
+
+        } catch (MetaDataPopulateException e) {
+            fail();
+        } catch (SchemaGenerationException e) {
+            fail();
+        } catch (IOException e) {
+            fail();
+        }
+    }
+
+}

Modified: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/ExtensionServiceTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/ExtensionServiceTest.java?rev=567923&r1=567922&r2=567923&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/ExtensionServiceTest.java (original)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/ExtensionServiceTest.java Mon Aug 20 20:06:10 2007
@@ -42,6 +42,7 @@
         try {
             service.populateMetaData();
             service.generateSchema();
+            
             WSDL11DefinitionBuilder definitionBuilder = new WSDL11DefinitionBuilder(service);
             Definition definition = definitionBuilder.generateWSDL();
 

Modified: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/TypeTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/TypeTest.java?rev=567923&r1=567922&r2=567923&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/TypeTest.java (original)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/TypeTest.java Mon Aug 20 20:06:10 2007
@@ -16,6 +16,7 @@
 package org.apache.axis2.rmi.metadata;
 
 import org.apache.axis2.rmi.metadata.service.dto.ChildClass;
+import org.apache.axis2.rmi.metadata.impl.TypeImpl;
 import org.apache.axis2.rmi.Configurator;
 import org.apache.axis2.rmi.exception.MetaDataPopulateException;
 
@@ -32,7 +33,7 @@
         Configurator configurator = new Configurator();
         Map processedTypeMap = new HashMap();
 
-        Type type = new Type(ChildClass.class);
+        Type type = new TypeImpl(ChildClass.class);
         try {
             type.populateMetaData(configurator,processedTypeMap);
         } catch (MetaDataPopulateException e) {

Added: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/CustomBeanService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/CustomBeanService.java?rev=567923&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/CustomBeanService.java (added)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/CustomBeanService.java Mon Aug 20 20:06:10 2007
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.rmi.metadata.service;
+
+import org.apache.axis2.rmi.metadata.service.dto.CustomBeanClass;
+
+
+public class CustomBeanService {
+    
+     public CustomBeanClass method1(CustomBeanClass param1){
+         return param1;
+     }
+}

Added: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/CustomMappingService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/CustomMappingService.java?rev=567923&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/CustomMappingService.java (added)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/CustomMappingService.java Mon Aug 20 20:06:10 2007
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.rmi.metadata.service;
+
+import org.apache.axis2.rmi.metadata.service.dto.ComplexType3;
+
+
+public class CustomMappingService {
+
+    public ComplexType3 method1(ComplexType3 param1){
+        return param1;
+    }
+
+
+}

Added: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/dto/ComplexType3.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/dto/ComplexType3.java?rev=567923&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/dto/ComplexType3.java (added)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/dto/ComplexType3.java Mon Aug 20 20:06:10 2007
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.rmi.metadata.service.dto;
+
+
+public class ComplexType3 {
+
+    private int param1;
+
+    public int getParam1() {
+        return param1;
+    }
+
+    public void setParam1(int param1) {
+        this.param1 = param1;
+    }
+}

Added: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/dto/CustomBeanClass.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/dto/CustomBeanClass.java?rev=567923&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/dto/CustomBeanClass.java (added)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/dto/CustomBeanClass.java Mon Aug 20 20:06:10 2007
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.rmi.metadata.service.dto;
+
+
+public class CustomBeanClass {
+
+    private SimpleRestriction param1;
+
+    public SimpleRestriction getParam1() {
+        return param1;
+    }
+
+    public void setParam1(SimpleRestriction param1) {
+        this.param1 = param1;
+    }
+}

Added: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/dto/SimpleRestriction.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/dto/SimpleRestriction.java?rev=567923&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/dto/SimpleRestriction.java (added)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/service/dto/SimpleRestriction.java Mon Aug 20 20:06:10 2007
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.rmi.metadata.service.dto;
+
+import org.apache.axis2.rmi.databind.AbstractRMIBean;
+import org.apache.axis2.rmi.databind.JavaObjectSerializer;
+import org.apache.axis2.rmi.databind.XmlStreamParser;
+import org.apache.axis2.rmi.exception.XmlParsingException;
+import org.apache.axis2.rmi.exception.XmlSerializingException;
+import org.apache.axis2.rmi.util.NamespacePrefix;
+import org.apache.axis2.rmi.metadata.Type;
+import org.apache.axis2.rmi.metadata.type.SimpleRestrictionType;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+
+public class SimpleRestriction extends AbstractRMIBean
+{
+
+    private String param1;
+
+    public void serialize(XMLStreamWriter writer,
+                          JavaObjectSerializer serializer,
+                          QName parentQName,
+                          NamespacePrefix namespacePrefix)
+            throws XMLStreamException, XmlSerializingException {
+        //write the star element
+        writeStartElement(writer,parentQName.getNamespaceURI(),parentQName.getLocalPart(),namespacePrefix);
+        writer.writeCharacters(param1);
+        writer.writeEndElement();
+
+    }
+
+    public static Class getBeanClass(){
+        return SimpleRestrictionType.class;
+    }
+
+    public static Object parse(XMLStreamReader reader,
+                               XmlStreamParser parser)
+            throws XMLStreamException, XmlParsingException {
+
+       reader.next();
+       SimpleRestriction simpleRestriction = new SimpleRestriction();
+       simpleRestriction.setParam1(reader.getText());
+       while (reader.isEndElement()){
+           reader.next();
+       }
+       return simpleRestriction;
+    }
+
+    public String getParam1() {
+        return param1;
+    }
+
+    public void setParam1(String param1) {
+        this.param1 = param1;
+    }
+}

Added: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/type/SimpleRestrictionType.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/type/SimpleRestrictionType.java?rev=567923&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/type/SimpleRestrictionType.java (added)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/type/SimpleRestrictionType.java Mon Aug 20 20:06:10 2007
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.rmi.metadata.type;
+
+import org.apache.axis2.rmi.Configurator;
+import org.apache.axis2.rmi.exception.SchemaGenerationException;
+import org.apache.axis2.rmi.exception.MetaDataPopulateException;
+import org.apache.axis2.rmi.metadata.AbstractType;
+import org.apache.axis2.rmi.metadata.service.dto.SimpleRestriction;
+import org.apache.axis2.rmi.metadata.xml.XmlSchema;
+import org.apache.axis2.rmi.metadata.type.xml.SimpleRestrictionXmlType;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
+
+
+public class SimpleRestrictionType extends AbstractType {
+
+    public void populateMetaData(Configurator configurator,
+                                 Map processedTypeMap)
+            throws MetaDataPopulateException {
+        this.javaClass = SimpleRestriction.class;
+        this.namespace = "http://ws.apache.org/axis2/rmi/simpletypes";
+        this.name = "simpleRestriction";
+    }
+
+    public void generateSchema(Configurator configurator,
+                               Map schemaMap) throws SchemaGenerationException {
+
+        this.isSchemaGenerated = true;
+        this.xmlType = new SimpleRestrictionXmlType();
+        this.xmlType.setQname(new QName(this.namespace,this.name));
+        registerXmlType(schemaMap);
+        
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/type/xml/SimpleRestrictionXmlType.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/type/xml/SimpleRestrictionXmlType.java?rev=567923&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/type/xml/SimpleRestrictionXmlType.java (added)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/metadata/type/xml/SimpleRestrictionXmlType.java Mon Aug 20 20:06:10 2007
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.rmi.metadata.type.xml;
+
+import org.apache.axis2.rmi.exception.SchemaGenerationException;
+import org.apache.axis2.rmi.metadata.xml.AbstractXmlType;
+import org.apache.axis2.rmi.util.Constants;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import java.util.Map;
+
+
+public class SimpleRestrictionXmlType extends AbstractXmlType {
+
+    public void generateWSDLSchema(Document document,
+                                   Map namespacesToPrefixMap) throws SchemaGenerationException {
+        
+        // generate the simple type Element here
+        String xsdPrefix = (String) namespacesToPrefixMap.get(Constants.URI_2001_SCHEMA_XSD);
+        this.typeElement = document.createElementNS(Constants.URI_2001_SCHEMA_XSD, "simpleType");
+        this.typeElement.setPrefix(xsdPrefix);
+        this.typeElement.setAttribute("name",this.qname.getLocalPart());
+
+        Element restrictionElement = document.createElementNS(Constants.URI_2001_SCHEMA_XSD,"restriction");
+        restrictionElement.setPrefix(xsdPrefix);
+        restrictionElement.setAttribute("base",xsdPrefix + ":string");
+        this.typeElement.appendChild(restrictionElement);
+
+        Element enumerationElement = null;
+        for (int i = 1; i < 5; i++) {
+            enumerationElement = document.createElementNS(Constants.URI_2001_SCHEMA_XSD, "enumeration");
+            enumerationElement.setPrefix(xsdPrefix);
+            enumerationElement.setAttribute("value", "testValue" + i);
+            restrictionElement.appendChild(enumerationElement);
+        }
+
+    }
+}

Modified: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/server/ServerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/server/ServerTest.java?rev=567923&r1=567922&r2=567923&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/server/ServerTest.java (original)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/server/ServerTest.java Mon Aug 20 20:06:10 2007
@@ -26,6 +26,7 @@
 import org.apache.axis2.rmi.exception.SchemaGenerationException;
 import org.apache.axis2.rmi.metadata.Service;
 import org.apache.axis2.rmi.server.services.Service1;
+import org.apache.axis2.rmi.server.services.Service2;
 import org.apache.axis2.transport.http.SimpleHTTPServer;
 
 import javax.wsdl.Definition;
@@ -48,9 +49,8 @@
                             AXIS2_REPOSITORY_LOCATION, AXIS2_CONFIG_FILE);
             // add the service
 //            Configurator configurator = new Configurator();
-//            configurator.setSimpleTypeHandler(new CustomSimpleTypeHandler());
 //            ClassDeployer classDeployer = new ClassDeployer(confContext, configurator);
-//            classDeployer.deployClass(Service1.class);
+//            classDeployer.deployClass(Service2.class);
 
             SimpleHTTPServer simpleHttpServer = new SimpleHTTPServer(confContext, 5555);
             simpleHttpServer.start();

Modified: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/server/services/Service1.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/server/services/Service1.java?rev=567923&r1=567922&r2=567923&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/server/services/Service1.java (original)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/server/services/Service1.java Mon Aug 20 20:06:10 2007
@@ -15,6 +15,8 @@
  */
 package org.apache.axis2.rmi.server.services;
 
+import org.apache.axis2.rmi.databind.dto.TestRestrictionBean;
+
 import java.util.Map;
 import java.util.Date;
 
@@ -44,5 +46,7 @@
     public Date method6(Date param1){
         return param1;
     }
+
+    
 
 }

Added: webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/server/services/Service2.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/server/services/Service2.java?rev=567923&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/server/services/Service2.java (added)
+++ webservices/axis2/trunk/java/modules/rmi/test/org/apache/axis2/rmi/server/services/Service2.java Mon Aug 20 20:06:10 2007
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.rmi.server.services;
+
+import org.apache.axis2.rmi.databind.dto.TestRestrictionBean;
+
+
+public class Service2 {
+    
+    public TestRestrictionBean method7(TestRestrictionBean param1) {
+        return param1;
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org