Silverlight 4 WCF RIA Services on Windows Azure

Unanswered Silverlight 4 WCF RIA Services on Windows Azure

  • Friday, August 13, 2010 10:09 AM
     
     

    Hi everyone,

    I am using Visual Studio 2010 RTM, Silverlight 4, WCF RIA Services.

    When I execute the following code, everything works fine:
    DBDomainContext db = new DBDomainContext();
    uiDataGrid.ItemsSource = db.Teams;
    db.Load(db.GetTeamsQuery(),
    true);

    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:
    '<html>
      <head>
        <title>
        Could not load type 'System.ServiceModel.Activation.ServiceHttpHandlerFactory' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
        </title>
    .....'

All Replies

  • Monday, August 16, 2010 3:56 AM
    Moderator
     
     

    Hi,

    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
  • Monday, August 16, 2010 3:22 PM
     
     

    Hi Allen,

    I have uploaded the project http://cid-cb456c1b07eaf563.office.live.com/browse.aspx/Public

    Thanks for your help.

  • Tuesday, August 17, 2010 3:00 AM
    Moderator
     
     

    Hi,

    I'm unable to reproduce this issue with the project you provided. Could any other community members help to confirm it can be reproduced?


    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
  • Wednesday, August 18, 2010 5:21 PM
     
     
    I have installed a new development system. With this one everything works fine!
    I wonder what is wrong with my main development system.
  • Wednesday, August 18, 2010 10:20 PM
     
     

    Hi.

    you don't load two Assembly.

    System.ServiceModel.DomainServices.Hosting

    System.ServiceModel.DomainServices.Server

    So The Copy Local propertys are set to True.

  • Thursday, August 19, 2010 3:17 AM
    Moderator
     
     
    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