skip to main content
Corticon Server: Integration & Deployment Guide : Service contract examples : Examples of XSD and WSDLS available in the Deployment Console : Vocabulary-level XML schema, FLAT XML messaging style
 

Try Corticon Now
Vocabulary-level XML schema, FLAT XML messaging style
This topic defines and annotates the FLAT Vocabulary-level XSD in the following sections:
*Vocabulary-Level WSDL, FLAT XML Messaging Style
*Header
*CorticonRequestType and CorticonResponseType
*WorkDocumentsType
*MessagesType
*VocabularyEntityNameType
*VocabularyAttributeNameTypes

Vocabulary-Level WSDL, FLAT XML Messaging Style

<?xml version=1.0 encoding=UTF-8?>
<definitions xmlns=http://schemas.xmlsoap.org/wsdl/ xmlns:tns=
http://localhost:8850/axis/services/Corticon/CargoDecisionService
xmlns:cc= urn:decision:CargoDecisionService
xmlns:xsd=http://www.w3.org/2001/XMLSchema
xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/ targetNamespace=
http://localhost:8850/axis/services/Corticon/CargoDecisionService<types>
    <xsd:schema xmlns:tns= urn:decision:CargoDecisionService
targetNamespace= urn:decision:CargoDecisionService
elementFormDefault=qualified>      
<xsd:element name=CorticonRequest type=tns:CorticonRequestType />      
<xsd:element name=CorticonResponse type=tns:CorticonResponseType />      
<xsd:complexType name=CorticonRequestType>        
<xsd:sequence>          
<xsd:element name=WorkDocuments type=tns:WorkDocumentsType />        
</xsd:sequence>        
<xsd:attribute name=decisionServiceName use=required
type=xsd:string />      
</xsd:complexType>      
<xsd:complexType name=CorticonResponseType>        
<xsd:sequence>          
<xsd:element name=WorkDocuments type=tns:WorkDocumentsType />          
<xsd:element name=Messages type=tns:MessagesType />        
</xsd:sequence>
Even though this is a Vocabulary-level WSDL, the Decision Service Name is still required:
<xsd:attribute name=decisionServiceName use=required
type=xsd:string />      
</xsd:complexType>      
<xsd:complexType name=WorkDocumentsType>        
<xsd:choice maxOccurs=unbounded>
This is a Vocabulary-level service contract, so all entities in the Vocabulary are included here:
<xsd:element name=Aircraft
type=tns:AircraftType minOccurs=0 maxOccurs=unbounded />          
<xsd:element name=Cargo type=tns:CargoType minOccurs=0 maxOccurs=unbounded />
<xsd:element name=FlightPlan
type=tns:FlightPlanType minOccurs=0 maxOccurs=unbounded />        
</xsd:choice>
FLAT style specified here:
<xsd:attribute name=messageType fixed=FLAT use=optional />
     </xsd:complexType>
<xsd:element name=Aircraft type=tns:AircraftType minOccurs=0
maxOccurs=unbounded />
        <xsd:element name=Cargo type=tns:CargoType\ minOccurs=0
maxOccurs=unbounded />
        <xsd:element name=FlightPlan type=tns:FlightPlanType minOccurs=0
maxOccurs=unbounded />
</xsd:choice>
      </xsd:complexType>
      <xsd:complexType name=MessagesType>
        <xsd:sequence>
          <xsd:element name=Message type=tns:MessageType minOccurs=0
maxOccurs=unbounded />
</xsd:sequence>
       <xsd:attribute name=version type=xsd:string />
      </xsd:complexType>
      <xsd:complexType name=MessageType>
        <xsd:sequence>
          <xsd:element name=severity>
            <xsd:simpleType>
              <xsd:restriction base=xsd:string>
                <xsd:enumeration value=Info" />
                <xsd:enumeration value=Warning />
                <xsd:enumeration value=Violation />
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:element>
          <xsd:element name=text type=xsd:string />
          <xsd:element name=entityReference>
            <xsd:complexType>
              <xsd:attribute name=href type=xsd:anyURI />
            </xsd:complexType>
          </xsd:element> 
       </xsd:sequence>     
</xsd:complexType>
      <xsd:complexType name=AircraftType>
        <xsd:sequence>
          <xsd:element name=aircraftType type=xsd:string nillable=false minOccurs=0 />
          <xsd:element name=maxCargoVolume type=xsd:decimal nillable=false minOccurs=0 />
          <xsd:element name=maxCargoWeight type=xsd:decimal nillable=false minOccurs=0 />
          <xsd:element name=tailNumber type=xsd:string nillable=false minOccurs=0 />
          <xsd:element name=flightPlan type=tns:ExtURIType minOccurs=0 maxOccurs=unbounded />
        </xsd:sequence>
        <xsd:attribute name=id type=xsd:ID use=optional />
      </xsd:complexType>
      <xsd:complexType name=CargoType>
        <xsd:sequence>
          <xsd:element name=manifestNumber type=xsd:string nillable=false minOccurs=0 /> 
         <xsd:element name=volume type=xsd:decimal nillable=false minOccurs=0 />
          <xsd:element name=weight type=xsd:decimal nillable=false minOccurs=0 />
          <xsd:element name=flightPlan type="tns:ExtURIType minOccurs=0 /> 
       </xsd:sequence>
        <xsd:attribute name=id type=xsd:ID use=optional />
      </xsd:complexType>
      <xsd:complexType name=FlightPlanType
       <xsd:sequence>
<xsd:element name=flightNumber type=xsd:integer nillable=false minOccurs=0 />
          <xsd:element name=flightRange type=xsd:integer nillable=false minOccurs=0 />
This is a FLAT-style message, so all associations are represented by the ExtURIType:
<xsd:element name=aircraft type=tns:ExtURIType minOccurs=0 />
    <xsd:element name=cargo type=tns:ExtURIType minOccurs=0
maxOccurs=unbounded />
  </xsd:sequence>
     <xsd:attribute name=id type=xsd:ID use=optional />
    </xsd:complexType>
    <xsd:complexType name=ExtURIType>
      <xsd:attribute name=href type=xsd:anyURI />
    </xsd:complexType>
   </xsd:schema>
  </types>
  <message name=CorticonRequestIn>
    <part name=parameters element=cc:CorticonRequest />
  </message>
  <message name=CorticonResponseOut>
    <part name=parameters element=cc:CorticonResponse />
  </message>
  <portType name=CargoDecisionServiceSoap>
    <operation name=processRequest>
      <input message=tns:CorticonRequestIn />
      <output message=tns:CorticonResponseOut />
    </operation>
  </portType>
  <binding name=CargoDecisionServiceSoap
type=tns:CargoDecisionServiceSoap>
All Web Services service contracts must be document-style!
<soap:binding transport=http://schemas.xmlsoap.org/soap/http
style=document />
    <operation name=processRequest>
      <soap:operation soapAction=urn:Corticon style=document />
      <input>
        <soap:body use=literal namespace=urn:Corticon />
      </input>
      <output>
        <soap:body use=literal namespace=urn:Corticon />
      </output>
    </operation>
  </binding>
  <service name=CargoDecisionService>
    <documentation>InsertDecisionServiceDescription</documentation>
    <port name=CargoDecisionServiceSoap binding=tns:CargoDecisionServiceSoap>
      <soap:address location=http://localhost:8850/axis/services/Corticon />
    </port>
</service>
</definitions>

Header

<?xml version=1.0 encoding=UTF-8?>
<xsd:schema xmlns:xsd=http://www.w3.org/2001/XMLSchema
xmlns:tns=urn:<namespace> targetNamespace=urn:<namespace>
elementFormDefault=qualified>
for details on <namespace> definition, see XML Namespace Mapping

CorticonRequestType and CorticonResponseType

The CorticonRequest element contains the required input to the Decision Service:
<xsd:element name=CorticonRequest type=tns:CorticonRequestType />
The CorticonResponse element contains the output produced by the Decision Service:
<xsd:element name=CorticonResponse type=tns:CorticonResponseType />
 
<xsd:complexType name=CorticonRequestType>
  <xsd:sequence>
Each CorticonRequestType must contain one WorkDocuments element:
<xsd:element name=WorkDocuments type=tns:WorkDocumentsType />
</xsd:sequence>
This attribute contains the Decision Service Name. Because a Vocabulary-level service contract can be used for several different Decision Services (provided they all use the same Vocabulary), a Decision Service Name will not be automatically populated here during service contract generation. Your request document must contain a valid Decision Service Name in this attribute, however, so the Server knows which Decision Service to execute…
<xsd:attribute name=decisionServiceName use=required type=xsd:string />
This attribute contains the Decision Service target version number. While every Decision Service created in Corticon Studio will be assigned a version number (if not manually assigned), it is not necessary to include that version number in the invocation unless you want to invoke a specific version of the named Decision Service.
<xsd:attribute name=decisionServiceTargetVersion use=optional
type=xsd:decimal />
This attribute contains the invocation timestamp. Decision Services may be deployed with effective and expiration dates, which allow the Corticon Server to manage multiple versions of the same Decision Service Name and execute the effective version based on the invocation timestamp. It is not necessary to include the invocation unless you want to invoke a specific effective version of the named Decision Service by date (usually past or future).
<xsd:attribute name=decisionServiceEffectiveTimestamp use=optional
type=xsd:dateTime />
</xsd:complexType>
<xsd:complexType name=CorticonResponseType>
<xsd:sequence>
Each CorticonResponseType element produced by the Server will contain one WorkDocuments element:
<xsd:element name=WorkDocuments type=tns:WorkDocumentsType />
Each CorticonResponseType element produced by the Server will contain one Messages element, but if the Decision Service generates no messages, this element will be empty:
<xsd:element name=Messages type=tns:MessagesType />
</xsd:sequence>
Same as attribute in CorticonRequest. This means that every CorticonResponse will contain the Decision Service Name executed during the transaction.
< xsd:attribute name=decisionServiceName use=required
type=xsd:string />
Same as attribute in CorticonRequest.
<xsd:attribute name=decisionServiceTargetVersion use=optional
type=xsd:decimal />
Same as attribute in CorticonRequest.
<xsd:attribute name=decisionServiceEffectiveTimestamp use=optional
type=xsd:dateTime />

WorkDocumentsType

Entities within WorkDocumentsType may be listed in any order.
<xsd:complexType name=WorkDocumentsType>
If you plan to use a software tool to read and use a Corticon-generated service contract, be sure it supports this <xsd:choice> tag…
<xsd:choice maxOccurs=unbounded>
In a Vocabulary-level XSD, a WorkDocumentsType element contains all of the entities from the Vocabulary file specified in the Deployment Console. All entities are optional in message instances that use this service contract (minOccurs="0" indicates optional) and have the form:

<xsd:element name="VocabularyEntityName" type="tns:VocabularyEntityNameType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="VocabularyEntityName" type="tns:VocabularyEntityNameType" minOccurs="0" maxOccurs="unbounded" />
  </xsd:choice>
This element reflects the FLAT XML Messaging Style selected in the Deployment Console:
<xsd:attribute name=messageType fixed=FLAT use=optional />
</xsd:complexType>

MessagesType

<xsd:complexType name=MessagesType>
If you plan to use a software tool to read and use a Corticon-generated service contract, be sure it supports this <xsd:sequence> tag (see important note below)…
<xsd:sequence>
A Messages element includes zero or more Message elements.
<xsd:element name=Message type=tns:MessageType minOccurs=0
maxOccurs=unbounded />
  </xsd:sequence>
This version number corresponds to the responding Decision Service's version number, which is set in Corticon Studio.
<xsd:attribute name=version type=xsd:string />
</xsd:complexType>
A Message element consists of several items – see the Rule Language Guide for more information on the post operator, which generates the components of a Messages element.
<xsd:complexType name=MessageType>
  <xsd:sequence>
These severity levels correspond to those of the posted Rule Statements…
<xsd:element name=severity>
      <xsd:simpleType>
         <xsd:restriction base=xsd:string>
            <xsd:enumeration value=Info />
            <xsd:enumeration value=Warning />
            <xsd:enumeration value=Violation />
         </xsd:restriction>
      </xsd:simpleType>
</xsd:element>
The text element corresponds to the text of the posted Rule Statements…
<xsd:element name=text type=xsd:string />
<xsd:element name=entityReference>
      <xsd:complexType>
The href association corresponds to the entity references of the posted Rule Statements…
<xsd:attribute name=href type=xsd:anyURI />
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
The XML tag <xsd:sequence> is used to define the attributes of a given element. In an XML Schema, <sequence> requires the elements that follow to appear in exactly the order defined by the schema within the corresponding XML document.
If the property com.corticon.ccserver.ensureComplianceWithServiceContract is:
*true, the Server will return the elements in the same order as specified by the service contract, even for elements created during rule execution and not present in the incoming message. Default value is true (ensure compliance and perform the sorting, if necessary)
*false, the Server may return elements in any order. Consuming applications should be designed accordingly. This setting results in slightly better Server performance.

VocabularyEntityNameType

<xsd:complexType name=VocabularyEntityNameType>
   <xsd:sequence>
A VocabularyEntityNameType contains zero or more VocabularyAttributeNames, but any VocabularyAttributeName may appear at most once per VocabularyEntityNameType…
<xsd:element name=VocabularyAttributeName
type=xsd:VocabularyAttributeNameType nillable=false minOccurs=0 />
Associations between VocabularyEntityNames are represented as follows. This particular association is optional and has one-to-one or many-to-one cardinality:
<xsd:element name=VocabularyRoleName type=tns:ExtURIType
minOccurs=0 />
This particular association is optional and has one-to-many or many-to-many cardinality:
<xsd:element name=VocabularyRoleName type=tns:ExtURIType
minOccurs=0 maxOccurs=unbounded />
  </xsd:sequence>
Every VocabularyEntityNameType will contain a unique id number – if an id is not included in the CorticonRequest element, the Server will automatically assign one and return it in the CorticonResponse
<xsd:attribute name=id type=xsd:ID use=optional />
The ExtURIType is used by all associations in messages having FLAT XML Message Style…
<xsd:complexType name=ExtURIType>
    <xsd:attribute name=href type=xsd:anyURI />
  </xsd:complexType>
</xsd:schema>

VocabularyAttributeNameTypes

Every attribute in a Corticon Vocabulary is one of five datatypes – Boolean, String, Date, Integer, or Decimal. Thus when entities are passed in a CorticonRequest or CorticonResponse, their attributes must be one of these five types. In addition, the ExtURIType type is used to implement associations between entity instances. The href attribute in an entity points to another entity with which it is associated.