This documentation is for WSO2 Data Services Server 3.2.2. View documentation for the latest release.
Page Comparison - Defining Service Operations (v.3 vs v.4) - Data Services Server 3.2.2 - WSO2 Documentation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Click Next to add a data source. Follow the instructions in Creating Adding Datasources.
  2. Click Next to add a query to the data source. Follow the instructions in Writing Data Service Queries.
  3. Click Next to add an operation to invoke the queries.
  4. The Add Operation page appears. Provide a name for the operation and select the query to execute when the operation is invoked. For example,
     
    Also, see enable streaming.
Info

You can get a SOAP response instead of an HTTP 202 when invoking an IN-ONLY operation by setting the returnRequestStatus attribute to true in a dataservice operation. For example,

Code Block
languagehtml/xml
<operation name="operation1" returnRequestStatus="true"> 
   <call-query href="QRY_INSERT_DM"> 
       <with-param name="dm1" query-param="dm1"/> 
       <with-param name="dm2" query-param="dm3"/> 
  </call-query>


Handling Faulty Requests

A structured SOAP fault message will be returned for an incorrect invocation of the data service. For example, if you use an invalid value to invoke a data service which that validates the length of the parameters, a SOAP fault SOAP fault with VALIDATION_ERROR code will be returned. A SOAP fault message is constructed as given in the following XML schema structure.

Code Block
<xs:element name="DataServiceFault">
    <xs:complexType>
        <xs:sequence>
        <xs:element name="current_params" type="xs:string"/>
        <xs:element name="current_request_name" type="xs:string"/>
        <xs:element name="nested_exception" type="xs:string"/>
        <xs:element name="source_data_service">
            <xs:complexType>
            <xs:sequence>
                <xs:element name="location" type="xs:string"/>
                <xs:element name="default_namespace" type="xs:string"/>
                <xs:element name="description" type="xs:string"/>
                <xs:element name="data_service_name" type="xs:string"/>
            </xs:sequence>
            </xs:complexType>
        </xs:element>
        <xs:element name="ds_code" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
</xs:element>