Está en la página 1de 19

Getting Started with Oracle SoA

BASIC CONCEPT OF ORACLE SOA Lab#2

Description:
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 Beginners 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.

History:
Version 0.1 0.1 Description Change Initial Draft Review#1 Author Shiva Kant Pandey Amit Sharma Publish Date 21th Aug 2012 29th Aug 2012

www.bispsolutions.com Page 1

www.bisptrainigs.com

www.hyperionguru.com

Objective : Basic course required for SOA INTRODUCTION What is XSD ? Structure of XSD Target namespace Attribute of xsd: schema xmlns registration xsd element type xsd complex type Reusing Complex Type objects TO XSD (Xml Schema Definition)

XSD : " The XML Schema Definition (XSD) is a reference library that provides an API for use with any code that examines, creates or modifies W3C XML Schema (standalone or as part of other artifacts, such as XForms or WSDL documents). XSD is a library that provides an API for manipulating the components of an XML Schema as described by the W3C XML Schema specifications, as well as an API for manipulating the DOM-accessible representation of XML Schema as a series of XML documents, and for keeping these representations in agreement as schemas are modified."

To create a New Project on Oracle JDeveloper 11g step wise procedure is mentioned below : [Step 1] : Start your graphical desktop window & it will appear as shown in figure

www.bispsolutions.com Page 2

www.bisptrainigs.com

www.hyperionguru.com

Step2 : Double click on oracle Jdeveloper icon .

Step 3: After double click Select Role window will appear choose Default Role & it will enable all technologies . Click OK button .

Step 4: Now successfully we have entered into Oracle JDeveloper page . Click on this new button icon which is shown in left corner of page & a New Gallery window will appear on same page.
www.bispsolutions.com Page 3 www.bisptrainigs.com www.hyperionguru.com

Click on : Current Project Technologies ---> Applications --->SOA Application ---> click OK.

Step 5: Select Application Name & fill on blank . I have taken SOAApplicaton as Application Name & click Next Tab.

www.bispsolutions.com Page 4

www.bisptrainigs.com

www.hyperionguru.com

Step 6:Now it will prompt for Project Name select project name as your own choice ex- Project1. Select ADF Business Components ---> SOA---> Next .

www.bispsolutions.com Page 5

www.bisptrainigs.com

www.hyperionguru.com

Note: There are various Application Development Framework (ADF) to develop your application so choose as per need. Step 7: To configure SOA Setting select Empty Composite ---> click Finish so successfully created Project1 as new project .

www.bispsolutions.com Page 6

www.bisptrainigs.com

www.hyperionguru.com

==> Inside red box observe SOAApplication as Application Name & Project1 under Project is created.

TO CREATE .XSD FILE STEPWISE PROCEDURE IS MENTIONED BELOW So far discussion was to create new project now under project1 start to create new Book type .xsd file : Step1: Right click on xsd ---> New .

www.bispsolutions.com Page 7

www.bisptrainigs.com

www.hyperionguru.com

Step 2: Click All Technologies ---> XML --->XML Schema ---> OK

Note: We are going to create XML schema in .xsd file .

www.bispsolutions.com Page 8

www.bisptrainigs.com

www.hyperionguru.com

Step 3: Now Enter details of your new file ex- Book.xsd or Book Schema.xsd & click OK.

Here point to consider is 1) Target Namespace 2) Prefix Target Namespace : This is used for unique identification of each element in XML by parser. Prefix: Prefix is shortcut of Namespace . Take bobj as prefix for BookType xsd file, here 'b' represent Book type & 'obj' represents Object .

Step 4: On left Pane observe BookSchema.xsd is created under xsd . On right side of left pane is a predefined XSD schema. 1st circle represents start of schema & 2nd circle end of schema . In xsd:schema xsd is used here as prefix which is generated by w3 organization & it is a shortcut of xmlns:xsd="http://www.w3.org/2001/XMLSchema". namespace

www.bispsolutions.com Page 9

www.bisptrainigs.com

www.hyperionguru.com

So in this schema we observe Target namespace now we can see the structure in which they have taken "exampleElement" as name of element. At the bottom inside green box there are three options 1. Design mode: designed . In design mode we can see what we have

2. Source mode: In source mode we create schema of xml in xsd as shown in above figure.
www.bispsolutions.com Page 10 www.bisptrainigs.com www.hyperionguru.com

3. History: We can see the history of schema created. Step 5: Design Bookschema.xsd structure inside parent schema.

xmlns:xsd="http//:www.w3.org/2001/XMLSchema" is namespace which describes the schema of xml by w3 organization & provide standard prefix xsd to all elements inside schema. xmlns:bobj="http//:www.oracle.com/schema/Book" registration of target namespace. ListOfBookType is a complextype element Complextype xsd are those in which one or more than simple elements are nested.so in this example there are three complex types . So start from first complex type i.e Book Type as shown in figure with purple box. <xsd:sequence> means that all simple elements inside complex type arranged in a sequence .
www.bispsolutions.com Page 11 www.bisptrainigs.com www.hyperionguru.com

this

is

ListOfBooks is a XSD element & its type is ListOfBookType

So this BookType contains name ,author,price inside it with their types. Type plays important role in xsd it gives meaning to the element name . 1. name is "xsd: string" type 2. author is "xsd: string" type 3. Price is "xsd:decimal " type

Similarly Subject Type contains three elements in well defined sequence

Here we have taken type as "bobj:BookType" because each subject contains BookType structure[name, author,price] & hence there are three book inside subjectType . In design mode it looks as shown below

www.bispsolutions.com Page 12

www.bisptrainigs.com

www.hyperionguru.com

Similarly for ListOfBooktype which contains "Book" as its element & type of book is "bobj:SubjectType"

So Book comes under list of books type & subject type under book Design mode:

www.bispsolutions.com Page 13

www.bisptrainigs.com

www.hyperionguru.com

Finally ListOfBooks element contain ListOfBookType. Step 6: In this step we notice following points:

1. what is minOccurs , maxoccurs, nillable ? 2. what is annotation ?

So let us see the structure in source mode :

www.bispsolutions.com Page 14

www.bisptrainigs.com

www.hyperionguru.com

minoccurs & maxoccurs means how many number of times this name element occurs. 1. Example
/>

1<author occurs<1 meaning author will occur once only.

2. Example
/>

means minimum occurrence of Book is one & maximum it can occur unbounded i.e infinite times.
www.bispsolutions.com Page 15 www.bisptrainigs.com www.hyperionguru.com

NILLABLE These are of two types: 1) TRUE 2) FALSE

nillable="true" means that value of element should be nil. nillable="false" means that value of element should not be nil i.e element must have value.

ANNOTATION annotation are of two types 1) Documentation 2) appinfo . As shown below in source mode

www.bispsolutions.com Page 16

www.bisptrainigs.com

www.hyperionguru.com

1) Documentation : In computer industry , documentation is the information provided to a customer or other user about a product or the process of preparing it.

2) Appinfo : The appinfo element specifies information to be used by the application. the element must go within an annotation element. Let us see how Design looks :

www.bispsolutions.com Page 17

www.bisptrainigs.com

www.hyperionguru.com

It represents minoccurs="1" & max occur="unbounded" .

www.bispsolutions.com Page 18

www.bisptrainigs.com

www.hyperionguru.com

www.bispsolutions.com Page 19

www.bisptrainigs.com

www.hyperionguru.com

También podría gustarte