Skip Headers
Oracle® Retail Integration Bus Service-Oriented Architecture Enabler Tool Guide
Release 14.0
E49440-01
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

6 Service Definition Library XML File for Restful services

The REST Service Definition Library XML file (ServiceDef) is the mandatory input for creating a RESTful Java EE or a PL/SQL service provider. This file should contain all the details about the Web services that need to be created.

This chapter provides a detailed description of each section of the schema as well as instructions for managing the Service Definition Library XML file.

Schema Definition

This section discusses the elements of the schema, beginning with the root element and including child elements.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.oracle.com/retail/integration/services/serviceProviderDefLibrary/v1"
    xmlns="http://www.oracle.com/retail/integration/services/serviceProviderDefLibrary/v1"
    elementFormDefault="qualified">
    <xs:element name="serviceProviderDefLibrary">
<xs:complexType>
<xs:sequence>
                <xs:element ref="service" maxOccurs="unbounded" />
            </xs:sequence>
            <xs:attribute name="appName" type="xs:string" use="required"/>
            <xs:attribute name="version" type="xs:string" use="optional" default="v1"/>
            <xs:attribute name="serviceNamespacePattern" type="xs:string" use="optional" default="http://www.oracle.com/retail/APPNAME/integration/services/SERVICENAMEService/VERSION"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="documentation" type="xs:string" />
<xs:element name="header">
<xs:complexType>
            <xs:attribute name="type" type="xs:string" use="required"/>
            <xs:attribute name="headerName" type="xs:string" use="required"/>
            <xs:attribute name="headerRequired" type="xs:boolean" use="optional" default="false"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="input">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="documentation" minOccurs="0" />
                <xs:element ref="header" minOccurs="0" maxOccurs="unbounded"  />
            </xs:sequence>
            <xs:attribute name="type" type="xs:string" use="required"/>
            <xs:attribute name="version" type="xs:string" use="optional" default="v1"/>
            <xs:attribute name="custom" type="xs:boolean" use="optional" default="false"/>
            <xs:attribute name="identifierNameList" type="xs:string" use="optional" />
        </xs:complexType>
    </xs:element>
    <xs:element name="output">
<xs:complexType>
<xs:sequence>
                <xs:element ref="documentation" minOccurs="0" />
                <xs:element ref="relations" minOccurs="0"/>
            </xs:sequence>
            <xs:attribute name="type" type="xs:string" use="required"/>
            <xs:attribute name="version" type="xs:string" use="optional"  default="v1"/>
            <xs:attribute name="custom" type="xs:boolean" use="optional" default="false"/>
           
        </xs:complexType>
    </xs:element>
    <xs:element name="relations">
<xs:complexType>
<xs:sequence>
        <xs:element ref="relatedTo" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
   
    <xs:element name="relatedTo">
    <xs:complexType>           
        <xs:attribute name="name" use="required">
            <xs:simpleType>
                    <xs:restriction base="xs:string">
                    <xs:pattern value="[a-zA-Z0-9]*|EXTERNAL_SYSTEM"></xs:pattern>                                                                 
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        <xs:attribute name="value" type="xs:string" use="optional" />
            </xs:complexType>
            </xs:element>
   
   
<xs:element name="fault">
<xs:complexType>
            <xs:sequence>
                <xs:element ref="documentation" minOccurs="0" />
            </xs:sequence>
            <xs:attribute name="faultType" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="operation">
<xs:complexType>
<xs:sequence>
                <xs:element ref="documentation" minOccurs="0" />
                <xs:element ref="input" />
                <xs:element ref="output" minOccurs="0" />
                <xs:element ref="fault" minOccurs="0"
                    maxOccurs="unbounded" />
            </xs:sequence>
            <xs:attribute name="name" type="xs:string" use="required"/>
            <xs:attribute name="suffix" default="inputType">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="inputType" />
                        <xs:enumeration value="outputType" />
                        <xs:enumeration value="NONE" />
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="custom" type="xs:boolean" use="optional" default="false"/>
            <xs:attribute name="operationType" default="READ_WITH_IDENTITY">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="CREATE" />
                        <xs:enumeration value="READ_WITH_IDENTITY" />
                        <xs:enumeration value="READ_WITH_PREDICATE" />
                        <xs:enumeration value="UPDATE" />
                        <xs:enumeration value="DELETE" />
                        <xs:enumeration value="PROCESS" />
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    <xs:element name="service">
<xs:complexType>
<xs:sequence>
                <xs:element ref="documentation" minOccurs="0" />
                <xs:element ref="operation" maxOccurs="unbounded" />
            </xs:sequence>
            <xs:attribute name="name" type="xs:string" use="required"/>
            <xs:attribute name="serviceNamespace" type="xs:string" use="optional"/>
            <xs:attribute name="serviceVersion" type="xs:string" use="optional" default="v1"/>
            <xs:attribute name="custom" type="xs:boolean" use="optional" default="false"/>
        </xs:complexType>
    </xs:element>
</xs:schema>

ServiceProviderDefLibrary

This is the root element of the schema. The following is an example of the serviceProviderDefLibrary element.

Sample Rest Service Definition Library file:

<serviceProviderDefLibrary appName="rms" xmlns="http://www.oracle.com/retail/integration/services/serviceProviderDefLibrary/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<service name="Suppliers">
      <operation name="find" operationType="READ_WITH_PREDICATE" suffix="outputType">
         <input type="SupplierColRef" identifierNameList="country_id"/>
         <output type="SupplierColDesc">
         </output>
         <fault faultType="IllegalArgumentWSFaultException" />
      </operation>
      <operation name="delete" operationType="DELETE">
         <input type="SupplierColRef" identifierNameList="country_id"/>
         <output type="SupplierColRef">
         </output>
         <fault faultType="IllegalArgumentWSFaultException" />
      </operation>
     
</service>
</serviceProviderDefLibrary>

Validation rules for a service definition xml for RESTful web services