I have run into an issue with the XML that is being returned by the API not being properly escaped. When I try and update a field using the MethodAPIUpdateV2 or MethodAPIInsertV2 calls, if a field is not valid, for instance, if it is to long, the API returns a message with the error. As an example I am trying to update my first name which is limited to 25 characters and this is the response I get back:
<?xml version="1.0" encoding="windows-1252" ?><MethodAPI response = "DanielDanielDanielDanielDaniel is too long for insertion (30 characters). The value must be 25 characters or less." ></MethodAPI>
This response is fine, the problem is, if the text I try to insert contains a < symbol, the XML is not properly escaping that value, which means the XML is invalid, and when I try to parse it I encounter an error. When The value I pass contains the < symbol, this is the response:
<?xml version="1.0" encoding="windows-1252" ?><MethodAPI response = "<DanielDanielDanielDanielDaniel is too long for insertion (31 characters). The value must be 25 characters or less." ></MethodAPI>
This is not valid XML, and when I try and parse it I get the error "simplexml_load_string(): Entity: line 1: parser error : Unescaped '<' not allowed in attributes values "
Can you investigate this issue and let me know if you can update the XML response to properly escape the characters.