I am using Visual Studio 2010 RTM, Silverlight 4, WCF RIA Services.
When I execute the following code, everything works fine: DBDomainContext
db = newDBDomainContext();
uiDataGrid.ItemsSource = db.Teams;
But when I add the Windows Azure Cloud Service project and use the existing project as a WebRole I get the following error: System.ServiceModel.DomainServices.Client.DomainOperationException:
Load operation failed for query 'GetTeams'. The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/msbin1).
If using a custom encoder, be sure that the IsContentTypeSupport method is implemented properly.
The first 1024 bytes of the response were:
Could not load type 'System.ServiceModel.Activation.ServiceHttpHandlerFactory' from assembly 'System.ServiceModel, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
I remember I tested this scenario before and it should work without any problem. From the description itself the client expects the content HTTP header to be application/msbin1 but service sends back text/html so the exception is thrown. You may confirm
this by comparing the working/non-working response to see whether there're any differences. A workaround might be using Message Inspector to change the content type. If it still doesn't work please upload a demo project that can reproduce this issue to let
me test it locally. You can upload the project to
http://skydrive.com and paste download link here.
Please remember to mark the replies as answers if they help and unmark them if they provide no help. Windows Azure Platform China Blog: http://blogs.msdn.com/azchina/default.aspx
I have installed a new development system. With this one everything works fine!
I wonder what is wrong with my main development system.
I have no idea. What happens if you reinstall all related components on that machine? Does it work?Please remember to mark the replies as answers if they help and unmark them if they provide no help. Windows Azure Platform China Blog: http://blogs.msdn.com/azchina/default.aspx