public void process() { if (this.canProcess()) { try { Class1 class1; class1 = this.getClass1(); if(!class1.execute()) { throw error("error"); } } catch (Exception::CLRError) { using (xConnection connection = new xConnection(false)) { connection.tts_begin(); this.submitError(); connection.tts_commit(); } } catch // it goes here { using (xConnection connection = new xConnection(false)) { connection.tts_begin(); this.submitError(); connection.tts_commit(); } } } } protected boolean execute() { System.Net.WebException webException; boolean ret; errorResponseBody = ''; try { new InteropPermission(InteropKind::ClrInterop).assert(); webRequest = System.Net.WebRequest::CreateHttp(this.buildRequestURL()); str token = this.getAccessToken(); if (token) { webRequest.get_Headers().Add('Authorization', strFmt('Bearer %1', token)); } this.prepareHttpRequest(); webResponse = webRequest.GetResponse(); //it fails here this.processResponse(); ret = true; } catch (webException)//it goes here { if (webException.Response) { webResponse = webException.Response; System.IO.Stream responseStream = webResponse.GetResponseStream(); if (responseStream) { System.IO.StreamReader reader = new System.IO.StreamReader(responseStream); errorResponseBody = reader.ReadToEnd(); } } Error(errorResponseBody? errorResponseBody : webException.Message); } catch { // Show errors in the infolog if they are not there already. str clrErr = APLUtilFunctions::processCLRErrorExceptionToString(); if (clrErr) { Error(clrErr); } } finally { if (webResponse) { webResponse.Dispose(); } CodeAccessPermission::revertAssert(); } return ret; } public void submitError() { ttsbegin; str xml = this.getXMLString(); if (xml) { xmlDocument = new XMLDocument(); if (xmlDocument.loadXml(xml)); { XmlNamespaceManager xmlNameSpaceManager; XmlNode errorXNode; xmlNameSpaceManager = new XmlNamespaceManager(xmlDocument.nameTable()); xmlNameSpaceManager .addNamespace('SOAP-1', 'http://schemas.xmlsoap.org/soap/envelope/'); nsManager.addNamespace('ppp' , 'http://www.w3.org/2005/08/addressing'); nsManager.addNamespace('ns4' , 'http://xmlx.xx.com/X'); errorXNode = xmlDocument.selectSingleNode('//SOAP-1:Error/details/ns4:ErrorX', xmlNameSpaceManager); if (errorXNode) { str error = this.getXMLElementValue(ErrorX, 'ns4:errorDescription'); } } //logic ttscommit; }
What i noticed is that errorXNode is filled correctly regardless if the response contains "SOAP-1 and ns4" or if it's "SOAP-2 and ns5". Even though the path specified in the selectSingleNode is SOAP-1 and ns4, how did that work? it only fails in getXMLElementValue where it's expecting ns5, but the code says ns4
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Andrés Arias as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Sohaib Cheema 844 User Group Leader
André Arnaud de Cal... 752 Super User 2025 Season 2
CA Neeraj Kumar 553