How to display detail error of a C# extension?
Question

The C# extension is to 

  1. prepare authentication code to Send A SOAP Request
  2. Obtain SOAP request
  3. Parse SOAP request

In step two there is a Internal Error 500


But the Service Center does not provide interface to debug.  How can I look at the logs to see the details returned from the response?

Expected XML Response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

   <soapenv:Body>

      <soapenv:Fault>

         <faultcode>soapenv:Server.generalException</faultcode>

         <faultstring/>

         <detail>

            <ErrorType>

               <ErrorCode>7</ErrorCode>

               <ErrorMessage>Login session has timed out or no login session.</ErrorMessage>

            </>

            <ns1:exceptionName xmlns:ns1="http://xml.apache.org/axis/">ErrorType</ns1:exceptionName>

            <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">EBILLDEVAPP</ns2:hostname>

         </detail>

      </soapenv:Fault>

   </soapenv:Body>

</soapenv:Envelope>


Note: Consume SOAP in Outsystems cannot parse, therefore a custom C# extension is required.

Solution

Thanks all.

I found a solution, using try catch.

 catch (WebException wex)

            {

                var pageContent = new StreamReader(wex.Response.GetResponseStream())

                                      .ReadToEnd();

                return pageContent;

            }


Hi,


Have you tried analyzing the error and blog through the Service Center?


You can search the Service Center logs through the step by step:


. Access https://<your_domain>/ServiceCenter/

. Go to "Monitoring".

. Go to "Extensions".

. (Optional) Fill in the filters for your search.



Hope I was helpful.


Best regards,

Luiz Alberto Jr.

Thanks Luiz, but there is no Logs to show.


Hi,

Since you're trying to debug your C# extension, maybe this information can be usefull for you:

https://www.outsystems.com/forums/discussion/16230/how-to-debug-a-net-extension/

Hope this can help you.


Best regards,

Ricardo Pereira

Solution

Thanks all.

I found a solution, using try catch.

 catch (WebException wex)

            {

                var pageContent = new StreamReader(wex.Response.GetResponseStream())

                                      .ReadToEnd();

                return pageContent;

            }


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.