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

asked 12 Apr, 10:57

Breck%20Carter's gravatar image

Breck Carter
26.9k440613886
accept rate: 21%

edited 12 Apr, 11:01

I haven't found the string "nginx" in the all SA17 binary files. This is not an answer, just a comment :)

(12 Apr, 12:17) Vlad

That should report the server for the specified URL.

When I browse to my database -xs listener that http response is

<--     Server: SQLAnywhere/16.0.0.2344
 {Nope haven't tried it with latest yet}

using lopt=all,headers (or ALL,reshdrs) but if I specify my local IIS server (port 80) that correctly comes back with

attribute,   value
Server,      Microsoft-IIS/10.0

So I would be willing to bet your URL is pointing to a nginx (type | based) server.

O/W I do not see any evidence of a switch in our code to nginx (yet)

Do let me know if this illusion persists ...

(12 Apr, 15:29) Nick Elson S...
Replies hidden

> So I would be willing to bet your URL is pointing to a nginx (type | based) server.

The URL is localhost which is Foxhound which is running inside a SQL Anywhere 16 database.

I should put together a compleat repro... sigh :)

(13 Apr, 12:38) Breck Carter

I would like to see the repro :) you know this IT world already.

(14 Apr, 07:00) Vlad

OK, here goes... with my luck, the repro will simply reveal my computer is haunted :)... stay tuned.

(14 Apr, 08:08) Breck Carter

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
permanent link

answered 14 Apr, 09:35

Breck%20Carter's gravatar image

Breck Carter
26.9k440613886
accept rate: 21%

I could grok an error message, even an empty result set, but some random web page from the ISP (CenturyLink)?

(14 Apr, 09:37) Breck Carter
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×34

question asked: 12 Apr, 10:57

question was seen: 214 times

last updated: 14 Apr, 09:37