soapsoapuisoap-client

Special Character Closing tag issue in SOAP UI


I am using below request in SOAP UI. One of the parameter has '&' part of string value due to which closing tag gets disappeared. Any solution for that?

    <!--Optional:-->
    <ns:SvcConsumer>XYZ</ns:SvcConsumer>
    <!--Optional:-->
    <ns:SvcPassword>"SL&3IHO76$F*43=hjk"</ns:SvcPassword>
    <!--Optional:-->

The SvcPassword tag in above request gets disappeared


Solution

  • You need to either escape the & (replace it with &amp;)

        <!--Optional:-->
        <ns:SvcConsumer>XYZ</ns:SvcConsumer>
        <!--Optional:-->
        <ns:SvcPassword>"SL&amp;3IHO76$F*43=hjk"</ns:SvcPassword>
    

    or put it in a CDATA block:

        <!--Optional:-->
        <ns:SvcConsumer>XYZ</ns:SvcConsumer>
        <!--Optional:-->
        <ns:SvcPassword><![CDATA["SL&3IHO76$F*43=hjk"]]></ns:SvcPassword>