cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing SQL Anywhere webservice from another domain

Former Member
3,040

Hi everyone,

here is my question : I defined a webservice using SQL Anywhere embed webservices utility.

There it is :

create service srv_select_client type 'JSON' authorization off secure off methods 'GET' user gp as call psrv_client(:a_client);

and here is the procedure called :

ALTER PROCEDURE "gp"."psrv_client"( in "a_client" "T_CODE_CLIENT" ) 
result( "o_raison_sociale" "T_RAISON_SOCIALE","o_telephone" "T_TELEPHONE","o_email" "T_E_MAIL" ) 
begin
  CALL dbo.sa_set_http_header( 'Access-Control-Allow-Origin', 'http://nw377814.ip-5-51-68.eu/' );
  select "RAISON_SOCIALE","TELEPHONE","E_MAIL" from "CLIENTS" where "CODE_CLIENT" = "a_client"
end

I need to call this service from another domain (that's a simple try) on my dedicated server. Everything seems to be okay (the header should allow me to make my ajax call from the server).

But it looks like it doesn't allow cross domain requests. I need to treat it as a JSONP request to get the request to work (I get the json I need) but SQL Anywhere doesn't work with JSONP and it's callback function behavior, so data are unreachable.

Does someone knows how to allow cross domain request ?

Thanks all for your answers !

Accepted Solutions (0)

Answers (0)