Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 35377 invoked from network); 31 Jan 2008 10:44:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Jan 2008 10:44:13 -0000 Received: (qmail 87986 invoked by uid 500); 31 Jan 2008 10:43:55 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 87962 invoked by uid 500); 31 Jan 2008 10:43:55 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 87951 invoked by uid 99); 31 Jan 2008 10:43:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Jan 2008 02:43:55 -0800 X-ASF-Spam-Status: No, hits=3.6 required=10.0 tests=NORMAL_HTTP_TO_IP,SPF_NEUTRAL,URIBL_RHS_DOB,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [124.30.116.157] (HELO newexchangemail.onmobile.com) (124.30.116.157) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 31 Jan 2008 10:43:27 +0000 Received: from [172.16.25.54] ([172.16.25.54]) by newexchangemail.onmobile.com with Microsoft SMTPSVC(6.0.3790.2825); Thu, 31 Jan 2008 16:13:19 +0530 Subject: Re: Regarding Axis serialization of "user-defined object containing array of objects" From: Pratiksha Powar Reply-To: pratiksha.powar@onmobile.com To: axis-user@ws.apache.org In-Reply-To: <1201589751.3517.45.camel@localhost.localdomain> References: <1201588700.3517.37.camel@localhost.localdomain> <1201589751.3517.45.camel@localhost.localdomain> Content-Type: multipart/mixed; boundary="----=neXtPaRt_1201776581" Organization: OnMobile Asia Pacific Pvt. Ltd. Date: Thu, 31 Jan 2008 16:15:06 +0530 Message-Id: <1201776306.3462.29.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.8.0 (2.8.0-40.el5) X-OriginalArrivalTime: 31 Jan 2008 10:43:19.0388 (UTC) FILETIME=[17E271C0:01C863F6] X-Virus-Checked: Checked by ClamAV on apache.org ------=neXtPaRt_1201776581 Content-Type: multipart/mixed; boundary="=-8WtGthCCerOcrIq9qbGw" --=-8WtGthCCerOcrIq9qbGw Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Everybody, I was able to solve my problem of serialization. The solution is as follows: I had to mark every member variable of my user-defined object "public". Also I had to make a few modifications in my deployment descriptor. I got this info from http://www.javaranch.com/journal/200603/WSComplexTypes.html Now I'm facing a problem with deserializing the object on client side. My Object contains a 2D Array of objects of type java.lang.Object, 2 int values and 1 String object. While deserializing I'm getting the following error: Caused by: org.xml.sax.SAXException: No object was found for class type int at org.apache.axis.encoding.ConstructorTarget.set(ConstructorTarget.java:97) at org.apache.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl.java:249) at org.apache.axis.encoding.ser.ArrayDeserializer.valueComplete(ArrayDeserializer.java:583) at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:509) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141) at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:369) at org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:154) at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384) at org.apache.axis.client.Call.invoke(Call.java:2467) I'm attaching my server-config.wsdd and my client-side program. Can anyone help me here? Thanks, Pratiksha On Tue, 2008-01-29 at 12:25 +0530, Pratiksha Powar wrote: > Hi Everybody, > > I'm trying to return a user-defined object which contains two primitives > namely : int and Java String and a 2D array of objects of > type :java.lang.Object > Can you tell how should I map these objects in the server-config.wsdd > file so that axis produces the correct wsdl ? > I'm attaching my copy of server-config.wsdd. > Also is it possible to write your own wsdl and make axis point to it? > > Thanks, > Pratiksha > > > ============================== > DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Further, this e-mail may contain viruses and all reasonable precaution to minimize the risk arising there from is taken by OnMobile. OnMobile is not liable for any damage sustained by you as a result of any virus in this e-mail. All applicable virus checks should be carried out by you before opening this e-mail or any attachment thereto. > Thank you - OnMobile Global Limited. > ============================== > > --------------------------------------------------------------------- > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org > For additional commands, e-mail: axis-user-help@ws.apache.org --=-8WtGthCCerOcrIq9qbGw Content-Disposition: attachment; filename=DBManager.java Content-Type: text/x-java; name=DBManager.java; charset=UTF-8 Content-Transfer-Encoding: 7bit package db; import java.net.MalformedURLException; import java.rmi.RemoteException; import javax.xml.rpc.ServiceException; import javax.xml.namespace.QName; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.encoding.ser.BeanSerializerFactory; import org.apache.axis.encoding.ser.BeanDeserializerFactory; import org.apache.axis.encoding.ser.ArraySerializerFactory; import org.apache.axis.encoding.ser.ArrayDeserializerFactory; import content.OnMobileResultSet; public class DBManager { private static final String CLASS_NAME = "DBManager"; //pratiksha: have to obtain endpoint from SPInteractor in DBUtils.java //use the following endpoint while going via tcpMon to connect to Axis private String endpoint = "http://127.0.0.1:1234/DBAccess/servlet/AxisServlet"; //private String endpoint = "http://172.16.27.23:8010/DBAccess/servlet/AxisServlet"; private Service service ; private String cdNameSpc = "BeanOnMobileResultSet"; private Class cdClass = OnMobileResultSet.class; private String cdClassName = "OnMobileResultSet"; private String caNameSpc = "BeanOnMobileResultSet"; private Class caClass = Object[][].class; private String caClassName ="ArrayOf_Content"; private QName cdQName = null; private QName caQName = null; public DBManager() { service = new Service(); cdQName = new QName(cdNameSpc, cdClassName); caQName = new QName(caNameSpc, caClassName); } public OnMobileResultSet executeStatement(String query) { OnMobileResultSet omrs = null; try { Call call = (Call) service.createCall(); call.registerTypeMapping(cdClass, cdQName, new BeanSerializerFactory(cdClass, cdQName), new BeanDeserializerFactory(cdClass, cdQName)); call.registerTypeMapping(caClass, caQName, new ArraySerializerFactory(caClass,caQName), new ArrayDeserializerFactory(caQName)); call.setTargetEndpointAddress( new java.net.URL(endpoint) ); call.setOperationName(new QName("urn:OnMobileDBServices","executeStatement")); Object [] objArr = new Object []{query}; omrs = (OnMobileResultSet)call.invoke(objArr); System.out.println("Result \n" + omrs.statusCode +" "+ omrs.statusMessage); Object row[]=null; String value=null; int row_count = omrs.row_Count; for(int i=0;i http://xml.apache.org/axis/wsdd/ --=-8WtGthCCerOcrIq9qbGw-- ------=neXtPaRt_1201776581 Content-Type: text/plain; ============================== DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Further, this e-mail may contain viruses and all reasonable precaution to minimize the risk arising there from is taken by OnMobile. OnMobile is not liable for any damage sustained by you as a result of any virus in this e-mail. All applicable virus checks should be carried out by you before opening this e-mail or any attachment thereto. Thank you - OnMobile Global Limited. ============================== ------=neXtPaRt_1201776581 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-user-help@ws.apache.org ------=neXtPaRt_1201776581--