Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 7888 invoked from network); 28 Mar 2008 22:19:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Mar 2008 22:19:11 -0000 Received: (qmail 49876 invoked by uid 500); 28 Mar 2008 22:19:10 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 49317 invoked by uid 500); 28 Mar 2008 22:19:09 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 49306 invoked by uid 99); 28 Mar 2008 22:19:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Mar 2008 15:19:09 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jgawor@gmail.com designates 64.233.184.226 as permitted sender) Received: from [64.233.184.226] (HELO wr-out-0506.google.com) (64.233.184.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Mar 2008 22:18:29 +0000 Received: by wr-out-0506.google.com with SMTP id 50so412027wra.13 for ; Fri, 28 Mar 2008 15:18:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=0dbHeSXnSD75W88qioqA1Qga2ii3sI8xwfikpen7At4=; b=U3A4BaW24pN8oAvJD8k7IekEp6ThTbZY+aDEPKYiuGWJgpTKrWTZoamNIkK/B/Gs6+I1YqQTr4n1nitbNk06E+6Jek7cGlafwgm9w45Kq18NrRiTEyxTuNSu6CX1byLGNbOn2fjNdx8I4BFRe82YhamttsQFRxwipjPfqssfwec= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=fwBmrDebQ1YODv88OsCSuTR1v5GKMkwySF2b9yLSrroxWwiCOdAL2lDNTTbjoLkFBguqaDE+SlsC6t9imn2Ud8JZvTtTxvypJO3V6geSCrXTj6vnOVQksPXlQRm/Ab7imVSjuJLWOJga1RK3KJdAApHZh0HOIBT4sdqLYHQPt9U= Received: by 10.114.202.15 with SMTP id z15mr4824620waf.72.1206742714275; Fri, 28 Mar 2008 15:18:34 -0700 (PDT) Received: by 10.114.79.8 with HTTP; Fri, 28 Mar 2008 15:18:34 -0700 (PDT) Message-ID: <5eb405c70803281518q1323390esd4fc1faad089d85a@mail.gmail.com> Date: Fri, 28 Mar 2008 18:18:34 -0400 From: "Jarek Gawor" To: user@geronimo.apache.org Subject: Re: Returning String[] from WebService method In-Reply-To: <26352931.465701206741631307.JavaMail.root@cdptpa-web18-z02> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <26352931.465701206741631307.JavaMail.root@cdptpa-web18-z02> X-Virus-Checked: Checked by ClamAV on apache.org Just from a quick glance it looks like the result.jsp is not quite right. It should look like the one shown here: http://cwiki.apache.org/GMOxDOC21/simple-web-service-with-jax-ws.html (titled add.jsp where jndi lookup is done). See if changing that helps. Jarek On Fri, Mar 28, 2008 at 6:00 PM, wrote: > I'm having a problem returning a String array from a method of a webservice. In order to provide a simple way to recreate the problem, I modified the 2.1 webservices sample ( http://cwiki.apache.org/GMOxDOC21/developing-a-simple-calculator-web-service.html ) such that the add() method returns a String[] instead of an int. The mods were simple, I changed the "return" element of the addResponse in the wsdl of the sample > from: > > to: > > and the CalculatorService.java (and the corresponding interface it implements) from: > public int add(int value1, int value2) { > ... > return value1 + value2; > to: > public String[] add(int value1, int value2) { > ... > return new String[]{"Value 1", String.valueOf(value1), "Value 2", String.valueOf(value2), String.valueOf(value1 + value2)}; > > and then changed the result.jsp to expect a String[] and iterate over the contents printing out each element, If I add 3 + 4, I expected the result.jsp to display: > > Value 1 > 3 > Value 2 > 4 > 7 > > but I get instead: > Value > 1 > 3 > Value > 2 > 4 > 7 > > It seems that in the process of converting the response into a Java String[], the whitespace of the individual strings is acting as a delimiter. Thus instead of getting an array of 5 strings, I get an array of 7 strings instead. What have I misconfigured? > > Fred >