Malformed XML

Applies to ReadyAPI 3.8, last modified on June 21, 2021

To test the behavior of your service, try sending different variations of malformed XML content.

  • Volatile elements:

    <login>
        <user_name> smartbear</username>
        <pass_word> ReaDyAP1R0ck5</password>
    </login>

    <login>
        <user> smartbear</username>
        <pass> ReaDyAP1R0ck5</password>
    </login>

    The following result reveals the required element in the login request:

    <loginresponse>
        <error>element username is expected.</error>
    </loginresponse>

  • Missing end elements:

    <login>
        <username>smartbear<username>
        <password>ReaDyAP1R0ck5</password>
    </login>

  • Missing start elements:

    <login>
        <user>smartbear</username>
        <password>ReaDyAP1R0ck5</password>
    </login>

  • Malformed namespaces.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:demo="http://demo.smartbear.com">
        <soapenv:Header/>
        <soapenv:Body>
            <demo:login>
            <demo:username> smartbear</demo:username>
            <demo:password> ReaDyAP1R0ck5</demo:password>
            <demo:/login>
        </soapenv:Body>
    </soapenv:Envelope>

    For this request, use the following options:

    1. Change one of the namespaces.

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:demo="http://demo.smartbear.com">
      <soapenv:Header/>
          <soapenv:Body>
              <demo:login>
              <username> smartbear</demo:username>
              <demo:password> ReaDyAP1R0ck5</demo:password>
              <demo:/login>
          </soapenv:Body>
      </soapenv:Envelope>

    2. Put an extra quote:

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"">
          <soapenv:Header/>
          <soapenv:Body>
              <demo:login>
              <username> smartbear</demo:username>
              <demo:password> ReaDyAP1R0ck5</demo:password>
              <demo:/login>
              </soapenv:Body>
      </soapenv:Envelope>

See Also

Sample Login Tests

Highlight search results