Using WCF faults with the Compact Framework
I have a WCF service that is called by a Windows Mobile application running on a PDA. I've set up the server code to send WCF faults if there is a problem. This is the code that I think I am supposed to be using on the client:
开发者_如何学JAVAtry
{
var data = myService.GetSomeData();
}
catch (FaultException<Service.CustomFault> fault)
{
messagebox.show(fault.customMessage);
}
The problem is that "FaultException" can't be found. Is this part of the Compact Framework? Am I missing a reference? Has anyone else done this using the CF?
Update: I've been looking at the .Net namespaces and FaultException is in System.ServiceModel. I can see that it exists in the desktop version but it's not there in the Compact Framework. It has stuff like FaultCode and FaultReason but I don't know how they are used.
Cheers
MarkThe FaultException class is not available in the Compact Framework. But good news is you can use the CFFaultException class instead.
精彩评论