Forum Discussion

chinthasantosh's avatar
chinthasantosh
Occasional Visitor
5 years ago

FaultString - Illegal semicolon, not in group

Hi All,

i am having soap Webservice , in which i have to pass special characters like (&,;,>,<).

When i use these characters in request .i am getting below error
<faultstring>Illegal semicolon, not in group</faultstring>

 

Critical Request attribute
<link>"http=test.test.com&amp;csf=1&amp;web=1&amp;e=abcd"</link>

 

Could you please suggest how to resolve the error 

  • richie's avatar
    richie
    Community Hero
    Hey chinthasantosh

    The characters you tried to use are reserved in xml (so reserved in SOAP messages) as these characters are actually entity placeholders.
    There are 5 defined xml entities
    Double quot (")
    Single quote (')
    Greater than (>)
    Less than (<)
    Ampersand (&)

    So you need to escape these characters so instead of using the character, e.g. '&' as part of a tag value you need to use the escape sequence

    So instead of
    <element>&</element>

    You use
    <element>&amp;</element>

    Escape sequences are as follows:

    Double quot (") == &quot;
    Single quote (') == &apos;
    Greater than (>) == &gt;
    Less than (<) == &lt;
    Ampersand (&) == &amp;

    Hope ive been clear,

    Rich