415 Unsupported Media type on REST .net Core

9 posts, 1 answers
  1. Trung
    Trung avatar
    8 posts
    Member since:
    Jan 2018

    Posted 23 Jan Link to this post

    Following these guide: 

    https://www.telerik.com/blogs/telerik-reporting-and-aspnet-core

    https://docs.telerik.com/reporting/html5-report-viewer-asp-net-core-2

    to create a REST service for Telerik Report, but whatever I do, I have always get this error:

    Am I missing something?

     

     

     

     

     

  2. Answer
    Katia
    Admin
    Katia avatar
    693 posts

    Posted 26 Jan Link to this post

    Hi Trung,

    Test setting the content type when creating request in Postman as JSON(application/json). This suggestion is based on this stackoverflow thread where a similar problem is discussed.


    Regards,
    Katia
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Trung
    Trung avatar
    8 posts
    Member since:
    Jan 2018

    Posted 30 Jan Link to this post

    Hi Katia, 

    I have already tried this before, it just doesn't matter. Except your HTML viewer provided in Telerik Reporting packages, all requests sent to  Telerik Report Services (running on .Net Core target .Net Framework) will result in 415 error.

    I have tried to use Postman, pure Javascript, Jquery, Angular, Asp.Net Web Controller and all failed with 415.......

    This does not happen if I have the Telerik Report Services running on pure .Net Framework. 

    Could you confirm with the Tech guy and give me some solution on this?. This is quite essential for me to get a demo example working for my company next meeting

    Cheers

     

  4. Trung
    Trung avatar
    8 posts
    Member since:
    Jan 2018

    Posted 30 Jan Link to this post

    Hi Katila,
    I have figured out the problems. The cause is due to my setup and configuration of the project. Everything works now. 
    Thanks for your help
  5. Trung
    Trung avatar
    8 posts
    Member since:
    Jan 2018

    Posted 30 Jan Link to this post

    Hi Katila,
    I have figured out the problems. The cause is due to my setup and configuration of the project. Everything works now. 
    Thanks for your help
  6. 仁劭
    仁劭 avatar
    3 posts
    Member since:
    May 2018

    Posted 30 May Link to this post

    I got the same question 

    can you tell me what the Body should I put in ?
    give me some examples thx

  7. Todor
    Admin
    Todor avatar
    182 posts

    Posted 04 Jun Link to this post

    Hello 仁劭,

    From the screenshot it seems that the Web service is running locally. It is not clear to me what is the service supposed to return, hence what the Body of the request should contain.
    I suggest to check the How to: Connect to Google Books APIs article where you can find an example for configuring a WebServiceDataSource component.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  8. 仁劭
    仁劭 avatar
    3 posts
    Member since:
    May 2018

    Posted 05 Jun in reply to Todor Link to this post

    By the way ,Can I pass object to the report.cs ?
    I'm Using Telerik MVC 
    Like the picture , I dont' want the data is fixed in the report1.cs
    I want the datasource is from the ReportsController passing the object to the report1.cs

    Is it possible to do that ?


    thx for anwer

  9. Todor
    Admin
    Todor avatar
    182 posts

    Posted 08 Jun Link to this post

    Hi 仁劭,

    The correct way to set DataSource to a Report is in the report definition through on of the dedicated DataSource components.
    In the case of an ObjectDataSource the DataSource property of the component can be any supported type, and it can be defined in an external assembly, i.e. outside report.cs.

    If you would like to set the Report DataSource dynamically you can create a Custom Report Resolver where to instantiate the report, re-configure it as desired and return it to the Reporting Engine wrapped in an InstanceReportSource.

    If you have other questions not related to this forum thread topic consider opening a Support ticket. This will guarantee a faster response.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top