Disclaimer: This is NOT a duplicate of this thread. First, in my case, there's no middle-tier service. Secondly, I'm working with SL 5 and CRM 2011.
I'm developing Silverlight applications to work with MS CRM 2011. These applications are part of a CRM Solution and are meant to be used in CRM Online.
This is important: I CANNOT write extra web services or modify web.config
files which are part of CRM, as I cannot do these things with CRM Online.
Usually my applications just need the OData service, and there are no issues in these cases. But one application needs to use the SOAP organization service, and here the trouble starts.
Apart from some problems getting it to work (as I need to create OrganizationRequests
from scratch), there's a big problem getting meaningful exception messages from that service. SL will happily always return 404, which isn't helpful at all to the user.
I've tried using
WebRequest.RegisterPrefix("http://", System.Net.Browser.WebRequestCreator.ClientHttp);
WebRequest.RegisterPrefix("https://", System.Net.Browser.WebRequestCreator.ClientHttp);
as described in this article but that turned out to cause problems in one situation with IFD and ADFS (even though this solution was otherwise perfect).
In case of an error I really need to be able to give the user some meaningful information ("Not found" is hardly ideal).
What should I do to get some useful error messages out of CRM?
EDIT:
Please note I'm talking about the Organization service, NOT the OData service! I've no problems getting some useful information to display for the user from the latter.
I want to point this out, because of this thread which, at first glance, seems to be perfect, but then it turns out (given the accepted answer) that it was for OData all along.