Creating a SOAP Web Service from an ASA Stored Procedure

SOAP (Simple Object Access Protocol), a platform- and language-independent protocol based on XML, is used to send messages and data between applications. SOAP defines the structure of messages and describes how messages are to be processed.

Note

If you are using the default connection profile, MyDatabase, you must edit the startDemo.bat file before creating the Web service. See Using the Default Connection Profiles for additional information.

To create a SOAP Web service from an ASA stored procedure:

  1. From the Database Development perspective, select Create Web Service from the pop-up menu for a stored procedure or the Web Services folder.

    You are switched to the Database Explorer perspective.

  2. Set the properties in the Object Details view as appropriate.

    ASA Web Service Properties

    Property

    Description

    Web Service Name

    The name of the Web service. The name cannot be modified after the Web service is saved.

    Stored Procedure

    The name of the stored procedure. If you selected Create Web Service from the pop-up menu for a stored procedure, its name is displayed by default.

    Authorization

    Select if users must provide a user name and password to use the Web service:

    • To specify that a specific user name and password must be supplied, select Authorization and Run As User and select a user name from the User drop-down list.

    • To specify that any user known to the database can use the Web service, select Authorization and clear the Run As User check box.

    • To specify that a user name and password are not required, clear the Authorization check box. Clearing the Authorization check box disables the Run As User check box and sets it to checked. All requests are run using the account of the user specified in the User drop-down list.

    Run As User

    Select if you have selected Authorization and want to specify that only the user selected from the User drop-down list can use the Web service. Clear if any user can use the Web service.

    User

    Select a user from the drop-down list. The default is DBA.

    Secure

    Select if security is required for the Web service. When this box is selected, the Web service is processed only if the request is made using a secure (https) connection. If a request is received on the http port, the request is redirected to the https port.

  3. If the Create SOAP Service checkbox is selected, after the ASA Web service is created, a SOAP service model is created with the new Web service as the endpoint. Clear the checkbox if you do not want to create a SOAP service model.

  4. Select Save Changes from the pop-up menu in the Object Details view.

  5. Specify a name and location for the WSDL file and click OK.

    The Web service is added to the Web Services folder in the Database Explorer view. If Create SOAP Service was selected, specify a name and location for the service model. If Authorization was selected, specify a user id and password. The SOAP service model is added to the specified location and displayed in the WorkSpace Navigator.

You can also execute the following actions against an ASA Web service:

To access the WSDL for the ASA Web service:

You can specify a URL, as shown below, to access the WSDL for an ASA Web service, or to specify it as an endpoint:

http://<host>/<dbname>/<wsname>

for example, http://myasa/asademo/ws_sp_name

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com