Hello
I created simple asp.net core 3.1 OData service.
I can connect to this service from desktop stimulsoft designer, works fine.
But I can't connect by stimulsoft JavaScript designer, "test connection" button provides error:
"Connection error: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://localhost:7001/odata' "
OData service see in attachment.
JS designer I used same as in the example:
https://github.com/stimulsoft/Samples-D ... 20designer
JS designer connect to ASP.Net Core 3.1 OData service: Failed to execute 'send' on 'XMLHttpRequest'
JS designer connect to ASP.Net Core 3.1 OData service: Failed to execute 'send' on 'XMLHttpRequest'
- Attachments
-
- ODataCore3.7z
- asp.net core 3.1 OData service
- (261.5 KiB) Downloaded 87 times
-
- Posts: 6247
- Joined: Tue Mar 20, 2018 5:34 am
Re: JS designer connect to ASP.Net Core 3.1 OData service: Failed to execute 'send' on 'XMLHttpRequest'
Hello,
Please check the following code:
Thank you.
Please check the following code:
Code: Select all
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers(options => { options.EnableEndpointRouting = false; });
services.AddOData();
services.AddCors();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseCors(builder => builder.AllowAnyOrigin());
app.UseMvc(routeBuilder => { routeBuilder.MapODataServiceRoute("odataRoute", "odata", GetEdmModel()); });
}