Oracle SOA Suite 11g, Resequence messages in Mediator
For the resequencer to work we need to have 2 values in the source payload. The first one is a sequenceID, and the next one is a groupdID. The sequenceID will be used as identifier for the message itself. The groupID will be used to group the messages in which the resequencer will rearrange the messages based on the sequenceID. Different groups will have seperate processing, so they won’t have any influence on each other.
The mediator supplies us 3 types of resequencers :
- Standard Resequencer
- FIFO Resequencer
- BestEffort Resequencer
Let’s test the first one.
For this i created the next composite
In here i just map the input of the process 1on1 to the File adapter, which will store the input of the process on filesystem.
Interface of the composite
01 |
<? xml version = "1.0" encoding = "UTF-8" ?> |
02 |
< schema attributeFormDefault = "unqualified" |
03 |
elementFormDefault = "qualified" |
04 |
targetNamespace = "http://xmlns.oracle.com/Application1_jws/MyReSequence/ProcessEmployees" |
05 |
xmlns = "http://www.w3.org/2001/XMLSchema" > |
06 |
< element name = "process" > |
07 |
< complexType > |
08 |
< sequence > |
09 |
< element name = "empID" type = "string" /> |
10 |
< element name = "empType" type = "string" /> |
11 |
< element name = "empName" type = "string" /> |
12 |
</ sequence > |
13 |
</ complexType > |
14 |
</ element > |
15 |
< element name = "processResponse" > |
16 |
< complexType > |
17 |
< sequence > |
18 |
< element name = "result" type = "string" /> |
19 |
</ sequence > |
20 |
</ complexType > |
21 |
</ element > |
22 |
</ schema > |
Configuration of the sequencerDoubeclick the mediator component in the composite.
For the Resequence Level we can select ‘operations’ or ‘component’.
For Mediator components which only have 1 operation it doesn’t matter which one we select. For a Mediator component which consists of more then 1 operation and selecting the ‘component’ option means resequencing is applied to all operations in it. For this test we selected the ‘component’ option and used the ‘Standard’ mode.
Now we have several options to configurate the resequencer.
- Group – xpath expression to the field in the payload which the resequencer will use to group our incoming messages
- ID – xpath expression to the field which will uniquely identify our message
- Start – Start value of the ID in the incoming message
- Increment – Value which will be used for the increment of the id field in the upcoming messages
- Timeout – Time to wait before a following expected message arrives at the Mediator component
Test
To test this scenario i will use the following 3 messages.1 |
< soap:Envelope xmlns:soap = "http://schemas.xmlsoap.org/soap/envelope/" > |
2 |
< soap:Body xmlns:ns1 = "http://xmlns.oracle.com/Application1_jws/MyReSequence/ProcessEmployees" > |
3 |
< ns1:process > |
4 |
< ns1:empID >1</ ns1:empID > |
5 |
< ns1:empType >IT</ ns1:empType > |
6 |
< ns1:empName >Eric</ ns1:empName > |
7 |
</ ns1:process > |
8 |
</ soap:Body > |
9 |
</ soap:Envelope > |
1 |
< soap:Envelope xmlns:soap = "http://schemas.xmlsoap.org/soap/envelope/" > |
2 |
< soap:Body xmlns:ns1 = "http://xmlns.oracle.com/Application1_jws/MyReSequence/ProcessEmployees" > |
3 |
< ns1:process > |
4 |
< ns1:empID >2</ ns1:empID > |
5 |
< ns1:empType >IT</ ns1:empType > |
6 |
< ns1:empName >John</ ns1:empName > |
7 |
</ ns1:process > |
8 |
</ soap:Body > |
9 |
</ soap:Envelope > |
1 |
< soap:Envelope xmlns:soap = "http://schemas.xmlsoap.org/soap/envelope/" > |
2 |
< soap:Body xmlns:ns1 = "http://xmlns.oracle.com/Application1_jws/MyReSequence/ProcessEmployees" > |
3 |
< ns1:process > |
4 |
< ns1:empID >3</ ns1:empID > |
5 |
< ns1:empType >IT</ ns1:empType > |
6 |
< ns1:empName >Theo</ ns1:empName > |
7 |
</ ns1:process > |
8 |
</ soap:Body > |
9 |
</ soap:Envelope > |
If we trigger the process 3 times with the payloads as we describes and in the same sequence, the instances will all complete and write the files to filesystem in the same sequence.
We used the ‘Standard’ mode and selected empID for sequence-value and emptType for group-value, and the sequence should start with 1 and will increment by 1.
Now switch the last 2 messages in the sequence and see what happens. Since we’re trying to process and already processed message again we will get the next errormessage
1 |
The selected operation execute could not be invoked. |
2 |
An exception occured while invoking the webservice operation. Please see logs for more details. |
3 |
oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: oracle.tip.mediator.infra.exception.MediatorException: ORAMED-03003:[Storing Resequencer Group Failed]Unable to store Resequencer Group." oracle.tip.mediator.common.persistence.MediatorResequencerMessage, mediator InstanceId=E07531315F8511DFBFBF3B164F19FDA3, componentDn=default/MyReSequence!1.0/Mediator1, operation=execute, groupId=IT, sequenceId=1, status=0"Possible Fix:Unable to store Resequencer Group. Check your Database connection or check data |
For example
1 |
< soap:Envelope xmlns:soap = "http://schemas.xmlsoap.org/soap/envelope/" > |
2 |
< soap:Body xmlns:ns1 = "http://xmlns.oracle.com/Application1_jws/MyReSequence/ProcessEmployees" > |
3 |
< ns1:process > |
4 |
< ns1:empID >1</ ns1:empID > |
5 |
< ns1:empType >HR</ ns1:empType > |
6 |
< ns1:empName >Eric</ ns1:empName > |
7 |
</ ns1:process > |
8 |
</ soap:Body > |
9 |
</ soap:Envelope > |
After sending the second message (empID=3), you will notice the instance won’t complete. Because the resequencer expects an empID=2. In this case it will wait till this message arrives.
1 |
< soap:Envelope xmlns:soap = "http://schemas.xmlsoap.org/soap/envelope/" > |
2 |
< soap:Body xmlns:ns1 = "http://xmlns.oracle.com/Application1_jws/MyReSequence/ProcessEmployees" > |
3 |
< ns1:process > |
4 |
< ns1:empID >2</ ns1:empID > |
5 |
< ns1:empType >HR</ ns1:empType > |
6 |
< ns1:empName >Eric</ ns1:empName > |
7 |
</ ns1:process > |
8 |
</ soap:Body > |
9 |
</ soap:Envelope > |
Now use the last test message (empID=2) and see what happens.
Instance 30030 changes from Running to Completed. This is because it received the next message in the sequence (empID=2), and after that the instance 30030 (empID=3) could continue.
If we check the files on filesystem we also see (compair the datetime of the files) that the files are stored in the correct sequence.
Other Resequencers
Besides the ‘Standard’ resequencer wel also have the ‘FIFO’- and the ‘BestEffort’ resequencer.See this document to decide what resequencer suits best for your case.
Oracle SOA Suite 11g and the new Partitions feature
In the old school Oracle SOA Suite we had the functionality to create different domains in the BPEL Console to group our applications.
This functionality was gone in the 11g SOA Suite, and because it still was a wanted feature, Oracle reintroduced it as feature in the new Oracle SOA 11g Patchset2.
Now it’s called ‘Partitions’.
So let’s see how to manage them.
Go to the Enterprise Manager (http://localhost:7001/em), Farm_ > SOA > soa-infra (soa_server1).
Right mouseclick on soa-infra > Manage Partitions. Create the new partition. (SOA Partition 별, Composite count 알 수 있음)
The new partition should be added to the list (beneath the default partition).
JDeveloper
In JDeveloper we will create a simple SOA Composit application.
Deploy the new application and now in the wizard of the deployment when we select a server it gives us a new selectbox to select the newly created partition. By default it will use the ‘default’ partition.
Deploy the application and let’s go back to the console.
Now we will see the new deployed application in the list of the ‘test_partition’ partition.
Using antant-sca-mgmt.xml createPartition – Creates a partition in the SOA Infrastructure.
Location of the file :
1 |
< ORACL_MIDDLEWARE_HOME >/bin |
01 |
Buildfile: ant-sca-mgmt.xml |
02 |
[echo] oracle.home = E:\oraclehome\11g\middleware\Oracle_SOA1\bin/.. |
03 |
04 |
createPartition: |
05 |
[input] skipping input as property host has already been set. |
06 |
[input] skipping input as property port has already been set. |
07 |
[input] skipping input as property user has already been set. |
08 |
[secure-input] skipping secure-input as property password has already been set. |
09 |
[input] skipping input as property partition has already been set. |
10 |
[echo] oracle.home = E:\oraclehome\11g\middleware\Oracle_SOA1\bin/.. |
11 |
12 |
folderMgrTask: |
13 |
[java] calling FolderManager.initConnection(), m_host=localhost, m_port=8001, m_user=weblogic |
14 |
[java] Connecting to: service:jmx:t3://localhost:8001/jndi/weblogic.management.mbeanservers.runtime |
15 |
[java] connection initiated |
16 |
[java] folderMBean=oracle.soa.config:name=soa-infra,j2eeType=FolderLifecycleConfig,Application=soa-infra |
17 |
[java] Partition (my_ant_partition) is successfully created. |
18 |
19 |
BUILD SUCCESSFUL |
Weblogic
During start up managed servers from admin console result in Admin State instead of Running State (see the screenshot below). This issue comes up usually when Weblogic is unable to connect to infrastructure database. Usually this is happening when the infrastructure database's listener is not down after reboot or server configuration change. In Windows make sure oracle services are up and the database EM console is accessible
XSD
Introduction
Those who deal with data transfer or document exchange within or across organizations with heterogeneous platforms will certainly accept and appreciate the need and power of XML. I am not going to delve into the merits of XML. I will, however, address a simple but powerful schema concept called XSD or XML Schema Definition.
What Is a Schema?
A schema is a "Structure", and the actual document or data that is represented through the schema is called "Document Instance". Those who are familiar with relational databases can map a schema to a Table Structure and a Document Instance to a record in a Table. And those who are familiar with object-oriented technology can map a schema to a Class Definition and map a Document Instance to an Object Instance.
A structure of an XML document can be defined as follows:
We are specifically going to work with XML Schema Definitions (XSD).
What Is XSD?
XSD provides the syntax and defines a way in which elements and attributes can be represented in a XML document. It also advocates that the given XML document should be of a specific format and specific data type.
XSD is fully recommended by W3C consortium as a standard for defining an XML Document. To know more about latest information on XSD, please refer the W3C site (www.w3.org).
Advantages of XSD
So what is the benefit of this XSD Schema?
Case Study
ABC Corp. a fictitious software consultancy firm, which employs around 25 people, has been requested by its payroll company to submit employee information, which includes the Full Time and Part Time consultants, electronically in an XML format to expedite payroll processing.
The Payroll Company told ABC Corp. the following information will be needed for the Full Time and Part Time Employees.
Employee Information
Here is the actual XML document for the above information.
<?xml version="1.0" ?>
- <Employees xmlns="http://www.abccorp.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.abccorp.com/employee.xsd">
- <Employee>
<SSN>737333333</SSN>
<Name>ED HARRIS</Name>
<DateOfBirth>1960-01-01</DateOfBirth>
<EmployeeType>FULLTIME</EmployeeType>
<Salary>4000</Salary>
</Employee>
</Employees>
Here is the XML Schema for the above Employee Information
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN="xsd:string>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>
<xsd:element name="EmployeeType" type="xsd:string"/>
<xsd:element name="Salary" type="xsd:long"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Let's examine each line to understand the XSD Schema.
Schema Declaration
For an XSD Schema, the root element is <schema>. The XSD namespace declaration is provided with the <schema > to tell the XML parser that it is an XSD Schema.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
The namespace that references an XSD Schema is the W3C recommended version of XSD. The "xsd:" prefix is used to make sure we are dealing with XSD Schema, but any prefix can be given.
Element Declaration
"Element" is the important part of the schema because it specifies the kind of information. The following element declaration in our example is going to deal with Employee information.
<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">
An "element" declaration in XSD should have the following attributes.
name: This attribute specifies the name of an element. "Employee" in our example.
type: This attribute refers to Simple Type or Complex Type, which will be explained very soon in this article.
minoccurs: This attribute will specify how many elements at a Minimum will be allowed. The default is '0", which means it is an optional element.
Assume that minoccurs attribute carries a value of "1". This would mean the "Employee" element should be specified at least once in the XML document.
maxoccurs: This attribute will specify how many elements at a Maximum will be allowed in an XML document. Assume that maxoccurs attribute carries a value of "2". This would mean the "Employee" element should NOT be specified more than twice.
To summarize, let's say the minoccurs is "1" and maxoccurs is "2" for the "Employee" element. This means there should be atleast one instance of the "Employee" element in the XML document, but the total number of instances of "Employee" element shouldn't exceed two.
If you tried passing three instances of "Employee" element in the XML document, the XML parser will throw an error.
To allow the "Employee" element to be specified an unlimited number of times in an XML document, specify the "unbounded" value in the maxoccurs attribute.
The following example states that the "Employee" element can occur an unlimited number of times in an XML document.
<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">
Complex Type
An XSD Schema element can be of the following types:
In an XSD Schema, if an element contains one or more child elements or if an element contains attributes, then the element type should be "Complex Type"
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN="xsd:string>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>
<xsd:element name="EmployeeType" type="xsd:string"/>
<xsd:element name="Salary" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
The Employee element has SSN, Name, Date of Birth, Salary and Employee type, which are specified as child elements. As a result Employee Element must be defined as a Complex Type because there are one or more elements under Employee element.
xsd:sequence
The <xsd:sequence> specifies the order in which the elements need to appear in the XML document. This means the elements SSN, Name, DateOfBirth, EmployeeType and Salary should appear in the same order in the XML document. If the order is changed, then the XML parser will throw an error.
Simple Type
In an XSD Schema an element should be referred to as a Simple Type when you create a User Defined type from the given base data type.
Before going further into Simple Types, I would like to mention that XSD provides a wide variety of base data types that can be used in a schema. A complete description of the data types is beyond the scope of this article.
I would suggest reading at the following Web sites to learn more about data types.
Some of the base data types, which we used in the "Employee" element examples, are:
Knowing that Simple Type Elements can specify User-defined data types in XML Schema, the real question is how do we know where to use a specific Simple Type?
Let's take a look at the schema again.
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN="xsd:string>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>
<xsd:element name="EmployeeType" type="xsd:string"/>
<xsd:element name="Salary" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
Assume the Payroll processing company wants the social security number of the employees formatted as "123-11-1233".
For this we will create a new data type called "ssnumber".
The following is the code to accomplish the above requirement.
<xsd:simpleType name="ssnumber">
<xsd:restriction base="xsd:string">
<xsd:length value="11">
<xsd:pattern value="\d{3}\-\d{2}\-\d{4}"/>
</xsd:restriction>
</xsd:simpleType>
To start with, we should provide the name of the Simple Type, which is "ssnumber".
The restriction base specifies what is the base data type in which we derive the User Defined Data type, which is the "string" data type in the above example.
To restrict the social security number to 11 characters, we require the length value to be "11".
To ensure the social security number appears in the "123-11-1233" format, the pattern is specified in the following format.
<xsd:pattern value="\d{3}\-\d{2}\-\d{4}"/>
To explain the pattern,
\d{3} specifies that there should be three characters in the start. Followed by two characters after the first "-" and finally followed by four characters after the second "-".
Incorporating Simple Types into Schema
Now that we know what Simple Type means, let us learn how to effectively incorporate Simple Type into an XSD Schema.
First of all, Simple Types can be global or local.
Let's first look at global usage of Simple Type Element "ssnumber".
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN= type ="xsd:ssnumber>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>
<xsd:element name="EmployeeType" type="xsd:string"/>
<xsd:element name="Salary" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="ssnumber">
<xsd:restriction base="xsd:string">
<xsd:length value="11">
<xsd:pattern value="\d{3}\-\d{2}\-\d{4}"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
In the above example, the child element name "SSN" of parent element "Employee" is defined as user defined data type "ssnumber".
The Simple Type element "ssnumber" is declared outside the Employee element, which means if we have to define another element, say for ex. "Employer" inside the <xsd:schema>, then the "Employer" element can still make use of the "ssnumber" data type if it's needed.
Let's examine a different case where the Simple Type element "ssnumber" will be specific to Employee, and it is not going to be needed elsewhere at all. Then the following schema structure accomplishes this.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN="xsd:string>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="11">
<xsd:pattern value="\d{3}\-\d{2}\-\d{4}"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>
<xsd:element name="EmployeeType" type="xsd:string"/>
<xsd:element name="Salary" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
In the above example, all restrictions such as max length, pattern and base data type are declared inline, and it immediately follows the SSN element.
Understanding Schema Flexibility
So far we have seen how to create a schema by:
a. Declaring and Using Complex Element Type
b. Declaring and Using Simple Element Type c. Understanding Global scope and Local scope of a given element I will now explain the flexibility XSD Schema can provide by extending our schema example.
Let's validate further by adding a "FullTime" or "PartTime" Employee Type element.
To provide the validation, we should create a Simple Element Type called "emptype".
<xsd:simpleType name="emptype">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="fulltime"/>
<xsd:enumeration value="parttime"/>
</xsd:restriction>
</xsd:simpleType>
The above schema will successfully create a Simple Type element with base type as "string" data type. The enumeration values are specified in enumeration attributes, which will basically restrict within two values. The enumeration attributes in an XSD Schema provides the ability to define an element in such a way that it should fall between the values given in the enumeration list.
Let us incorporate emptype Simple Type element in our main Employee schema.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN="xsd:ssnumber>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>
<xsd:element name="EmployeeType" type="xsd:emptype"/>
<xsd:element name="Salary" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="ssnumber">
<xsd:restriction base="xsd:string">
<xsd:length value="11">
<xsd:pattern value="\d{3}\-\d{2}\-\d{4}"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="emptype">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="fulltime"/>
<xsd:enumeration value="parttime"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
In the above example, the child element name "EmployeeType" of parent element "Employee" is defined as user defined data type "emptype".
The Simple Type element "emptype" is declared outside the Employee element which is global to elements that fall under <xsd:schema>
So we have defined two simple element types: one is emptype, which basically restricts the value within two enumerated values "fulltime" or "parttime". And another is "ssnumber" which restricts the length of the value to 11 and it should be of "111-11-1111" pattern.
I highlighted the words "enumerated" "length" and "pattern" to emphasize that those words are referred to as Facets.
In XSD Schema, facets provide the flexibility to add restriction for a given base data type. In our examples above, the base data type specified is "string".
Similarly, facets are available for other data types like "int". A few facets available for "int" data type are Enumerated, Minexclusive, Mininclusive, and Pattern.
Let's consider a new requirement. The payroll company wants to process tax information, so they want the employee information which is listed above plus the employee's state and zip code information. All the information should be under the separate header "EmployeeTax".
The above requirement compels us to restructure the schema.
First we will break down the requirement to make it simple.
a. Payroll Company wants all the information listed under "Employee" element.
b. Payroll Company wants state and zip of the given Employee. c. Payroll company wants (a) and (b) in a separate header "EmployeeTax" Fortunately XSD Schema supports object-oriented principles like Inheritance hierarchy. This principle comes handy in our requirement.
The following structure can quite easily accomplish the above requirement.
<xsd:complexType name="EmployeeTax"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexContent>
<xsd:extension base="xsd:Employee">
<xsd:sequence>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zipcode" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
In the above code, we started with the name of the Complex Type, which is "EmployeeTax".
The following line is very important. It tells the XML Parser that some portion of EmployeeTax content is getting derived from another Complex Type.
<xsd:complexContent>
To refresh our memory, in simple element type definitions, we used restriction base, which mapped to base data types. In the same way, we need to specify the restriction base for the complex content. The restriction base for complex content should logically be another Complex Type. In our example it is "Employee".
<xsd:extension base="xsd:Employee">
Once the extension base has been defined, all the elements of the "Employee" element will automatically inherit to EmployeeTax Element.
As part of the business requirement, the state and zip code elements are specified which completes the total structure for EmployeeTax Element.
Referencing External Schema
This feature is very useful in situations where one schema has functionality that another schema wants to utilize.
Take a case where the payroll company for ABC Corp. needs some information about the Employers, such as EmployerID and PrimaryContact in a separate XML document.
Assume EmployerID format is the same as Employee SSN format. Since we have already defined the validation for Employee SSN, there exists a valid case for using the Employee schema.
The first step in using different schema is to "include" the schema.
To include the schema, make sure the target namespace is the same as your current working location.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.abccorp.com">
<xsd:include schemaLocation="employee.xsd"/>
<xsd:element name="Employer"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref ="ssnumber"/>
<xsd:element name="PrimaryContact"
type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Please note the include statement, which references the schema location. Make sure the employee.xsd file exists in the same target namespace location.
Once included, the "Employer" element references the ssnumber global element in the same manner as it had been declared within the document itself. Then an additional primary contact element, which is specific to "Employer" element, is defined after the ssnumber element reference.
Annotations
Comments have always been considered a good coding convention. XSD Schema provides a commenting feature through the <Annotation> element.
The <Annotation> element has 2 child elements.
<documentation> element provides help on the source code in terms of its purpose and functionality.
<appinfo> element provides help to the end users about the application.
The following schema describes the usage of the Annotation element.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN="xsd:ssnumber>
<xsd:annotation>
<xsd:documentation>
The SSN number identifies each employee of ABC CORP
</xsd:documentation>
<xsd:appInfo>
Employee Payroll Info
</xsd:appInfo>
</xsd:annotation>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>
<xsd:element name="EmployeeType" type="xsd:emptype"/>
<xsd:element name="Salary" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="ssnumber">
<xsd:restriction base="xsd:string">
<xsd:length value="11">
<xsd:pattern value="\d{3}\-\d{2}\-\d{4}"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="emptype">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="fulltime"/>
<xsd:enumeration value="parttime"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
Conclusion
I tried to cover a few interesting features of XSD Schema. But there is a whole lot of information about XSD schema in
|
※ 참고사이트 : http://anatech-oracle.blogspot.kr/
'SOA' 카테고리의 다른 글
Configuring Transaction timeout in BPEL (0) | 2014.10.20 |
---|---|
How to run RDA for weblogic (0) | 2014.09.24 |
Oracle SOA 11g - Configure transaction timeout for BPEL (0) | 2014.09.17 |
SOA WSDL Caching in SOA Server && MDS Cache referesh (0) | 2014.09.16 |
SOA 11g Performance Tuning (0) | 2014.09.16 |