7

When i try to load method from webservice, i get an error:

"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"

This is my app.config endpoint def:

<services>
  <service name="Service" behaviorConfiguration="debug">
</services>

<client>
  <endpoint name="Service" address="net.tcp://localhost:12708/" binding="netTcpBinding" bindingConfiguration="netTcp" contract="path.IService" >
    <identity>
      <servicePrincipalName />
    </identity>
  </endpoint>
</client>

<serviceBehaviors>
    <behavior name="debug">
      <serviceDebug includeExceptionDetailInFaults="True" />
    </behavior>
  </serviceBehaviors>

I cannot see more information event if i have declared serviceBehaviors. Could somebody tell me how can i see more details about this error?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
codelikeprogrammerwoman
  • 1,429
  • 3
  • 14
  • 17
  • 2
    Do enable WCF tracing to see what's going on. See http://stackoverflow.com/a/4271597/870604 – ken2k Jan 13 '14 at 09:08
  • I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders Jan 13 '14 at 09:19

4 Answers4

8

The message of the error is quite clear. The server is configured to hide internal errors for security reasons.This is the default behaviour according to the fault handling in WCF MSDN post.

I see two options, both suppose that you have access to the server:

  • Enable showing the error details See the fault handling in WCF MSDN post. It provides details on how to setup your configuration, in the "Provide Additional Information When an Exception Occurs" section.

  • Debug using actual breakpoints This would be better. In my opinion, no error message could actually give you the insights a debugging session does.

Hope I helped!

Pantelis Natsiavas
  • 5,293
  • 5
  • 21
  • 36
  • thanks for your quick response! Unfortunately, this solution is still not working for me. I think the reason is that i don't run the service instance via F5, but RB on my Console Application project and do: Debug-> start new instance. So i don't load exactly the service definition, but try to load service from endpoint in client section. Debugging is not working for me, when i try to put break point into my code, debugger is not entered into it. Any ideas? – codelikeprogrammerwoman Jan 13 '14 at 09:29
  • I don't have the necessary insights my friend... If I think something, I will tell you. – Pantelis Natsiavas Jan 13 '14 at 09:39
2

Solution: My service wasn't started. Because we run services locally, I needed to open the required solution and run the service locally via RG -> Create new instance.

How I do I know about this? My log files are stored in c:/temp. In this location, appeared a new log file and there I found more info about my error. (All the time I was thinking that the details about my error message will enter into my basic log file, but I didn't expect another log file.

So, Reason: web service didn't work.
Solution: Start service localy: Rb -> create new service.

Zukunft
  • 17
  • 1
  • 5
codelikeprogrammerwoman
  • 1,429
  • 3
  • 14
  • 17
1

When running this locally, you can debug the service by attaching to it using Tools -> Attach to Process.

In the list of available processes, look for the process W3wp.exe, with Type Managed (...) x64 or Managed (...) x86, depending what you've configured your service to run as.

Click Attatch, set a couple of breakpoints in your service, and try to access it again in your web-browser, and they should be hit.

Note that you'll need to publish your WS in Debug mode for this to work.

Kjartan
  • 18,591
  • 15
  • 71
  • 96
  • thanks for your response! Yes, i tried to attach process but i have no processes like w3wp or Managed .. etc. ;/ Maybe it will be helpful if i explain what i do to test my app: I run localy my service application which is based on localhost:12708. Next i back to my solution with console app, RB on my app and click: Debug-> Start new instance. I have no idea which process should i attack so ;/ – codelikeprogrammerwoman Jan 13 '14 at 09:34
  • @codelikeprogrammerwoman Ok; I was assuming you had published to an IIS server. If you just run it from VS, you may find a process called something like `WebDev.WebServer40.EXE` instead. It should have a Title like `ASP.NET Development Server - Port 12708` (also make sure you've started the process by attempting to run the service before you look for the process in the _Attach to Process_ list). – Kjartan Jan 13 '14 at 09:42
  • My service is started because i see "Status=Started" in WCF Service Host. On the list of processes i have no process like webdev, w3wp, portnumber, etc ;/ Only one service looks like appropriate: in title there is [path_to_my_solution.project_name.exe] and in type there is Managed(...) but it still doesn't work ;/ – codelikeprogrammerwoman Jan 13 '14 at 10:04
  • There is one of the processes which i cannot attach because i get an error "Unable to attach to the process. A debugger is already attached" but it doesn't ;/ strange ... – codelikeprogrammerwoman Jan 13 '14 at 10:13
1

you should add diagnostics your config file:

 <system.diagnostics> 
      <sources> 
        <source name="System.ServiceModel" 
                switchValue="All" 
                propagateActivity="true"> 
          <listeners> 
            <add name="traceListener" 
                type="System.Diagnostics.XmlWriterTraceListener" 
                initializeData= "D:\AppLogs\Traces.svclog" /> 
          </listeners> 
        </source> 
      </sources> 
    </system.diagnostics>
elifekiz
  • 1,456
  • 13
  • 26