cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable HTTP service to support CORS in version 17.0.10.5963 PL53 at ajax

ximen
Participant
2,353

Please tell me the HTTP folder under Sybase installation directory, which is the function demonstration file of opening CORS,

The help document only describes the support, but there is no explanation on how to open it http://dcx.sap.com/index.html#sqla170/en/html/b28cc1d4c5df4eb6a2d2fe4aa269955d.html

  1. I run dbsrv17.exe - n testweb - XS HTTP (Port = 8098) demo.db (17.0.10.5963)

  2. Create a web service create service "test" type 'JSON' authorization off user "DBA" URL on as call "get_no" (: no);

  3. Visit the local webpage http://127.0.0.1:8098/test? No = 201140017

  4. The web page shows the JSON page

  5. :get_no code:

ALTER PROCEDURE "DBA"."get_no"(IN no varchar(20) )

BEGIN

CALL dbo.sa_set_http_header('access-control-allow-headers','Authorization, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, X-Requested-By, If-Modified-Since, X-File-Name, X-File-Type, Cache-Control, Origin');

CALL dbo.sa_set_http_header('access-control-allow-methods','GET, POST, OPTIONS, PUT, DELETE');

CALL dbo.sa_set_http_header( 'Access-Control-Allow-Origin',' *' );

CALL dbo.sa_set_http_header('access-control-expose-headers','Authorization');

call sa_set_http_header( 'Content-Type', 'text/html' );

select * from trans where trans_num=no

end

————

The help document only describes the support, but there is no explanation on how to open it:

Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:50680' is therefore not allowed access. The response had HTTP status code 404.

2.Is this related to the options option?

3 . Request URL:http://127.0.0.1:8098/test?get_no=9140017

Request Method:OPTIONS

Status Code:404 Not Found

Remote Address:127.0.0.1:8098

Referrer Policy:no-referrer-when-downgra

How should I deploy it! There are problems on the forum. Are there no successful deployment cases?

end at 2020-01-15

I finally found the problem It turns out it's in Ajax contentType: "multipart/form-data", It's OK to set it as this. Thank all the help people and the posts in the forum, ASA is a powerful database.

Accepted Solutions (1)

Accepted Solutions (1)

ximen
Participant

I finally found the problem

It turns out it's in Ajax

contentType: "multipart/form-data",

It's OK to set it as this. Thank all the help people and the posts in the forum,

ASA is a powerful database.

VolkerBarth
Contributor

Well, if you have fully answerred your question, then please "accept" your answer (i.e. click on the check mark) to mark it as solved...

Answers (0)