2
votes

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.

2
Is your question how to get CRM server errors, or the WCF errors?Daryl
I want to get CRM server errors, but Silverlight treats the Organization service as a WCF service, so I think it's almost the same.Shaamaan

2 Answers

0
votes

Try see this article from Microsoft, i never used and i don't know if it can be applied in CRM. It's a very interesting article, so take a look.

-1
votes

I ran into a similar problem / error when uploading a Silverlight 5 XAP to CRM 2011 Online.

In order to get useful message, open CRM in IE navigate to your Silverlight resource, hit F12 for the IE Debugger, and go to the Network tab ( see screenshot ).

Hope this helps!

CRM 2011 Online Silverlight Error Capture