axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yates, Danny (ANTS)" <danny.ya...@ants.co.uk>
Subject RE: xml document as string
Date Wed, 20 Nov 2002 09:01:57 GMT
Hi,

This is not really an AXIS issue, but an XML one.

As you guessed, an XML element cannot contain the literal characters

 < / e l e m e n t >

because < and > are not allowed in the PCDATA content of an element.
If you attempt to do this, the illegal characters are escaped as
&lt; and &gt; (and & is escaped as &amp;). When you (or AXIS) extracts
the element content at the other end, the escaped character strings
are restored to their original values. Note that if you tried to send
the literal characters:

  & l t ; / e l e m e n t & g t ;

your string would be encoded as &amp;lt;/element&amp;gt;, and you would
get back the literal characters you put in, not what you might expect
(with < and > in).

Hope that helps,

Dan.

-- 
Danny Yates
Technical Architect
Abbey National Treasury Services
E-mail: Danny.Yates@ants.co.uk
Phone: +44 20 7756 5012
Fax: +44 20 7612 4342


-----Original Message-----
From: tom schuring [mailto:tomschuring@mac.com]
Sent: 20 November 2002 01:08
To: axis-user@xml.apache.org
Subject: Re: xml document as string


Hello Steve,

thanks for that. i did find out that axis client automatically does the
encoding so sending "</envelope>" will not harm anything. i am wondering if
this is the standard and where i can find the standard that tells me exactly
this and the encoding used .

best regards,
tom

On Tuesday, Nov 19, 2002, at 04:18PM, Steven Gollery
<sgollery@cadrc.calpoly.edu> wrote:

>Tom,
>
>There's a reasonably simple way to find out for sure: construct a web 
>service that takes a string parameter and then pass "</envelope>" and 
>see what happens.
>
>Looking through the code, parameters become instances of RPCParam, and 
>serializing strings in RPCParam results in them being encoded.
>
>So it looks like you don't need to deal with encoding strings yourself: 
>Axis will do it for you.
>
>Steve Gollery
>
>
>tom schuring wrote:
>
>>hello,
>>
>>i'm sending a serialized xml doc via an RPC-SOAP call with a signature
something like:
>>
>>String sendDocument(String myXmlString);
>>
>>when i use one of the examples to send something i see that it
automatically encodes by xml-document so it fits in the envelope. (meaning <
get replaced by &lt;  etc.. ).
>>it all seems to work so the axis server must decode it back when i get it
whithout me having to do anything about it.
>>
>>my questions:
>>
>>1) what encoding is used for a normal (java?)String parameter in RPC-SOAP
?
>>2) is this in the SOAP specification ? 
>>
>>any feedback welcome.
>>thanks,
>>tom
>>
>>ps: the reason i'm asking is that one of the users of the webservice is
convinced that you don't need to encode strings. but that would seem silly
to because it would make the protocol non-transparent. it would break
whenever someone tries to send a </envelope> string. or am i mistaken ?
>>
>>
>>
>>
>
>
>
>


***************************************************************************
This communication (including any attachments) contains confidential information.  If you
are not the intended recipient and you have received this communication in error, you should
destroy it without copying, disclosing or otherwise using its contents.  Please notify the
sender immediately of the error.

Internet communications are not necessarily secure and may be intercepted or changed after
they are sent.  Abbey National Treasury Services plc does not accept liability for any loss
you may suffer as a result of interception or any liability for such changes.  If you wish
to confirm the origin or content of this communication, please contact the sender by using
an alternative means of communication.

This communication does not create or modify any contract and, unless otherwise stated, is
not intended to be contractually binding.

Abbey National Treasury Services plc. Registered Office:  Abbey National House, 2 Triton Square,
Regents Place, London NW1 3AN.  Registered in England under Company Registration Number: 2338548.
 Regulated by the Financial Services Authority (FSA).
***************************************************************************


Mime
View raw message