In this lesson, you set up a MIME-type on a new web client. This lesson assumes that you have set up a web server database as instructed in the previous lesson. For more information about setting up a database server to receive the requests from the web client described in this lesson, see Lesson 1: Set up a web server database to receive RAW requests and send RAW responses.
Run the following command to create a SQL Anywhere database:
dbinit echo_client |
Start the personal database client using the following command:
dbsrv12 echo_client.db |
Connect to the database in Interactive SQL using the following command:
dbisql -c "UID=DBA;PWD=sql;SERVER=echo_client" |
Create a new stored procedure to send requests to a web service.
Run the following SQL script in Interactive SQL:
CREATE PROCEDURE setMIME( value LONG VARCHAR, mimeType LONG VARCHAR, urlSpec LONG VARCHAR ) URL '!urlSpec' TYPE 'HTTP:POST:!mimeType'; |
In the next lesson, the web client passes the necessary variables to the setMIME procedure, which requires three parameters. The urlSpec parameter indicates which URL to use to connect to the web service, the mimeType indicates which MIME-type to use for the HTTP:POST type, and the value parameter represents the body of the request that should be returned by the web service.
The server sets the default TYPE to SOAP:RPC when the clause is not specified, which does not support custom MIME-types. For more information about the TYPE clause, see CREATE PROCEDURE statement (web clients).
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |