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
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. |
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. 1
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...
(16 Jan '20, 03:42)
Volker Barth
|
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?
Yes, you are right that the docs only tell that v17 does allow CORS via the added support for the HTTP OPTIONS method.
v16 and below do not support OPTIONS as method with CREATE SERVICE so thereby you cannot service "non-simple CORS requests", as discussed here as that requires an OPTIONS request.
Note: I have taken that reference from that other FAQ you have related to. And I guess you should be able to build according requests based on that discussion...
I've been looking at these materials, but I still can't find the reason for the lack of support! I have upgraded to the latest version of the software. Can you tell me where the configuration is wrong? That post is a very long time ago. I am now upgrading to 17.0.10 53 patch. Thank you very much for your guidance
I have not used SQL Anywhere with CORS so I can't help further. That said, I do not know whether others can comment on that as your test request simply makes a GET. I don't know or see where a different domain would come into play in your sample at all...
Thank you for your reply. Yes, I just made a very simple example,
That is, there are no successful cases in this CORS, so we should solve this problem! Must also have the same user also needs this function use! Can someone else help me find this problem? Why does web services not support CORS
I can invite you to use the TeamViewer remote tool to assist in debugging
Don't get me wrong but I'm just another customer so that's certainly no way for me to help.
Thank you very much for your help. I will continue to test the research of this function, find problems and share them with all!
See the comments and the linked discussions above...
In my limited understanding, "a preflight request" is an OPTIONS request, and your web service does not support that method (as that is not allowed by default) and therefore returns 404.
I guess you will at least have to add something like
or
(and possibly PUT and DELETE) to your create service statement.
Aside: I can't tell whether you will have to modify the stored procedure called by the web service but I assume that it would not be able to handle modifying requests like POST or PUT.