how to use WCF service to access sql azure database from Iphone

Answered how to use WCF service to access sql azure database from Iphone

  • Wednesday, April 11, 2012 6:40 AM
     
     

    Hi friends,

         I created an app in wcf servcie web role

    I connected to  sql azure using EDM

    here my client is Iphone .

    what are the  additional settings of  my service because I need to consume it from Iphone client

    and where should i host it either in IIS or windows Azure

    If anybody knows the answer please tell me


    srujana

All Replies

  • Wednesday, April 11, 2012 6:58 AM
     
     

    not 100% certain of the question but let me try find out more;

    so you have an iPhone application, that you want to get data out of a SQL Azure database. Correct?
    there would be two options I can see. stand up some application / services layer that would proxy the requests to your SQL data and host this in Azure Compute.
    or expose your SQL Azure data as ODATA and access directly from the iPhone application.

    have you had a look at the excellent toolkit we published for iPhone apps and Azure?
    http://www.wadewegner.com/2011/05/windows-azure-toolkit-for-ios/

    This toolkit will show you exactly how to do a number of things with Azure from the iPhone

  • Wednesday, April 11, 2012 7:17 AM
     
     

    Hi Ryan

        Thanq

    yes I want to  get data from sql azure into my Iphone

    for this I created wcf webrole(cloud->windows azure->wcf service webrole->Ado.net entity data model->sql azure)

    before hosting it on windows azure(I thought no need to host it on IIS) is there any additional settings in this app or directly I will send the url to client(after hosting it on azure).

     


    srujana

  • Thursday, April 12, 2012 2:37 AM
    Moderator
     
     Answered

    Hi,

    I think you can create a RESTful or Data service to access SQL Azure (make a query of database, call SQL Azure reporting service, etc), You can create a WCF webrole or just use WorkRole (without IIS) for archieve your goals,  the IPhone application need only call that service for data.

    Hope this helps.


    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 chandana30 Thursday, April 12, 2012 5:35 AM
    •  
  • Friday, April 13, 2012 5:48 AM
     
     

               Hi Arwind thanks for the answer

    I have to create a service in .net and should be hosted in windows azure

    that is consumed by Iphone

    here my question is which is the best option

    1.wcf with json(is It possible to host it on windows azure).

    2.wcf with restful servcice

    for Iphone.

    Please send me If anybody knows the answer.


    srujana

  • Friday, April 13, 2012 6:46 AM
    Moderator
     
     Answered

    Hi srujana,

    I think RESTful is a better choice for IPhone, i am not 100% sure that IPhone application can supports SOAP service, but i am sure the RESTful service is supported. And RESTful service also supports JSON and XML data as the response text.

    http://www.codeproject.com/Articles/105273/Create-RESTful-WCF-Service-API-Step-By-Step-Guide

    About "is It possible to host it on windows azure", of course, you can deploy your service on Windows Azure Platform with WCF web role or Work Role.

    BTW, i think if you have any other question, please post them as a new thread in this forum. Our target is 1 thread with only 1 topic to help other people has the same question.

    BR,

    Arwind


    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 chandana30 Friday, April 13, 2012 10:19 AM
    •  
  • Friday, April 13, 2012 10:20 AM
     
     

    Thanks arwind


    srujana