1

I have a WCF Restful service hosted in my windows application.

The clients to the service are mobile applications.

The clients call the service and messages are passed to the application and work is executed.

The issue that i am facing is that the application works fine in most of the cases. But it doesnt work on some machines and network settings.

To give a better idea : The app is not working on machine 1 connected to router A. Now as i change and connect it to router B, the same app starts working on the same machine.

Similarly, the app is not working on machine1 connected to router A. Now as i change the machine and remain connected to the same router, the app works fine.

I am not able to figure out the problem. Any idea on how to debug this issue?

Any help appreciated.

Sandeep
  • 667
  • 7
  • 25

3 Answers3

5

I would turn on tracing and message logging in the WCF service. This can be done in the web.config/app.config file of the service, most easily via the WCF Service Configuration tool in Visual Studio which is available under the tools menu (note: once you open this tool once, you will be able to close it and then right click on your app/web .config file and select 'edit WCF configuration' from the context menu for the duration of your Visual Studio session and have the file open automatically in the tool). On the WCF Configuration editor, navigate to the Diagnostics section and you can turn Tracing and Message logging on. Note where the log files are being created and/or adjust the path to a more desired location. I would also recommend turning on autoflush, so information is written to the logs more frequently. You may want to cycle the service after a tracing session to make sure that the log files contain all relevant information.

Now, hit the service from the non working configuration. Examine the logs using svctraceviewer.exe which you can find in your SDK folder under program files. See if anything jumps out at you in the logs, if not then purge the existing log files on the server and examine a set of log files from a valid session to attempt to contrast the differences.

Here is a link to msdn regarding WCF tracing which may be helpful: http://msdn.microsoft.com/en-us/library/ms730342.aspx

codechurn
  • 3,870
  • 4
  • 45
  • 65
  • One other thing which may be a possibility for you is to install visual studio on the server machine or install the visual studio remote debugging service and attempt to attach to the service host on the server. In order to be able to step into the code, you will have to make sure that the binaries on the server are debug compiled and have the pdb files present. Check out http://msdn.microsoft.com/en-us/library/y7f5zaaa(v=vs.100).aspx for more information about remote debugging. – codechurn Sep 23 '12 at 19:05
0

You could try using a tool like Fiddler to examine and compare the messages being exchanged in the different environments.

Joe
  • 122,218
  • 32
  • 205
  • 338
0

In order to achieve your purpose, you can enable tracing for your wcf service. There is already a link on stackoverflow for on this topic.

How to turn on WCF tracing?

Community
  • 1
  • 1
Imran Ghani
  • 188
  • 1
  • 3