Question

I am currently getting the following error when calling a WCF service:

The server was unable to process the request due to an internal error

However I can't understand how this could be as the method I am running doesn't actually do anything

INTERFACE:

[ServiceContract]
public interface IPrinterManager
{
    [OperationContract]
    Printer GetPrinter(int printerId);
}

SERVICE:

public class PrinterManager : IPrinterManager
{
    public PrinterManager()
    {
               }

    public Printer GetPrinter(int printerId)
    {
       return null;
    }
}

CLIENT:

 private Printer GetRequestedPrinter(int eventLocation)
    {
        ChannelFactory<IPrinterManager> channelFactory = new ChannelFactory<IPrinterManager>(new BasicHttpBinding(), "http://localhost:9877/printers");
        IPrinterManager printerManager = channelFactory.CreateChannel();

        int printerId = (int) _PlcClient.ReadItem(_PlcPrinterIdWords[eventLocation], true);
        Printer printer = printerManager.GetPrinter(printerId);
        return printer;
    }

I can't understand why this would error?

Could anyone please point me in the right direction?

Thanks

Was it helpful?

Solution

Set your includeExceptionDetailsInFaults = true

<serviceDebug includeExceptionDetailInFaults="true" />

and turn on tracing

http://msdn.microsoft.com/en-us/library/ms733025.aspx

this should provide you with a more clear explanation as to what is happening.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top