0

I am calling a webservice to which I have created its end point in my app.config file. I have the following set in my app.config to inlcude the error stack it mentioned.

<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="debug">
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_ISmsService">
          <security mode="Transport" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="https://api.collstream.co.uk/SmsService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISmsService" contract="smsService.ISmsService" name="BasicHttpBinding_ISmsService" />
    </client>
  </system.serviceModel>

Here is how I am calling the method as well

public void send(string from, string to, string message, string section, string userName, string password)
{
        // "Services." will be whatever namespace you specified on the
        // "Add Service Reference" dialog
        var svc = new smsService.SmsServiceClient();

        // This values will probably be coming from a config file in a real application

        try
        {
            svc.SendMessage(from, to, message, userName, password);
        }
        catch (Exception ex)
        {
        }
        finally
        {
            svc.Close();
        }
  }

This is the way that I am trying to process the webservice but i am being produced with the error below any ideas.

{"The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs."}

As you can see in my app.config above I have indead set this here

IncludeExceptionDetailInFaults="true" but still i not getting the full stack trace of the error. This is a class project I am calling the service refrence from.

c-sharp-and-swiftui-devni
  • 3,743
  • 4
  • 39
  • 100

0 Answers0