You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2002/09/09 20:33:37 UTC

DO NOT REPLY [Bug 12452] New: - Axis fails to http-encode & (ampersands)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12452>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12452

Axis fails to http-encode & (ampersands)

           Summary: Axis fails to http-encode & (ampersands)
           Product: Axis
           Version: current (nightly)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: hhuang@kodak.com


If I have the following Java code, where http is a String:

UrlType url = new urlType();
url.name = "http://mysite.com?a=1&b=2";

Axis should serialize as:

<url>
  <name>http://mysite.com?a=1&amp;b=2</name>
</url>

Where an ampersand (&) is serialized as:  &amp;

Axis currently does not do this. The &amp; must be explicitly written in code, 
like:

url.name = "http://mysite.com/a=1&amp;b=2";

Apache SOAP 2.2 automatically HTML-encodes strings. Apache also automatically 
HTML-decodes &amp;'s to &'s.

I did not test whether Axis HTML-decodes. Axis should HTML-encode and decode 
automatically. Otherwise, every string must be encoded and decoded in the Java 
code.

-Han Huang
hhuang@kodak.com