Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Interest »

Re: Returning strings containing XML/HTML from Web service call to SOAP::Lite

Mike New

2005-02-15

Replies:

Jones, Douglas 1 wrote:
> I ran into a similar problem with SOAP, however it was using different
> libraries in a different language. Unless this affecting a great many
> characters that you can't predict, I would suggest creating a simple
> find/replace method to search for '<', '>', etc. and replace them
> with '<' and '>' and so on.
>
> The only other suggestion that I can offer is that here we use Apache
> Axis to handle SOAP encoding in our Java environment and we are able to
> return Strings containing XML without the '<' and '>' characters being
> encoded.
>

String now has a replaceAll method:

replaceAll

public String replaceAll(String regex,
                String replacement)

  Replaces each substring of this string that matches the given
regular expression with the given replacement.

  An invocation of this method of the form str.replaceAll(regex,
repl) yields exactly the same result as the expression

     Pattern.compile(regex).matcher(str).replaceAll(repl)

  Parameters:
     regex - the regular expression to which this string is to be
matched
  Returns:
     The resulting String
  Throws:
     PatternSyntaxException - if the regular expression's syntax is
invalid
  Since:
     1.4
  See Also:
     Pattern


Mike New
----------------------------- _/ /\/\ /\/ --------------------------
J. Michael New                     mailto:mike@(protected)
1-613-796-0652                     http://www.noozoo.com/

      - Michael New is absolutely right and
        Bill Clinton is absolutely wrong.
                            - Pat Buchanan
--------------------------------------------------------------------

===========================================================================
To unsubscribe, send email to listserv@(protected)
of the message "signoff J2EE-INTEREST". For general help, send email to
listserv@(protected)".
©2008 junlu.com - Jax Systems, LLC, U.S.A.