You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by de...@apache.org on 2006/10/25 05:29:21 UTC

svn commit: r467547 - in /webservices/axis2/branches/java/1_1/modules: adb/src/org/apache/axis2/databinding/utils/ adb/src/org/apache/axis2/rpc/receivers/ samples/servicelifecycle/src/sample/ samples/servicelifecycle/src/sample/servicelifecycle/ sample...

Author: deepal
Date: Tue Oct 24 20:29:20 2006
New Revision: 467547

URL: http://svn.apache.org/viewvc?view=rev&rev=467547
Log:
fixing AXIS2-1305

Added:
    webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/
    webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/
    webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/LibraryService.java
    webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/bean/
    webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/bean/Book.java
    webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/impl/
    webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/impl/LibraryServiceLifeCycle.java
Modified:
    webservices/axis2/branches/java/1_1/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
    webservices/axis2/branches/java/1_1/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java

Modified: webservices/axis2/branches/java/1_1/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?view=diff&rev=467547&r1=467546&r2=467547
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java (original)
+++ webservices/axis2/branches/java/1_1/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java Tue Oct 24 20:29:20 2006
@@ -72,6 +72,12 @@
             } else {
                 throw new AxisFault("No service class found , exception from JAM");
             }
+            QName elemntNameSpace = null;
+            if (typeTable != null) {
+                QName qNamefortheType = typeTable.getQNamefortheType(beanObject.getClass().getName());
+                elemntNameSpace = new QName(qNamefortheType.getNamespaceURI(),
+                        "elementName");
+            }
 
             // properties from JAM
             JProperty properties [] = jClass.getDeclaredProperties();
@@ -99,8 +105,9 @@
                 if (SimpleTypeMapper.isSimpleType(ptype)) {
                     Object value = propDesc.getReadMethod().invoke(beanObject,
                             null);
-                    if (typeTable != null) {
-                        object.add(typeTable.getQNamefortheType(ptype.getName()));
+                    if (elemntNameSpace != null) {
+                        object.add(new QName(elemntNameSpace.getNamespaceURI(),
+                                propDesc.getName(), elemntNameSpace.getPrefix()));
                     } else {
                         object.add(new QName(beanName.getNamespaceURI(),
                                 propDesc.getName(), beanName.getPrefix()));
@@ -112,8 +119,9 @@
                     if (SimpleTypeMapper.isSimpleType(ptype.getComponentType())) {
                         for (int j = 0; j < value.length; j++) {
                             Object o = value[j];
-                            if (typeTable != null) {
-                                object.add(typeTable.getQNamefortheType(ptype.getName()));
+                            if (elemntNameSpace != null) {
+                                object.add(new QName(elemntNameSpace.getNamespaceURI(),
+                                        propDesc.getName(), elemntNameSpace.getPrefix()));
                             } else {
                                 object.add(new QName(beanName.getNamespaceURI(),
                                         propDesc.getName(), beanName.getPrefix()));
@@ -123,8 +131,9 @@
                     } else {
                         for (int j = 0; j < value.length; j++) {
                             Object o = value[j];
-                            if (typeTable != null) {
-                                object.add(typeTable.getQNamefortheType(ptype.getName()));
+                            if (elemntNameSpace != null) {
+                                object.add(new QName(elemntNameSpace.getNamespaceURI(),
+                                        propDesc.getName(), elemntNameSpace.getPrefix()));
                             } else {
                                 object.add(new QName(beanName.getNamespaceURI(),
                                         propDesc.getName(), beanName.getPrefix()));
@@ -144,16 +153,18 @@
                         for (int j = 0; j < objList.size(); j++) {
                             Object o = objList.get(j);
                             if (SimpleTypeMapper.isSimpleType(o)) {
-                                if (typeTable != null) {
-                                    object.add(typeTable.getQNamefortheType(ptype.getName()));
+                                if (elemntNameSpace != null) {
+                                    object.add(new QName(elemntNameSpace.getNamespaceURI(),
+                                            propDesc.getName(), elemntNameSpace.getPrefix()));
                                 } else {
                                     object.add(new QName(beanName.getNamespaceURI(),
                                             propDesc.getName(), beanName.getPrefix()));
                                 }
                                 object.add(o);
                             } else {
-                                if (typeTable != null) {
-                                    object.add(typeTable.getQNamefortheType(ptype.getName()));
+                                if (elemntNameSpace != null) {
+                                    object.add(new QName(elemntNameSpace.getNamespaceURI(),
+                                            propDesc.getName(), elemntNameSpace.getPrefix()));
                                 } else {
                                     object.add(new QName(beanName.getNamespaceURI(),
                                             propDesc.getName(), beanName.getPrefix()));
@@ -165,7 +176,9 @@
                     }
                 } else {
                     if (typeTable != null) {
-                        object.add(typeTable.getQNamefortheType(ptype.getName()));
+                        QName qNamefortheType = typeTable.getQNamefortheType(ptype.getName());
+                        object.add(new QName(qNamefortheType.getNamespaceURI(),
+                                propDesc.getName(), qNamefortheType.getPrefix()));
                     } else {
                         object.add(new QName(beanName.getNamespaceURI(),
                                 propDesc.getName(), beanName.getPrefix()));
@@ -198,7 +211,7 @@
             className = className.substring(className.lastIndexOf('.') + 1,
                     className.length());
         }
-        return getPullParser(beanObject, new QName(className) , null);
+        return getPullParser(beanObject, new QName(className), null);
     }
 
     public static Object deserialize(Class beanClass,

Modified: webservices/axis2/branches/java/1_1/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java?view=diff&rev=467547&r1=467546&r2=467547
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java (original)
+++ webservices/axis2/branches/java/1_1/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java Tue Oct 24 20:29:20 2006
@@ -8,9 +8,9 @@
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.engine.ObjectSupplier;
 import org.apache.axis2.databinding.typemapping.SimpleTypeMapper;
 import org.apache.axis2.databinding.utils.BeanUtil;
+import org.apache.axis2.engine.ObjectSupplier;
 import org.apache.axis2.util.StreamWrapper;
 import org.apache.ws.java2wsdl.utils.TypeTable;
 
@@ -44,7 +44,7 @@
                                        OMNamespace ns,
                                        SOAPEnvelope envelope,
                                        Method method,
-                                       boolean qualified ,
+                                       boolean qualified,
                                        TypeTable typeTable) {
         if (resObject != null) {
             //simple type
@@ -83,7 +83,7 @@
                     returnWrapper = new QName(RETURN_WRAPPER);
                 }
                 XMLStreamReader xr = BeanUtil.getPullParser(resObject,
-                        returnWrapper , typeTable);
+                        returnWrapper, typeTable);
                 StAXOMBuilder stAXOMBuilder =
                         OMXMLBuilderFactory.createStAXOMBuilder(
                                 OMAbstractFactory.getOMFactory(), new StreamWrapper(xr));
@@ -99,9 +99,9 @@
     }
 
     public static Object[] processRequest(OMElement methodElement,
-                                          Method method  , ObjectSupplier objectSupplier) throws AxisFault {
+                                          Method method, ObjectSupplier objectSupplier) throws AxisFault {
         Class[] parameters = method.getParameterTypes();
-        return BeanUtil.deserialize(methodElement, parameters  , objectSupplier);
+        return BeanUtil.deserialize(methodElement, parameters, objectSupplier);
     }
 
     public static OMElement getResponseElement(QName resname, Object [] objs, boolean qualified) {

Added: webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/LibraryService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/LibraryService.java?view=auto&rev=467547
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/LibraryService.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/LibraryService.java Tue Oct 24 20:29:20 2006
@@ -0,0 +1,21 @@
+package sample.servicelifecycle;
+/*
+* 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.
+*
+*
+*/
+
+public class LibraryService {
+}

Added: webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/bean/Book.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/bean/Book.java?view=auto&rev=467547
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/bean/Book.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/bean/Book.java Tue Oct 24 20:29:20 2006
@@ -0,0 +1,49 @@
+package sample.servicelifecycle.bean;
+/*
+* 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.
+*
+*
+*/
+
+public class Book {
+    
+    private String title;
+    private String author ;
+    private String isbn;
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getAuthor() {
+        return author;
+    }
+
+    public void setAuthor(String author) {
+        this.author = author;
+    }
+
+    public String getIsbn() {
+        return isbn;
+    }
+
+    public void setIsbn(String isbn) {
+        this.isbn = isbn;
+    }
+}

Added: webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/impl/LibraryServiceLifeCycle.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/impl/LibraryServiceLifeCycle.java?view=auto&rev=467547
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/impl/LibraryServiceLifeCycle.java (added)
+++ webservices/axis2/branches/java/1_1/modules/samples/servicelifecycle/src/sample/servicelifecycle/impl/LibraryServiceLifeCycle.java Tue Oct 24 20:29:20 2006
@@ -0,0 +1,34 @@
+package sample.servicelifecycle.impl;
+
+import org.apache.axis2.engine.ServiceLifeCycle;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.description.AxisService;
+/*
+* 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.
+*
+*
+*/
+
+public class LibraryServiceLifeCycle implements ServiceLifeCycle {
+    
+    public void startUp(ConfigurationContext configctx, AxisService service) {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void shutDown(ConfigurationContext configctx, AxisService service) {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+}



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