In this lesson, you set up a SQL Anywhere web server running SOAP and DISH web services that handles Visual C# client application requests.
Prerequisites
A recent version of Visual Studio is required.
This lesson assumes that you have the roles and privileges listed in the Privileges section at the start of this tutorial: Tutorial: Using Visual C# to access a SOAP/DISH web service.
Start the SQL Anywhere demonstration database using the following command:
dbsrv16 -xs http(port=8082) "%SQLANYSAMP16%\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.
Execute the following SQL statement in Interactive SQL:
CREATE SERVICE "SASoapTest/EmployeeList" TYPE 'SOAP' DATATYPE ON AUTHORIZATION OFF SECURE OFF USER DBA AS SELECT * FROM Employees; |
This statement 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. The service name is surrounded by quotation marks because of the slash character (/) that appears in the service name. If you logged in with a different user ID, then the USER DBA clause must be changed to reflect your user ID.
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.
The FORMAT clause is not specified so the SOAP service format is dictated by the associated DISH service format which is declared in the next step.
Create a new DISH service to act as a proxy for the SOAP service and to generate the WSDL document.
Execute the following SQL statement 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. If you logged in with a different user ID, then the USER DBA clause must be changed to reflect your user ID.
Verify that the DISH web service is functional by accessing the associated WSDL document through a web browser.
Open your web browser and go to http://localhost:8082/demo/SASoapTest_DNET.
The DISH service automatically generates a WSDL document that appears in the browser window.
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0 |