on 2017 Apr 12 11:57 AM
The "Server,nginx" attribute/value pair returned by a web client call seems to indicate so...
...and if so, perhaps the C:\\Program Files\\SQL Anywhere 16\\ThirdPartyLegal\\ SQLAnywhere16ThirdPartyLegal.txt needs updating because it claims Apache is used.
See NGINX vs. Apache.
The following slightly-obfuscated-code was run on Windows 7 to call a web service on a local SQL Anywhere 16.0.0.2419 database:
CREATE PROCEDURE blah_blah_blah ( url_spec LONG VARCHAR ) RESULT ( attribute LONG VARCHAR, value LONG VARCHAR ) URL '!url_spec' HEADER 'ASA-Id' TYPE 'HTTP:GET'; SELECT * FROM blah_blah_blah ( 'http://localhost/blah blah blah' ) ORDER BY attribute; attribute,value Body,<html>blah blah blah</html> Cache-Control,no-cache Connection,close Content-Type,text/html Date,Wed, 12 Apr 2017 14:38:35 GMT Expires,Wed, 12 Apr 2017 14:38:34 GMT Server,nginx Status,HTTP/1.1 200 OK Vary,Accept-Encoding
At first glance, "haunted" is as good an answer as any 🙂
On further study...
The problem was caused because an underscore was used in a web client substitution parameter name; see Substitution parameters used for clause values:
All parameters used for substitution must be alphanumeric. Underscores are not allowed.
Here is a reproducible using two separate SQL Anywhere databases, one as a web server, and one as a web client...
Webserver database
"%SQLANY16%\\bin64\\dbspawn.exe"^ -f "%SQLANY16%\\bin64\\dbsrv16.exe"^ -o dbsrv16_log_webserver.txt^ -oe dbsrv16_log_fatal_webserver.txt^ -xs "http(port=12345")^ webserver.db CREATE SERVICE s TYPE 'RAW' AUTHORIZATION OFF USER DBA AS CALL p(); CREATE PROCEDURE p() RESULT ( html_string LONG VARCHAR ) BEGIN CALL dbo.sa_set_http_header( 'Content-Type', 'text/html' ); SELECT STRING ( '<html><body> ', PROPERTY ( 'ProductName' ), ' ', PROPERTY ( 'ProductVersion' ), ' </body></html>' ); END;
Webclient database with bad URL '!url_spec' clause returns strange result set
"%SQLANY16%\\bin64\\dbspawn.exe"^ -f "%SQLANY16%\\bin64\\dbsrv16.exe"^ -o dbsrv16_log_webclient.txt^ -oe dbsrv16_log_fatal_webclient.txt^ webclient.db CREATE PROCEDURE c ( url_spec LONG VARCHAR ) RESULT ( attribute LONG VARCHAR, value LONG VARCHAR ) URL '!url_spec' TYPE 'HTTP:GET'; SELECT * FROM c ( 'http://localhost:12345/s ' ) ORDER BY attribute; attribute,value Body,<html><head><meta http-equiv="refresh" content="0;url=http://search.centurylink.com/index.php ?origURL=http://_spec/&bc="/></head> <body><script type="text/javascript">window.location="http://search.centurylink.com/index.php ?origURL="+escape(window.location) +"&r="+escape(document.referrer)+"&bc=";</script></body></html> Cache-Control,no-cache Connection,close Content-Type,text/html Date,Fri, 14 Apr 2017 13:03:10 GMT Expires,Fri, 14 Apr 2017 13:03:09 GMT Server,nginx Status,HTTP/1.1 200 OK Vary,Accept-Encoding
Webclient database with good URL '!urlspec' clause returns expected result set
CREATE PROCEDURE c ( urlspec LONG VARCHAR ) RESULT ( attribute LONG VARCHAR, value LONG VARCHAR ) URL '!urlspec' TYPE 'HTTP:GET'; SELECT * FROM c ( 'http://localhost:12345/s ' ) ORDER BY attribute; attribute,value Body,<HTML><BODY> SQL Anywhere 16.0.0.2419 </BODY></HTML> Connection,close Content-Type,text/html Date,Fri, 14 Apr 2017 13:10:12 GMT Expires,Fri, 14 Apr 2017 13:10:12 GMT Server,SQLAnywhere/16.0.0.2419 Status,HTTP/1.1 200 OK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
11 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.