Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 48478 invoked from network); 2 Aug 2005 17:43:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Aug 2005 17:43:55 -0000 Received: (qmail 32920 invoked by uid 500); 2 Aug 2005 17:43:44 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 32913 invoked by uid 500); 2 Aug 2005 17:43:43 -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 32896 invoked by uid 99); 2 Aug 2005 17:43:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2005 10:43:43 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [198.152.12.100] (HELO tiere.net.avaya.com) (198.152.12.100) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2005 10:43:34 -0700 Received: from tiere.net.avaya.com (localhost [127.0.0.1]) by tiere.net.avaya.com (Switch-3.1.2/Switch-3.1.0) with ESMTP id j72Hf5HX018359 for ; Tue, 2 Aug 2005 13:41:05 -0400 (EDT) Received: from CAQ010AVEXU1.global.avaya.com (h148-147-57-33.avaya.com [148.147.57.33]) by tiere.net.avaya.com (Switch-3.1.2/Switch-3.1.0) with ESMTP id j72HbEHX012403 for ; Tue, 2 Aug 2005 13:38:20 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: SAXException: Found character data inside an array element while deserializing Date: Tue, 2 Aug 2005 10:39:19 -0700 Message-ID: <5C7752CCB00C3A47A70D5C4204A360B205959D99@CAQ010AVEX1U.sv.avaya.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: SAXException: Found character data inside an array element while deserializing Thread-Index: AcWUdjmxAkoBm+0tTYijBEnioMykMwDEp1/w From: "Yakulis, Ross \(Ross\)" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Okay finally figured this out. It turns out in addition to registering a serialized facotry ofr the array call.registerTypeMapping(int.class, new = QName("http://www.w3.org/2001/XMLSchema", "int"), =20 ArraySerializerFactory.class, = ArrayDeserializerFactory.class); You also need to register a serializer factory for int. call.registerTypeMapping(int.class, new = QName("http://www.w3.org/2001/XMLSchema", "int"), =20 = SimpleSerializerFactory.class,SimpleDeserializerFactory.class); Ross =20 -----Original Message----- From: Anne Thomas Manes [mailto:atmanes@gmail.com] Sent: Friday, July 29, 2005 12:35 PM To: axis-user@ws.apache.org Subject: Re: SAXException: Found character data inside an array element while deserializing I think you want to invoke the request like this: Object ret =3D call.invoke(x); When using WRAPPED, Axis automatically marshals the parameters into the wrapper element for you. Alternatively, you could change the style to DOCUMENT: call.setOperationStyle(org.apache.axis.constants.Style.DOCUMENT) Anne On 7/27/05, Yakulis, Ross (Ross) wrote: > I am using Java2Wsdl and WSDL2Java to create a web service and also = invoke it. This all works fine. > However, in my end use of axis, in an applicaiton developlent tool, I = cannot use the generated > XXXSoapBIndingStub.java code, rather I need to dynamically create the = call. In looking at the > code that WSDL2Java generates I have tried to distill that down. = However in my code when I call the > service, I getn teh SAXException: Found character data inside an array = element while deserializing, > even though the same SOAP messages are send in both cases. This leads = me to believe that I am > not setting up something correctly when invoking the web service. = However I am at a loss to > determine what I am missing. The service is a "wrapped" service. I = only have this problem for > an array of simple types. Using an array of benas things work (though = the code below would > be a tad different. >=20 > Any thoughts? >=20 > Ross >=20 > ------------ Source Code Simplified version = ---------------------------- >=20 > public class CallService { >=20 > public static void main(String[] args) { > try { > Service service =3D new Service(); > Call call =3D (Call) service.createCall(); > = call.setTargetEndpointAddress("http://localhost:6060/axis/services/Simple= Wrap"); > call.setOperationName("srIntArray"); > = call.setOperationStyle(org.apache.axis.constants.Style.WRAPPED); > = call.setOperationUse(org.apache.axis.constants.Use.LITERAL); > call.setUseSOAPAction(true); > call.setSOAPActionURI(""); > = call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, = Boolean.FALSE); > = call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, = Boolean.FALSE); > call.setEncodingStyle(null); > = call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);= > service.setTypeMappingVersion("1.2"); >=20 > call.registerTypeMapping(int.class, new = QName("http://www.w3.org/2001/XMLSchema", "int"), = ArraySerializerFactory.class, > ArrayDeserializerFactory.class); > call.addParameter(new QName("urn:x.SimpleWrap", "values"), = new QName("http://www.w3.org/2001/XMLSchema", "int"), > ParameterMode.IN); > call.setReturnType(new = javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); > call.setReturnClass(int[].class); > call.setReturnQName(new = javax.xml.namespace.QName("urn:x.SimpleWrap", "srIntArrayReturn")); >=20 > /* gather up the input parameters */ > Object[] parms =3D new Object[1]; > int[] x =3D new int[2]; > x[0] =3D 450; > x[1] =3D 340; > parms[0] =3D x; >=20 > /* make the call */ > Object ret =3D call.invoke(parms); >=20 > } catch (Exception e) { > System.out.println("Error on Web Serivce call:" + e); > e.printStackTrace(); > } > } > } >=20 > ---------- WSDL ------------------ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >