Getting an 'Error in XML document' Error when submitting web services XML - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Getting an 'Error in XML document' Error when submitting web services XML (/Thread-Getting-an-Error-in-XML-document-Error-when-submitting-web-services-XML) |
Getting an 'Error in XML document' Error when submitting web services XML - luckyexpert - 08-20-2013 I am trying to submit an XML through web services (using the web services add-in). It works fine if I use a valid XML, but I need to do some negative testing which includes putting invalid data in certain elements. With our web service server, any schema issues will be caught and identified in the response XML. The problem is when I submit an XML with an element that is supposed to be a valid date. If I set the date to something other than a date, (say the number 1), I get this error on the 'Set submitXMLRequest = WebService("xxxx").xxx(XMLRequest)' line. Error: The xxx operation call failed. There is an error in XML document(41,8). Exception from: mscorlib String was not recognized as a valid Date Time. So the problem is QTP is trying to validate the XML Schema for me, and I dont want it to. Our web services server will handle that and let me know if there are any schema errors. So in this case I want the response XML to say the number 1 is not an invalid date. Is there any way i can get QTP to ignore any XML schema errors and just submit the XML anyways? |