Warning: failed to parse the XML document

458 views
Skip to first unread message

Tomas Rabazo

unread,
Jun 5, 2021, 12:27:59 PM6/5/21
to wiremock-user
Hello

I am trying to send an empty json body but Wiremock says:

2021-06-05 16:20:45.046 Warning: failed to parse the XML document
XML: {}
  • This is the Request:
Accept-Encoding: gzip,deflate
Content-Type: application/json
Content-Length: 2
Host: localhost:57002
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.5 (Java/12.0.1)
{}

  • This is the Wiremock:
{
"request": {
"method": "POST",
"urlPathPattern": "/services/oauth2/token.*",
"headers": {
"Content-Type": {
"contains": "application/json",
"caseInsensitive": true
}
},
"bodyPatterns" : [
{ "equalToJson" : "{}", "jsonCompareMode": "LENIENT" }
]
},
"response": {
"status": 200,
"bodyFileName": "SalesForce/SF_Services_Oauth2_Token.json",
"headers": {
"Content-Type": "application/json"
}
}
}

Thanks

Tom Akehurst

unread,
Jun 7, 2021, 1:51:34 PM6/7/21
to wiremock-user
Do you also have another stub present that uses an XML matcher?

Tomas Rabazo

unread,
Jun 7, 2021, 2:12:58 PM6/7/21
to wiremock-user
Exactly. I have another set of mappings for xml request/response.

Tom Akehurst

unread,
Jun 7, 2021, 2:20:45 PM6/7/21
to wiremock-user
You probably don't need to worry about that warning in that case, provided your JSON stub is being matched as you expect.

Tomas Rabazo

unread,
Jun 7, 2021, 2:22:01 PM6/7/21
to wiremock-user
Ok Thanks
Reply all
Reply to author
Forward
0 new messages