none
REST Calling cross domain web services

    Question

  • Hi

    Could someone show me what the confuguration setting is and where it goes in my console hosted REST Web service so that I can call my service from another domain.

        <ServiceContract()>
        Public Interface IPdaService
     
            <WebGet(UriTemplate:="getrankdata?callsign={callsign}", ResponseFormat:=WebMessageFormat.Json)>
            Function getrankdata(ByVal callsign As IntegerAs RankStatsReturnDataClass
            <WebGet()>
            Function Test() As String
     
     
        End Interface

    Thanks very much.


    Paul
    Wednesday, July 27, 2011 1:05 AM

Answers

  • The blog post includes code samples that show how to add the headers to the response. The custom behaviors can also be used in a self-hosted wcf service.

     


    Please mark posts as answers/helpful if it answers your question. Senior Consultant on WCF, ASP.NET, Siverlight, and Entity Framework. Author of Microsoft's Official WCF 4 Course. Co-author of the Microsoft HPC/Azure burst whitepaper. Visit my blog: http://blogs.microsoft.co.il/blogs/idof
    • Marked as answer by PAUL stanley Wednesday, July 27, 2011 5:35 PM
    Wednesday, July 27, 2011 11:01 AM

All replies

  • Do you mean this:

    http://blogs.microsoft.co.il/blogs/idof/archive/2011/07/02/cross-origin-resource-sharing-cors-and-wcf.aspx


    Please mark posts as answers/helpful if it answers your question. Senior Consultant on WCF, ASP.NET, Siverlight, and Entity Framework. Author of Microsoft's Official WCF 4 Course. Co-author of the Microsoft HPC/Azure burst whitepaper. Visit my blog: http://blogs.microsoft.co.il/blogs/idof
    Wednesday, July 27, 2011 7:31 AM
  • Hi Ido

    Thanks for your response. I need to add some headers as shown in that thread to my repsonse. Do you know how I access the response headers in a console application?

     


    Paul
    Wednesday, July 27, 2011 9:36 AM
  • The blog post includes code samples that show how to add the headers to the response. The custom behaviors can also be used in a self-hosted wcf service.

     


    Please mark posts as answers/helpful if it answers your question. Senior Consultant on WCF, ASP.NET, Siverlight, and Entity Framework. Author of Microsoft's Official WCF 4 Course. Co-author of the Microsoft HPC/Azure burst whitepaper. Visit my blog: http://blogs.microsoft.co.il/blogs/idof
    • Marked as answer by PAUL stanley Wednesday, July 27, 2011 5:35 PM
    Wednesday, July 27, 2011 11:01 AM