andrew_laser_1
15 years agoNew Contributor
No mapping for the Unicode character exists in the target multi-byte code page.
Got the following exception when logging xmlhttp.responseText in the function below:
WinHttp.WinHttpRequest
No mapping for the Unicode character exists in the target multi-byte code page.
var sInput =
'payload=<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><GetUserSessionId xmlns="http://www.companyname.com/UR_ESB"><GuestMode>false</GuestMode><WorkId></WorkId></GetUserSessionId>';
function PostXml(sURL, sXmlInput)
{
var xmlhttp = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
xmlhttp.open("POST", sURL, false, "", "");
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.send(sXmlInput);
Log.Message(xmlhttp.responseText) //!!! Causes exception, probably because of UTF-8 encoding
}
When using JMeter for testing the same sXmlInput got no such issues. Here is the response received from JMeter:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Response xmlns="http://www.companyname.com/UR_ESB"><UserSessionId>G48ykMDalwKvwkgsMkQCnT5kYLVY9YNuDSkF+DdnWvUAqgfbbclskQxTZ7LS</UserSessionId><status>0</status><text>Operation completed without exception.</text></Response>
Does anybody have any idea, how to make TestComplete receive this UTF-8 response?