I'm trying to learn how to create a web service in SQLA11, following the tutorial instructions at http://infocenter.sybase.com/help/topic/com.sybase.help.sqlanywhere.11.0.1/dbprogramming_en11/headers-soap.html (which /should/ be "SQL Anywhere 11.0.1 > SQL Anywhere Server - Programming > SQL Anywhere Data Access APIs > SQL Anywhere web services")

I can run all of the SQLA statements and DDL statements successfully, but when I try to run the last statement (CALL FahrenheitToCelsius(212);), it fails with an error code of -983:

Could not execute statement. HTTP request failed. Status code '400 Bad Request' SQLCODE=-983, ODBC 3 State="HY000" Line 1, column 1

CALL FahrenheitToCelsius(212)

I have already checked to make sure the firewall isn't blocking anything. Full db version info is: SQL Anywhere Network Server Version 11.0.1.2044.

My goal: PowerBuilder 11.5 application calls a web service, passing two parameters. Web service validates the parameters against a database, returning a generated data value.

Since SQLA has web services (and SOAP) built in, it seems like a no-brainer to use the feature. :)

asked 26 Apr '10, 16:06

Jason%20%27Bug%27%20Fenter's gravatar image

Jason 'Bug' ...
158669
accept rate: 50%


The documentation has not been updated to reflect implementation updates. The correct way to define the client SOAP procedure is as follows:

CREATE PROCEDURE FtoC( temperature FLOAT ) URL 'http://localhost:8082/FtoCService' SET 'SOAP(OP=FtoCService)' TYPE 'SOAP:DOC';

The SET clause is required to explicitly specify the SOAP method. If it is not specified then the name of the client procedure is used as the SOAP method by default. The SOAP method corresponds to a SQL Anywhere SOAP service. Alternatively if convoluted naming is acceptable (I'm not suggesting that this is the case) you could simply rename the client procedure to FtoCService.

The documentation is in process of being updated. It will be ammended to demonstrate the use of a DISH service which serves as a SOAP endpoint. When a DISH service is accessed with an HTTP GET request, it will return the WSDL for all SOAP services within its context. When accessed by an HTTP POST request, it expects to process a SOAP request envelope. For example you may define a DISH service and ALTER the FtoC SOAP procedure as follows (I'm using the default port 80):

create service soap_endpoint type 'DISH' authorization off secure off user DBA;

ALTER PROCEDURE FtoC( temperature FLOAT ) URL 'http://localhost/soap_endpoint' SET 'SOAP(OP=FtoCService)' TYPE 'SOAP:DOC';

With the above modifications, calling FtoC will initiate an HTTP request to soap_endpoint (a DISH service) and automatically generate a SOAP request envelope (an XML document) that specifies its SOAP OPeration as FtoCService.

permanent link

answered 26 Apr '10, 20:19

Viktor's gravatar image

Viktor
17113
accept rate: 66%

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:

×31
×17

question asked: 26 Apr '10, 16:06

question was seen: 2,497 times

last updated: 26 Apr '10, 20:19