Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 20106 invoked from network); 1 Jun 2005 16:02:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Jun 2005 16:02:45 -0000 Received: (qmail 23441 invoked by uid 500); 1 Jun 2005 16:02:34 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 23427 invoked by uid 500); 1 Jun 2005 16:02:34 -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 23409 invoked by uid 99); 1 Jun 2005 16:02:33 -0000 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=HTML_90_100,HTML_ATTR_UNIQUE,HTML_MESSAGE,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from norman.iris.washington.edu (HELO norman.iris.washington.edu) (128.95.166.28) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 01 Jun 2005 09:02:29 -0700 Received: from [192.168.166.7] (moab.iris.washington.edu [192.168.166.7]) by norman.iris.washington.edu (8.12.10+Sun/8.12.10) with ESMTP id j51G2I2a014702 for ; Wed, 1 Jun 2005 09:02:18 -0700 (PDT) Message-ID: <429DDBA0.8040002@iris.washington.edu> Date: Wed, 01 Jun 2005 09:00:32 -0700 From: Linus Kamb User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: axis-user@ws.apache.org Subject: only 1 of multiple attachments showing up Content-Type: multipart/mixed; boundary="------------060408010606020300090102" X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --------------060408010606020300090102 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I have a web service that is to return binary data as attachments. Using Doc/Lit/wrapped. The interface looks like DataHandler[] getWaveformAttach(WaveformAttachQuery qry); The server appears to be properly packaging up the multiple attachments and returning them. On the client side, the DataHandler[] array is always of length 1. However, if I get the Attachments iterator using locator.getCall().getResponseMessage().getAttachments(), and iterate through the list, all of the attachments are there. I can also see that the attachments have come across as they exist as temp files in the system temp dir. (Another side question on this below.) So my question is, why is the DataHandler[] array always of length 1? Do I *have to* access the attachments through the iterator? Am I doing something else wrong? The java code (with the return type of DataHandler[]) was generated using WSDL2Java. Using 1.2RC3 (also happened RC2). Attached is the WSDL and deploy doc. My aside question is: Why are the temp files being written to the temp dir? Following the code/advice in the FAQ, I wouldn't think that would happen. I do the following: Iterator iterator = locator.getCall().getResponseMessage().getAttachments(); int i = 0; while ( iterator.hasNext() ) { AttachmentPart part = (AttachmentPart) iterator.next(); DataHandler handler = part.getDataHandler(); handler.writeTo(new FileOutputStream(selectedDir.getCanonicalPath() + File.separator + fileNameString( qry[i++] ))); } which *does* write the files to the appropriate dir, but they are *also* written to the temp dir. Sure, I could do File.renameTo() but that may involve copying, depending on the file structure. I vaguely recall from when I last used Axis a couple years ago that I could set the directory where Axis would put the files, but I could not find anything in searching the list or googling, and I could just plain be mis-remembering. Thanks for any insight, Linus --------------060408010606020300090102 Content-Type: text/xml; x-mac-type="0"; x-mac-creator="0"; name="dhi_webservice.wsdl" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dhi_webservice.wsdl" Created using Cape Clear Studio SOA Editor - http://www.capeclear.com Defines a time span with start and end times. A geographic region defined by lat, lon coordinates Defines most basic description of a seismographic station Contains the information needed for a basic station query. Fully describes a seismographic channel Group of BasicStation objects A collection of information on channels Information required to retrieve channels. ChannelName is a string than can contain wildcards. Holder for attachments. Provides description of document type Contains an array of documents Query for information Provides basic station information for a given spatial area and time range. By querying on a specific network and station, user can retrieve a list of channels within that station with detailed information Retrieves the name of the dhi service underlying the web service Request for waveforms with an attachment return --------------060408010606020300090102 Content-Type: text/html; x-mac-type="0"; x-mac-creator="0"; name="dhiws_deploy.wsdd" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dhiws_deploy.wsdd" --------------060408010606020300090102--