Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 71834 invoked from network); 31 Aug 2005 09:05:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Aug 2005 09:05:37 -0000 Received: (qmail 14538 invoked by uid 500); 31 Aug 2005 09:05:26 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 14520 invoked by uid 500); 31 Aug 2005 09:05:26 -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 14506 invoked by uid 99); 31 Aug 2005 09:05:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Aug 2005 02:05:26 -0700 X-ASF-Spam-Status: No, hits=2.3 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,FROM_ENDS_IN_NUMS,MSGID_FROM_MTA_HEADER,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of plork123@hotmail.com designates 65.54.161.21 as permitted sender) Received: from [65.54.161.21] (HELO hotmail.com) (65.54.161.21) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Aug 2005 02:05:40 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 31 Aug 2005 02:05:23 -0700 Message-ID: Received: from 65.54.161.201 by by106fd.bay106.hotmail.msn.com with HTTP; Wed, 31 Aug 2005 09:05:23 GMT X-Originating-IP: [65.54.161.201] X-Originating-Email: [plork123@hotmail.com] X-Sender: plork123@hotmail.com In-Reply-To: <85246635F4B873488A4020DFBA2E112201E926D0@abmukdove.abm-uk.com> From: "Plorks mail" To: axis-user@ws.apache.org Subject: RE: xml with strange characters Date: Wed, 31 Aug 2005 09:05:23 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 31 Aug 2005 09:05:23.0587 (UTC) FILETIME=[1EE11D30:01C5AE0B] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I use document/literal sytle looking at the soap using tcpmon it looks like this <![CDATA[<?xml version="1.0" encoding="UTF-8"?> <ROOT><RECORD><id>1</id><id>1</id><contactid>20</contactid&id>1</id><contactid>29</contactid><emailcount>2</emailcount><emailaddress>jkl@email.com</emailaddress></RECORD></ROOT> ]]> but when i retutn the result using call.invoke the xml is well formed >From: "Chris Nappin" >Reply-To: axis-user@ws.apache.org >To: >Subject: RE: xml with strange characters >Date: Wed, 31 Aug 2005 09:57:17 +0100 > >You might be able to get away with that if you know your XML never contains >"]]". > >The "proper" way to pass XML in a web service is to use the >"document/literal" style - have a look at the Axis User guide for further >details. > > >-----Original Message----- >From: Plorks mail [mailto:plork123@hotmail.com] >Sent: 31 August 2005 09:52 >To: axis-user@ws.apache.org >Subject: Re: xml with strange characters > > > >thanks - don't know whether you have heard of it, but we are uisng a >product called laszlo and even though the xml i return is perfect when i >write a java client to my web service when laszlo is used it escapes the >angle brackets - we have now found out xml isn't supported! > >so now i have to re-write my ws > >i have this code which returns the xml > >StringWriter writer = new StringWriter(); > >// create a resultsetbuilder to transform resultset to XML >try >{ >RecordsetToXML rsXML = new RecordsetToXML(rs, "ROOT", "RECORD"); > >// create the XML from recordset >Document jDOMDoc = rsXML.build(); >rs = null; >XMLOutputter outputter = new XMLOutputter(); >outputter.output(jDOMDoc, writer); >result = writer.toString(); >//System.out.print("XML " + writer); >writer.close(); >} > >....... > >return result; > > >So do i do this - [CDATA[writer.toString()]] > > >when i'm testing i do String ret - (String) call.invoke(new >Object[]{params}); as normal > > > >thanks for your help > > > > > > > >From: Guy Rixon > >Reply-To: axis-user@ws.apache.org > >To: axis-user@ws.apache.org > >Subject: Re: xml with strange characters > >Date: Wed, 31 Aug 2005 09:17:46 +0100 (BST) > > > >CDATA like this: instead of > > > > String s = "..."; > > > >put > > > > String s = "...]]>"; > > > >in the string that you return from your service implementation. This >makes > >the > >return message something like > > > > > > > > > > ...]]> > > > > > > > > > > > >See > > > > http://www.w3schools.com/xml/xml_cdata.asp > > > >for more details and examples. > > > >However, doing it that way is against the spirit of SOAP. You should >really > >have your someXmlStructure directly in the body of the message: > > > > > > > > ... > > > > > > > >If you mapped someXmlStructure to SomeJavaClass using WSDL2Java, then you > >could return an instance of SomeJavaClass from your service >implementation > >and > >Axis would serialize it into the required XML. If you want to generate >your > >someXmlStructure as a DOM, then you might be able to get that serialized; > >check out the SAAJ spec. (Anybody have a succint example of returning a >DOM > >from a service implementation?) I don't think Axis has a way to accept > >serialized XML from a service implementation; i.e. you can't write out > >text-with-angle-brackets and have Axis include it literally in the return > >message, other than the XML-in-a-string trick that you've already found. > > > >Cheers, > >Guy > > > > > > > >On Wed, 31 Aug 2005, Plorks mail wrote: > > > > > > > > hi > > > > > > i'm returning the xml as a result of call.invoke. when i write a test > > > client using java the xml is well frmed, however we are also usg an > > > application called laszlo, but when you get the same xml using laszlo > >that's > > > whe it comes back with the &alt for the angle brackets > > > > > > would it be possible to lead me to an example of cdata and sending the > >xml > > > as the body of the message (i think this is what i'm doing but just >want > >to > > > make sure) > > > > > > thanks for your help > > > > > > > > > >From: Guy Rixon > > > >Reply-To: axis-user@ws.apache.org > > > >To: axis-user@ws.apache.org > > > >Subject: Re: xml with strange characters > > > >Date: Tue, 30 Aug 2005 17:24:35 +0100 (BST) > > > > > > > >If I understand you correctly, you're putting data marked up as XML >in > >a > > > >string and then sending that string as an XML element in a SOAP > >message. In > > > >this usage, Axis has to turn the angle brackets into entity >references > >in > > > >order to make the XML well-formed; you're not allowed to have literal > >angle > > > >brackets in the value of an XML element. > > > > > > > >If you desparately need to send your XML structure as the value of > > > >some XML element, then you can wrap it in a CDATA section so that >Axis > >need > > > >not mess > > > >with the angle brackets. However, why not just send the XML as the >body > >of > > > >the > > > >message (normal document/literal style)? > > > > > > > >On Tue, 30 Aug 2005, Plorks mail wrote: > > > > > > > > > > it's not - when the client receives the xml it has &alt instead of >< > >or > > > > > > > > > > > > > > > Also when i test my service get the same characters in the soap > >message > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > > > >From: WAJSBERG Julien RD-BIZZ > > > > > >Reply-To: axis-user@ws.apache.org > > > > > >To: axis-user@ws.apache.org > > > > > >Subject: Re: xml with strange characters > > > > > >Date: Tue, 30 Aug 2005 14:30:59 +0200 > > > > > > > > > > > >Plorks mail a �crit : > > > > > > > > > > > > > > > > > > > > hi all > > > > > > > > > > > > > > i'm retruning a xml string when a method is called. > > > > > > > > > > > > > > When i look at the soap returned xml is formatted with < > > > >charactes > > > > > > > instead of < or > > > > > > > > > > > > > > > e.g. > > > > > > > > > > > > > > <ROOT> > > > > > > > ............ > > > > > > > </ROOT> > > > > > > > > > > > > > > can anyone help me to solve this > > > > > > > > > > > > >Why is it a problem ? > > > > > >Axis should deserialize this message correctly on the client > >side... > > > > > > > > > > > > > > > > _________________________________________________________________ > > > > > Want to block unwanted pop-ups? Download the free MSN Toolbar now! > > > > > http://toolbar.msn.co.uk/ > > > > > > > > > > > > >Guy Rixon gtr@ast.cam.ac.uk > > > >Institute of Astronomy Tel: +44-1223-337542 > > > >Madingley Road, Cambridge, UK, CB3 0HA Fax: +44-1223-337523 > > > > > > _________________________________________________________________ > > > Want to block unwanted pop-ups? Download the free MSN Toolbar now! > > > http://toolbar.msn.co.uk/ > > > > > > >Guy Rixon gtr@ast.cam.ac.uk > >Institute of Astronomy Tel: +44-1223-337542 > >Madingley Road, Cambridge, UK, CB3 0HA Fax: +44-1223-337523 > >_________________________________________________________________ >Winks & nudges are here - download MSN Messenger 7.0 today! >http://messenger.msn.co.uk > > > > >CONFIDENTIALITY & PRIVILEGE NOTICE > >This e-mail is confidential to its intended recipient. It may also be >privileged. Neither the confidentiality nor any privilege attaching to this >e-mail is waived lost or destroyed by reason that it has been mistakenly >transmitted to a person or entity other than its intended recipient. If you >are not the intended recipient please notify us immediately by telephone or >fax at the numbers provided above or e-mail by Reply To Author and return >the printed e-mail to us by post at our expense. We believe, but do not >warrant, that this e-mail and any attachments are virus-free, but you >should check. We may monitor traffic data of both business and personal >e-mails. We are not liable for any opinions expressed by the sender where >this is a non-business e-mail. If you do not receive all the message, or if >you have difficulty with the transmission, please telephone us immediately. _________________________________________________________________ Winks & nudges are here - download MSN Messenger 7.0 today! http://messenger.msn.co.uk