This describes the sample client and script found in the $SYBASE/WS-15_0/samples/apacheclient directory in UNIX, or in the %SYBASE%\WS-15_0\samples\apacheclient directory in Windows.
If you know what you are interested in, just follow the appropriate link.
To use the sample script provided, you must first ensure that you have access to a valid JRE.
Make sure the JRE variable points to your JRE by changing, if necessary, the variable definitions in all scripts in the apacheclient directory. You must use JRE version 1.3.1 or later. By default, the JRE supplied in the UNIX $SYBASE_JRE6 or Windows %SYBASE_JRE6% directory is used.
The runexecute script executes a stored procedure or T-SQL statement on Adaptive Server Enterprise through Adaptive Server Enterprise Web Services. This sample application invokes the execute Web method.
runexecute “web_service_URL” aseServerName user_ID password “SQLX_option” output_class count “select_statement”
The location of the Web service being used.
SOAP string indicating the name of the Adaptive Server Enterprise server in the interfaces file or LDAP server.
The user ID needed to log in to the Adaptive Server Enterprise.
The password needed to log in to the Adaptive Server Enterprise.
String indicating one or more option parameters for a forxmlj function. These parameters specify characteristics of the SQLX result set. The following are valid option parameters:
You must provide values for value. For more information on SQLX
functions and options, see XML Services in Adaptive Server Enterprise.
The kind of output desired. The following are valid values for this parameter:
The number of times to execute the statement. If the value of count is greater than 1, a session is created, and a persistent connection is used.
The statement to be executed on Adaptive Server Enterprise. This statement must be delimited by double quotes.
This example checks the version number for Adaptive Server Enterprise using a select statement.
runexecute "http://johndoe-sun:8183/services/ase" johndoe-sun sa nopasswordspecified "tablename=ws" all 1 "select @@version"
Adaptive Server Enterprise Web Services returns an XML schema, a DTD, and a result set containing the result of the executed statement.
This example executes a stored procedure called booksales on the pubs2 database. The stored procedure returns the number of copies sold for a specified book title ID.
runexecute "http://johndoe-sun:8183/services/ase" johndoe-sun sa nopasswordspecified "columnstyle=attribute,format=no,rowname=wsrow,prefix=Unnamedcol,nullstyle=attribute,header=yes" all 1 "execute booksales MC2222"
Adaptive Server Enterprise Web Services returns an XML schema, a DTD, and a result set containing the result of the executed statement.
This is the result set returned:
<?xml version="1.0" ?> <resultset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <wsrow title="Silicon Valley Gastronomic Treats" total_sales="2032" Unnamedcol1="Books sold"/> </resultset>
This is the DTD returned:
<!ELEMENT resultset (row*)> <!ELEMENT row (title, total_sales, Unnamedcol1)> <!ELEMENT title (#PCDATA)> <!ELEMENT total_sales (#PCDATA)> <!ELEMENT Unnamedcol1 (#PCDATA)>
This is the schema returned:
<?xml version="1.0" ?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sqlxml="http://www.iso-standards.org/mra/9075/ sqlx"> <xsd:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="http://www.iso-standards.org/mra/ 9075/sqlx.xsd" /> <xsd:complexType name="RowType.resultset"> <xsd:attribute name="title" type="VARCHAR_80" use="required"/> <xsd:attribute name="total_sales" type="INTEGER" use="optional"/> <xsd:attribute name="Unnamedcol1" type="VARCHAR_24" use="optional"/> </xsd:complexType> <xsd:complexType name="TableType.resultset"> <xsd:sequence> <xsd:element name="wsrow" type="RowType.resultset" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:simpleType name="VARCHAR_80"> <xsd:restriction base="xsd:string"> <xsd:length value="80"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="INTEGER"> <xsd:restriction base="xsd:integer"> <xsd:maxInclusive value="2147483647"/> <xsd:minInclusive value="-2147483648"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="VARCHAR_24"> <xsd:restriction base="xsd:string"> <xsd:length value="24"/> </xsd:restriction> </xsd:simpleType> <xsd:element name="resultset" type="TableType.resultset"/> </xsd:schema>