You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by "Micael Ericsson (QIN)" <Mi...@ein.ericsson.se> on 2001/08/24 17:06:20 UTC

RE: (Updated) Problem with < and > as parameter value

Now it is even more confusing.
I have a service method with two parameters called systemType and systemID. Both have type String.
If I supply 'a<aa' as value to systemType I get an parser error, but NOT to systemID parameter. I have tried all possible combinations and systemID is always parsed correctly but systemType is never parsed correctly.

Does this make any sense?

Regards,
Micael E.
//Se below for more info


-----Original Message-----
From: Micael Ericsson (QIN) [mailto:Micael.Ericsson@ks.ericsson.se]
Sent: Thursday, August 23, 2001 5:13 PM
To: 'soap-user@xml.apache.org'
Subject: RE: Problem with < and > as parameter value


The problem is that soap and xerces/jaxp does a good job parsing '<' to '&lt;', but not so good job translating back.

On clinet side an instance of Parameter class is created with 'good<day' as value and used in Call.invoke(). Before reaching my service classes on server side soap and xerces/jaxp parses '&lt;' back to '<' and sees this as a problem character instead of just sending the string 'good<day' to my service class. 

/Micael E.

-----Original Message-----
From: Ed Yu [mailto:ekyu@asgnet.psc.sc.edu]
Sent: Thursday, August 23, 2001 5:08 PM
To: 'soap-user@xml.apache.org'
Subject: RE: Problem with < and > as parameter value


Here is what I've recently worked with to translate special characters into
proper XML:


 charater/sequence            entity reference(replacement)
            &                                 &amp;
          ]]>                                  ]]&gt;
           <                                   &lt;

Unfortunately, I don't recall where the source of it is from. Good Luck!

-----Original Message-----
From: Micael Ericsson (QIN) [mailto:Micael.Ericsson@ein.ericsson.se]
Sent: Thursday, August 23, 2001 10:53 AM
To: 'soap-user@xml.apache.org'
Subject: RE: Problem with < and > as parameter value


When using TcpTunnelGUI to monitor XML messages transfer I can see that the
sent string "good<day" (as parameter value to a service method) in the XML
message has the text "good&lt;day". 

After that Xerces/JAXP converts/serializes this to a String, but something
goes wrong and a error message is returned to SOAP client.

I have tested this on Xerces 1.2.3 and 1.4.3, and JAXP 1.1. All versions
gives error but different error messages. 

Bug in XML perser/String serializer or encoding setting?
Anyone know where to find specifivcation for which characters are possible
to user as request parameter values.

/Micael E.

-----Original Message-----
From: Paco Avila [mailto:favila@gridsystems.com]
Sent: Thursday, August 23, 2001 4:35 PM
To: soap-user@xml.apache.org
Subject: Re: Problem with < and > as parameter value


> That's because you can't have special characters
> like < and > in your strings.  Try encoding them
> using base64 encoding.

The "<" character shold be converted to "&lt;" and
">" to "&gt;". This should be done in the SOAP library,
I think...