Complex Schema Support

The following section describes REST Adapter complex schema capabilities in more detail.

Complex Schema Support

Support is provided for XSDs that can import and include other XSDs. The included XSDs in the ZIP file can import the XSD from an HTTP location. All XSD files must be added to a ZIP file and uploaded when configuring the REST Adapter in the Adapter Endpoint Configuration Wizard.

In the following example, the hierarchy of the ZIP file to upload is as follows:

zipxsd.zip
  first.xsd
  second (folder)
    second.xsd
first.xsd imports second.xsd.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:tns="http://xmlns.oracle.com/first" 
targetNamespace="http://xmlns.oracle.com/first" 
      xmlns:tns1="http://xmlns.oracle.com/second"> 
<xs:import schemaLocation="./second/second.xsd" 
targetNamespace="http://xmlns.oracle.com/second"/>
<xs:import schemaLocation="https://example.com/fscmService/ItemServiceV2?
XSD=/xml/datagraph.xsd" targetNamespace="commonj.sdo"/>
<xs:element name="book"> 
  <xs:complexType> 
    <xs:sequence> 
      <xs:element name="isbn" type="xs:string"/>
      <xs:element name="title" type="xs:string"/> 
      <xs:element name="author" type="tns1:author"/> 
    </xs:sequence> 
  </xs:complexType>  
</xs:element> 
</xs:schema>
The contents of second.xsd are as follows.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:tns="http://xmlns.oracle.com/second" 
targetNamespace="http://xmlns.oracle.com/second"> 
<xs:import schemaLocation="https://example.com/fscmService/ItemServiceV2?
XSD=/mycompany/apps/scm/productModel/items/itemServiceV2/ItemAttachment.xsd" 
targetNamespace="http://xmlns.oracle.com/apps/scm/productModel/items/itemServiceV2/"/>
<xs:complexType name="author">
    <xs:sequence> 
       <xs:element name="name" type="xs:string"/>  
       <xs:element name="address" type="xs:string"/> 
    </xs:sequence> 
</xs:complexType> 
<xs:element name="Admin">
    <xs:complexType>
          <xs:sequence>
             <xs:element name="AdminName" type="xs:string"/>
             <xs:element name="AdminAdd" type="xs:string"/>
          </xs:sequence>
    </xs:complexType>
</xs:element>
</xs:schema> 

Note:

If you are importing from HTTPS locations, ensure that you import the SSL certificates into Oracle Integration.