In this lesson, you set up a SQL Anywhere web server running SOAP and DISH web services that handles Visual C# client application requests.
Start the SQL Anywhere demo database using the following command:
dbsrv12 -xs http(port=8082) samples-dir\demo.db |
This command indicates that the HTTP web server should listen on port 8082 for requests. Use a different port number if 8082 is disallowed on your network.
Connect to the database server in Interactive SQL using the following command:
dbisql -c "UID=DBA;PWD=sql;SERVER=demo" |
Create a new SOAP service to accept incoming requests.
Run the following SQL script in Interactive SQL:
CREATE SERVICE "SASoapTest/EmployeeList" TYPE 'SOAP' DATATYPE ON AUTHORIZATION OFF SECURE OFF USER DBA AS SELECT * FROM Employees; |
This script creates a new SOAP web service named SASoapTest/EmployeeList that generates a SOAP type as output. It selects all columns from the Employees table and returns the result set to the client.
DATATYPE ON indicates that explicit data type information is generated in the XML result set response and the input parameters. This option does not affect the WSDL document that is generated. For more information about the DATATYPE clause, see CREATE PROCEDURE statement (web clients).
Create a new DISH service to act as a proxy for the SOAP service and to generate the WSDL document.
Run the following SQL script in Interactive SQL:
CREATE SERVICE "SASoapTest_DNET" TYPE 'DISH' GROUP "SASoapTest" FORMAT 'DNET' AUTHORIZATION OFF SECURE OFF USER DBA; |
DISH web services accessed from .NET should be declared with the FORMAT 'DNET' clause. The GROUP clause identifies the SOAP services that should be handled by the DISH service. The EmployeeList service created in the previous step is part of the GROUP 'SASoapTest' because it is declared as SASoapTest/EmployeeList.
Verify that the DISH web service is functional by accessing it through a web browser.
Open your web browser and go to http://localhost:8082/demo/SASoapTest_DNET.
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |