1. Getting Started with Oracle SoA
BASIC CONCEPT OF ORACLE SOA Lab#3
BISP is committed to provide BEST learning material to the beginners and
advance learners. In the same series, we have prepared a complete end-to end
Hands-on Beginner’s Guide for Oracle SoA. The document focuses on basic
keywords, terminology and definitions one should know before starting Oracle
SoA. Join our professional training program and learn from experts.
Version Description Change Author Publish Date
0.1 Initial Draft Shiva Kant Pandey 21th Aug 2012
0.1 Review#1 Amit Sharma 29th
www.bisptrainigs.com www.hyperionguru.com Page 1
2. PART III : EXAMPLES ON XSD
How to use following in xsd:
• Block = #all
Below are the examples we are going to use
2. Science Student.xsd
Also learn how to generate XML from XSD.
EXAMPLE 1. Student. XSD
Step 1: Create a new xsd file under project
click xsd--> file name --> Target Namespace-->prefix -->ok
now created successfully Student.xsd as shown in figure
www.bisptrainigs.com www.hyperionguru.com Page 2
3. Step 2: After creating new xsd i.e student .xsd it can be easily seen under
project under xsd as shown
• Prefix used is stdobj.
• Registered namespace
• Target namespace is shown under registration .
• Now start writing xml in xsd i.e
<xsd:element name ="Student" type="StudentType"></xsd:element>
In this statement we have defined Student as element &
stdobj:StudentType as its type.
Here stdobj is prefix & is used so that parser can identified uniquely each
• Here StudentType is ComplexType xsd & so it contains a group of elements
(Name, Number, Email, Lang1Marks,Lang2 Marks,Lang3MArks ) & these
elements are again defined by their types ex. string , integer.
• All this structure comes under xsd schema.
www.bisptrainigs.com www.hyperionguru.com Page 3
4. Step 3: Click on Design Mode & see whatever structured
Step 4 : How to convert this Student.xsd into xml form .
click on NEW--->All Technologies--->XML --->Xml Document From Xml
• Choose XML file name examlpe StudentDoc.xml
www.bisptrainigs.com www.hyperionguru.com Page 4
5. • Browse student.xsd file
Click on Browse tab
Now select location then choose Student.xsd & then ok .
www.bisptrainigs.com www.hyperionguru.com Page 5
7. • Check Target Namespace
• Check Root Element
• depth should be 3
• select UTF-8 encoding
• finally click finish.
After finish click xml will generate automatically. So this xml is example of
NOTE: Similarly later we will create xml from ScienceStudent .xsd &
ArtStudent .xsd .
Step 5: Create new ScienceStudent.xsd by clicking
Right click xsd--->choose New --->select File Name --> select Target Namespace-->
Prefix---> OK .
www.bisptrainigs.com www.hyperionguru.com Page 7
8. NOTE :
1) Target Namespace should be same for each xsd under same project .
2) prefix will change ex: scobj
www.bisptrainigs.com www.hyperionguru.com Page 8
9. Step 6: Create ScienceStudent.xsd here & also include Student.xsd as shown
Note: There are two operations include & import .
• Include is used when we have to include any xsd into other xsd under same project
under same xsd for example student.xsd is included by
ScienceStudent.xsd under similar project or in similar schema location.
• Import is used when we have to include any xsd into other xsd under different
& hence we need to either copy the xsd to be imported from its physical
location or by ORA MDS (oracle meta data system repository) we will
discuss this import in our next docs later.
Here in figure we have simply included the Student.xsd into ScienceStudent.xsd
by using following syntax
Now use this Student.xsd elements in ScienceStudent.xsd inside its
Syntax used is Complex type --> ComplexContent--> extension base (include
here student.xsd with its new prefix scobj ) and under Extension we can use we
can use <xsd:sequence> & inside it elements .
www.bisptrainigs.com www.hyperionguru.com Page 9
10. Step 7: Click on Design Mode.
Step 8: Expand Science StudentType
www.bisptrainigs.com www.hyperionguru.com Page 10
11. Step 9: Create XML Document from XML Schema as discussed before
NEW--->All Technologies ---> XML---->XML document From Xml Schema--->Ok
www.bisptrainigs.com www.hyperionguru.com Page 11
12. click finish
Now xml document created automatically from xml schema.
Here notice that this xml is included student xml under Science Student xml.
Step 10 : Create new xsd i.e Art Student.xsd
Right click on xsd under project ---> New--->All Technology --->XML---> Xml
schema --->ok---> File Name (ArtStudent.xsd) ---> Target namespace (similar)
----> Prefix(artobj)---> OK
www.bisptrainigs.com www.hyperionguru.com Page 12
13. • Here we have referred student.xsd into ArtStudent.xsd & not extending base just
• Also include Student.xsd
www.bisptrainigs.com www.hyperionguru.com Page 13
14. Step 11: Go to Design Mode
• Referenced xsd type .
• Included xsd
Step 12: Create xml document from xml schema as discussed earlier.
www.bisptrainigs.com www.hyperionguru.com Page 14
15. Note here since student type is referred & not extended as base & hence
student elements are inside student & this student is inside art student.
www.bisptrainigs.com www.hyperionguru.com Page 15
16. Use of Abstract:
• If abstract = true then no one can use that xsd further i.e it restricts vise versa for
USE OF BLOCK #ALL :
www.bisptrainigs.com www.hyperionguru.com Page 16
17. Block# all blocks to further sharing or inclusion
www.bisptrainigs.com www.hyperionguru.com Page 17