WCF client creation issue
I am using VS2010 + C# + .Net 4.0 + IIS 7.0 + WCF. Wh开发者_如何学JAVAen I create a WCF client object instance in below code, I find "check point 1" is logged, but "check point 2" is not logged. But no exception is thrown (I catch exception in the whole block of code, and "check point 3" is not output).
Any ideas how to debug further to see issues in WCF client proxy creation? What are the normal issues in WCF client proxy creation (I think the creation just need to create a local memory object to represent the WCF client object instance, no need to really communicate to remote WCF service, so should not fail normally, please correct me if I am wrong)? Maybe some configuration errors?
BtW: the code below is in a WCF service (WCF server end, running/hosted in IIS 7.0) to call another remote WCF service.
try
{
MyLogger.Write("check point 1 " );
Foo.CustomerInfo ci = new Foo.CustomerInfo();
MyLogger.Write("check point 2");
}
catch (Exception ex)
{
MyLogger.Write("check point 3");
return;
}
thanks in advance, George
Few ideas:
- Try putting logging in Foo.CustomerInfo() constructor
- Try using end to end tracing with Service Trace Viewer (usually in NETFX 4.0 Tools\SvcTraceViewer.exe).
- Make sure you have you service return exception details in faults so client can "see" them (e.g. serviceDebug includeExceptionDetailInFaults="true")
- If you autogenerated client proxy, you can still edit it and add logging in the partial class of client proxy
精彩评论