Kbase P85879: How do I use character references in a complex Web Service parameter
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  6/24/2004 |
|
Status: Unverified
GOAL:
How do I use character references in a complex Web Service parameter
GOAL:
Using character references in a complex WebService parameter
FACT(s) (Environment):
UNIX
FACT(s) (Environment):
Windows
FACT(s) (Environment):
OpenEdge 10.0x
FIX:
When calling a Web Service from a 4GL client having a parameter that contains a complex value, it is necessary to construct or parse an XML fragment. There are two ways to construct the XML value and three ways to parse the value. These are:
1. 4GL DOM API
2. 4GL SAX API (parsing only)
3. String manipulation
If string manipulation is used, the 4GL programmer should be aware that text values within the XML fragment may contain character references. The most common of these are <, >, &, ' and ". These translate to <, >, &, ' and ". It is up to the programmer, when parsing, to translate the references to the actual characters and, when constructing the value, to replace the characters with their references.
Failure to make the replacements when constructing the values will result in errors related to the parsing of the XML fragment.
Failure to make the replacements when parsing the values will result in string values containing the character reference. For example a string that is intended to be
He said, "Hi."
would appear as
He said, "Hi."
Note this issue applies only when using string manipulation. If either of the 4GL AIs is used, the replacements are automatically performed.