locked
How do I add a webservice to my Silverlight app? RRS feed

  • Question

  • I have taken my existing project and added a Windows Azure project and added a role for the website.  The silveright app will launch as hoped, but the webservice calls it needs to make are not correct.

    How do I add my webservice to my existing SL project for deployment on Azure?

     

    Sunday, February 6, 2011 7:44 PM

Answers

  • Thanks Mog,

    How would I do this? 


    You mean add service reference in silverlight?

    You could set your webrole as startup project, then press ctrl+f5 to run the website, and then in silverlight project, add service reference to your service in webrole. At last, open serviceReference.ClientConfig file, update the service address to let it point to the cloud service address when the webrole deployed on cloud.

    Thanks,


    Mog Liang
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    • Marked as answer by Mog Liang Friday, February 11, 2011 8:15 AM
    Tuesday, February 8, 2011 2:17 AM

All replies

  • I dont know if this was the correct way to do this or if I will run into problems later, but I added a webservice role and then I clicked to associate it with the webservice project, and then I right clicked to update the service reference and this seems to have made it work correctly.  Apparently the client access errors were misleading.
    Sunday, February 6, 2011 7:58 PM
  • Hi danielsn,

    The webservice could be hosted in same site with silverlight. after you transform the website to webrole, you may need update the silverlight's service reference address.

    Thanks,


    Mog Liang
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Monday, February 7, 2011 6:13 AM
  • Thanks Mog,

    How would I do this? 

    Tuesday, February 8, 2011 12:46 AM
  • Thanks Mog,

    How would I do this? 


    You mean add service reference in silverlight?

    You could set your webrole as startup project, then press ctrl+f5 to run the website, and then in silverlight project, add service reference to your service in webrole. At last, open serviceReference.ClientConfig file, update the service address to let it point to the cloud service address when the webrole deployed on cloud.

    Thanks,


    Mog Liang
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    • Marked as answer by Mog Liang Friday, February 11, 2011 8:15 AM
    Tuesday, February 8, 2011 2:17 AM