views:

78

answers:

3

Hi.

I am wondering what is the best way to step into my Web Service? When I compile my code the application hangs when it gets to a web service method. If i try to set a break point and step into the service's code, it won't let me - catching "The operation has timed out".

Things I have tried:

1) My SVC file has Debug="true"

2) My Web.config in both my web project and service has

3) I have tried "attach to process" using the DLL from the compiled Service but then I need to unload the project and reload to compile and run it and I am not sure of the process is attached any more. Regardless, it doesn't seem to be working - still hangs.

I am using ASP.NET 3.5 and my web service calls a service class library.

Any suggestions as to how I can step into my web service methods so I can figure out why it is hanging?

Thanks in advance!

+1  A: 

Make sure you have both your application and web service set as start up projects before you start the debugger. You can do this by right-clicking on the solution, then go to Set StartUp Projects. Click the radio button next to "Multiple startup projects". In the list of projects make sure that both the application and web service selected values are set to Start(with debugging).

tvanfosson
A: 

In the situations where I find I need to do this, I run up two copies of Visual Studio: one for the Web service, with a breakpoint on what I suspect to be the errant method, and one for the client.

However, you may not need to debug into both services: if you're receiving a "time out" message from WCF it may be that you're actually seeing an exception in the serializer on the client application or the deserializer on the server side.

Try configuring both client and server to use the Service Trace Viewer, then have a look at the straced code. If there's an exception thrown by WCF you'll see it highlighted in red together with the inner exception stack available if you drill down.

Jeremy McGee
Thanks. I tried the Service Trace Viewer and it seems to be boiling down to this exception: <ExceptionString>System.ServiceModel.FaultException: The message with To 'http://localhost:8731/Design_Time_Addresses/Trade/mex/mex' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.</ExceptionString>
Code Sherpa
A: 

Actually in times like this I setup an 'integration' unit test and run it in release mode while having the wcf service host in debug mode