In this lesson, you call the wrapper procedure created in the previous lesson, which sends a SOAP request to the web server that you created in lesson one.
Prérequis
This lesson assumes that you have set up a web server as instructed in lesson 1. See Lesson 1: Setting up a web server to receive SOAP requests and send SOAP responses.
This lesson assumes that you have set up a web client as instructed in lesson 2. See Lesson 2: Setting up a web client to send SOAP requests and receive SOAP responses.
This lesson assumes that you have the roles and privileges listed in the Privileges section at the start of this tutorial: Tutorial: Using SQL Anywhere to access a SOAP/DISH service.
Connect to the client database in Interactive SQL if it is not already open from lesson two.
dbisql -c "UID=DBA;PWD=sql;SERVER=ftc_client" |
Enable logging of SOAP requests and responses.
Execute the following SQL statements in Interactive SQL:
CALL sa_server_option('WebClientLogFile', 'soap.txt'); CALL sa_server_option('WebClientLogging', 'ON'); |
These calls allow you to examine the content of the SOAP request and response. The requests and responses are logged to a file called soap.txt.
Call the wrapper procedure to send a SOAP request and receive the SOAP response.
Execute the following SQL statement in Interactive SQL:
CALL FahrenheitToCelsius(212); |
This call passes a Fahrenheit value of 212 to the FahrenheitToCelsius procedure, which passes the value along with two customized SOAP headers to the FToC procedure. Both client-side procedures are created in the previous lesson.
Exemple
Here is another sample call to the SOAP web service that will convert a temperature in Fahrenheit degrees to Celsius degrees.
CALL FahrenheitToCelsius(32); |
The following result set is generated in Interactive SQL:
Fahrenheit Celsius 32 0 |
![]() |
Discuter à propos de cette page dans DocCommentXchange.
|
Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0 |