Ticket Q505159
Visible to All Users

How to enable JSONP / CORS in a data service

created 12 years ago

Hi,

I have created a data service using the WCF OData Service. However when adding the Multi-Channel application and read from DataService using the Discover button in the wizard window I get the error that " data service does not support JSONP and/or CORS" *(Screenshot attached).

How can I add the JSONP support for my DataService?

Thanks & Regards

Show previous comments (3)

    Hello,
    I've the same issue. It is necessary Upgrade EntityFramework to 6.x version.
    With VS2012

    1. Create a DevExtreme 13.2 WCF OData Service project with a name different of "DataService"
    2. Choose Empty Model and Finish
    3. In Solution Explorer - References, delete EntityFramework reference (5.x).
    4. Right Click in References - Manage Nuget Packages and install EntityFramework 6.0.2
    5. Install EntityFrameworkProvider - My nuget repository don't show this package, so I use the Console Tool
      a) Tools - Library Package Manager - Package Manager Console and Run
      PM> Install-Package Microsoft.OData.EntityFrameworkProvider -Pre ====> Successfully added 'Microsoft.OData.EntityFrameworkProvider 1.0.0-alpha2' to DataService.
    6. Open DataModel.edmx - Model Browser - Right Click on DataModel - Update Model from DataBase
    7. Configure Connection Properties and choose any table
    8. Replace the base type of your DataService. For EF 5 or below, your data service should inherit from DataService<T> where T is a DbContext or ObjectContext. For EF 6 or greater, your data service should inherit from EntityFrameworkDataService<T> where T is a DbContext. And Add using System.Data.Services.Providers;

      Same problem when deselect "Use IIS Express" option in Web section in Project Properties. See attached picture.
      Any help is appreciated.
      Peter

      DevExpress Support Team 11 years ago

        Hi Guys,
        We kindly ask you not to post your questions to tickets that were created by other customers. If you wish to discuss any problem, please create a new thread. Post all messages regarding these issues in these tickets.
        OData service - Enable JSONP / CORS
        OData service - Enable JSONP / CORS

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.