Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 81432 invoked from network); 14 Dec 2006 21:46:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Dec 2006 21:46:08 -0000 Received: (qmail 90821 invoked by uid 500); 14 Dec 2006 21:46:04 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 90799 invoked by uid 500); 14 Dec 2006 21:46:04 -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 90772 invoked by uid 99); 14 Dec 2006 21:46:04 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2006 13:46:04 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [216.154.209.20] (HELO volume4.com) (216.154.209.20) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2006 13:45:52 -0800 Received: from [41.242.10.222] (dsl-242-10-222.telkomadsl.co.za [41.242.10.222]) by volume4.com (8.12.11.20060308/8.12.11) with ESMTP id kBELoXmb024451 for ; Thu, 14 Dec 2006 16:50:37 -0500 Message-ID: <4581C5F9.1070000@volume4.com> Date: Thu, 14 Dec 2006 23:45:29 +0200 From: Schalk Neethling User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: axis-user@ws.apache.org Subject: Re: XMLStreamException References: <4581BDA2.1040001@volume4.com> <1166132428.4154.21.camel@null.tough.com.ar> In-Reply-To: <1166132428.4154.21.camel@null.tough.com.ar> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: milter-spamc/0.25.321 ( [0.0.0.0]); Thu, 14 Dec 2006 16:50:38 -0500 X-Spam-Level: Received-SPF: none (volume4.com: schalk@volume4.com does not designate permitted sender hosts) receiver=volume4.com; client-ip=41.242.10.222; helo=[41.242.10.222]; envelope-from=schalk@volume4.com; x-software=spfmilter 0.97 http://www.acme.com/software/spfmilter/ with libspf2-1.0.0; X-Virus-Scanned: ClamAV 0.87/2329/Wed Dec 13 22:02:58 2006 on volume4.com X-Virus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Flag: NO X-Old-Spam-Status: NO, hits=-102.80 required=2.50 Greetings Javier, If you could send me the skeleton code that would be very helpful. Thanks! Javier Kohen wrote: > El jue, 14-12-2006 a las 23:09 +0200, Schalk Neethling escribió: > >> Hi there everyone, >> >> My apologies beforehand for the large amount of code etc. I am new to >> Axis2 and I am currently implementing a web service. All is going well >> except when executing the code below I get the following error: >> >> INFO - [org.apache.commons.httpclient.HttpMethodDirector] - I/O >> exception (org.apache.axis2.AxisFault) caught when processing request: >> Can not output XML declaration, after other output has already been >> done.; nested exception is: >> javax.xml.stream.XMLStreamException: Can not output XML declaration, >> after other output has already been done. >> > > I've seen this just yesterday myself. > > >> SOAPBody body = factory.createSOAPBody(envelope); >> OMElement send = factory.createOMElement("Send", ns); >> > [ Lots of code removed. ] > >> body.addChild(send); >> ServiceClient sender = new ServiceClient(); >> sender.setOptions(options); >> OMElement result = sender.sendReceive(envelope); >> > > The solution is to pass sendReceive the send element directly; don't > pass it the envelope and body elements. SendReceive ends up > unconditionally wrapping the supplied OMElement within a body element. > Note that you can still set headers this way, by means of the > ServiceClient instance. > > In my case, I needed to add two elements to the body, so I had to create > the whole envelope and use the OperationClient interface instead to run > the operation. I can give you skeleton code to do that, in case you need > it, it's only slightly more complex than the above. > > Greetings, > -- Kind Regards Schalk Neethling Developer.President AlliedBridge Landlines Tel: +27125468436 Fax: +21(0)865122050 Web email:info@alliedbridge.com Global: www.alliedbridge.com Messenger Yahoo!: v_olume4 AOL: v0lume4 MSN: volume4_@hotmail.com We support OpenSource and Standards OSI - http://www.opensource.org/ Get Firefox!- The browser reloaded - http://www.mozilla.org/products/firefox/ The information transmitted is intended solely for the individual or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error, please contact the sender and please delete all traces of this material from all devices. --------------------------------------------------------------------- To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-user-help@ws.apache.org