<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>14 Feb 2019 16:53:09 Z</lastBuildDate><pubDate>14 Feb 2019 16:53:09 Z</pubDate><description>Hi Guys&#13;
&#13;
Many years ago I wrote some routines to access a UK HMRC WebService. All was good.&#13;
Recently, I had some issues with the service calls failing, but I was not receiving suitably descriptive errors&#13;
&#13;
The test url is: https://tpvs2.hmrc.gov.uk/ws/ncts/service&#13;
&#13;
The bad message I am using to test is:&#13;
&#13;
&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ncts="http://webservices.hmrc.gov.uk/ncts" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:hmrc="http://www.hmrc.gov.uk/ws/info-header/1"&gt;&lt;soapenv:Header&gt;&lt;wsse:Security&gt;&lt;wsse:UsernameToken&gt;&lt;wsse:Username&gt;UnknownUser&lt;/wsse:Username&gt;&lt;wsse:Password&gt;BadPassword&lt;/wsse:Password&gt;&lt;/wsse:UsernameToken&gt;&lt;/wsse:Security&gt;&lt;hmrc:Header&gt;&lt;hmrc:VendorDetails&gt;&lt;hmrc:Vendorname&gt;Impatex Computer Systems Limited&lt;/hmrc:Vendorname&gt;&lt;hmrc:VendorURI&gt;http://www.impatex.com&lt;/hmrc:VendorURI&gt;&lt;hmrc:VendorID&gt;0945&lt;/hmrc:VendorID&gt;&lt;hmrc:VendorProduct&gt;ICE - Integrated Customs For Europe&lt;/hmrc:VendorProduct&gt;&lt;hmrc:VendorProductVersion&gt;1.0.0&lt;/hmrc:VendorProductVersion&gt;&lt;/hmrc:VendorDetails&gt;&lt;/hmrc:Header&gt;&lt;/soapenv:Header&gt;&lt;soapenv:Body&gt;&lt;ncts:getMessages&gt;&lt;ncts:lastRetrieved&gt;100&lt;/ncts:lastRetrieved&gt;&lt;ncts:maxResponses&gt;20&lt;/ncts:maxResponses&gt;&lt;/ncts:getMessages&gt;&lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt;&#13;
&#13;
&#13;
&#13;
The responses to this message are:&#13;
&#13;
&#13;
SOAPRunXML returns true&#13;
&#13;
ErrorOccurred still false&#13;
&#13;
SOAPGetResult(SOAPXMLResult) returns "&lt;" (yeah - a single angle bracket!)&#13;
&#13;
SOAPGetResult(SOAPResult) fires an exception "A value should have been returned by 'SOAPGetResult'."&#13;
&#13;
SOAPGetResult(SOAPHTTPResult) returns&#13;
&#13;
HTTP/1.1 500 Internal Server Error&#13;
Vary: Accept-Encoding,User-Agent&#13;
Content-Encoding: gzip&#13;
Content-Type: text/xml; charset=UTF-8&#13;
Content-Length: 312&#13;
Date: Thu, 14 Feb 2019 15:45:13 GMT&#13;
Connection: close&#13;
Set-Cookie: JSESSIONID=clNHZS4tnz8WKMKGjf6lvj0HKCrKkRPjlL0htgLhMyJvJFDFvQnQ!1092665171; path=/&lt;CR&gt;Set-Cookie: TSb6efe0=a20ec05f6192c66d8f3ab5ebea1d5557ac0ab90f1f1abb115c658d0860ac0ec5d4b1d6de; Path=/&lt;CR&gt;&lt;&gt;&lt;31&gt;‹&lt;8&gt;&lt;0&gt;&lt;0&gt;&lt;0&gt;&lt;0&gt;&lt;0&gt;&lt;0&gt;&lt;3&gt;Œ‘1OÃ0&lt;16&gt;…ÿŠå¥Sì&lt;EOT&gt;&lt;24&gt;P”¤&lt;2&gt;‰N0A%V+&gt;Z‹ô\åœ¤ý÷œãPÊ&lt;EOT&gt;C¤gß½ïîÅÕútèÄ&lt;8&gt;=9µ,T.&lt;5&gt;`ë­Ã]-·o›ì^&lt;10&gt;&lt;10&gt;&lt;6&gt;­é&lt;B-Ï@rÝT€cù„#tþ&lt;8&gt;‚&lt;17&gt;H%_Õr&lt;31&gt;Â±ÔšÚ=&lt;28&gt;&lt;12&gt;)®7GåûŽBÃâÑrqÈ]\Ó4©évn¾ÉóB¿¿&lt;¿Î&lt;SPC&gt;ÌaÜ¡…oWdñšÿ™—²\Í³Ï“)à£·ç¤6fèÂBøˆúÂ°¾%å&lt;&gt;9Ê8&lt;22&gt;Î°‰(&lt;2&gt;ï43S)žò"ãBü&lt;SPC&gt;&lt;29&gt;z&lt;23&gt;Î&lt;25&gt;&lt;11&gt;8…ŒºâµxèŒæ…¡™&lt;21&gt;u&lt;29&gt;Ø‡!ì&lt;1&gt;ƒkMàGªôOW2Pè9aó»M$o)¶&lt;EOT&gt;½Xmñ&lt;19&gt;ý„ñ°&lt;18&gt;&lt;22&gt;ÐU&lt;11&gt;i±Wú&lt;18&gt;tÑ)¾¾~êæ&lt;11&gt;&lt;0&gt;&lt;0&gt;ÿÿ&lt;3&gt;&lt;0&gt;®Kþ¡0&lt;2&gt;&lt;0&gt;&lt;0&gt;&#13;
&#13;
&#13;
&#13;
At least the HTTPResult returns me a 500 Internal Server Error.&#13;
&#13;
BUT&#13;
&#13;
If I do the same message via Postman.exe (testing tool, free version available), I get &#13;
&#13;
&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&#13;
&lt;env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&#13;
    &lt;env:Body&gt;&#13;
        &lt;env:Fault xmlns:fault="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;&#13;
            &lt;faultcode&gt;fault:FailedAuthentication&lt;/faultcode&gt;&#13;
            &lt;faultstring&gt;Authentication Failed: User 'UnknownUser' denied.&lt;/faultstring&gt;&#13;
        &lt;/env:Fault&gt;&#13;
    &lt;/env:Body&gt;&#13;
&lt;/env:Envelope&gt;&#13;
&#13;
Which is much more useful - particularly as in this instance the user id that was being used had been 'accidentally' deprecated :).&#13;
&#13;
Does anyone have any ideas how I can improve my error handling?&#13;
&#13;
Cheers&#13;
&#13;
Malc</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/66960-catching-errors-soaprunxml-soapgetresult/read.awp</link><title>Catching errors in  SOAPRunXML/SOAPGetResult</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster></channel></rss>
