Getting started-with-oracle-so a-iv


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Getting started-with-oracle-so a-iv

  1. 1. Getting Started with Oracle SoA INTRODUCTION TO WSDL (WEB SERVICE DESCRIPTION LANGUAGE) Lab#4 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 Beginner’s Guide for Oracle SoA. The document focuses on WEB SERVICE DESCRIPTION LANGUAGE. Join our professional training program and learn from experts. History: Version Description Change Author Publish Date 0.1 Initial Draft Shiva Kant Pandey 21th Aug 2012 0.1 Review#1 Amit Sharma 29th Aug 2012 Page 1
  2. 2. PART III INTRODUCTION TO WSDL(WEB SERVICE DESCRIPTION LANGUAGE) WITH THE HELP OF PROJECT WSDL : The Web Services Description Language is an XML-based interface description language that is used for describing the functionality offered by a web service. A WSDL description of a web service (also referred to as a WSDL file) provides a machine-readable description of how the service can be called, what parameters it expects, and what data structures it returns. KEY ELEMENTS USED INSIDE WSDL : 1. Types 2. Message 3. Port Type 4. Binding 5. service 6. Partner Link Type For better understanding consider a basic Project " ProcessNumbers" & focus on following points -: • ABSTRACT WSDL • COMPOSITE XML • BPEL PROCESS COMPONENT • BPEL PROCESS • COMPILATION & DEPLOY • CONCRETE WSDL • TEST • INSTANCES 1. BASIC PROJECT ON "PROCESSNUMBERS" Step 1: Create new project New --->All Technologies--->SOA Tier --->SOA project --->OK ---> Project Name (ProcessNumbersProject) ---> ADF Business Component---> SOA--->Next --> Empty Composite ---> Finish Now you can see your project on left pane with all its contents so as we need to start our project with XSD . Step 2 : Create a new xsd file under project Right click on xsd--> file name(ProcessNumbers.xsd) --> Target Namespace(> prefix (psobj) -->ok Now created successfully ProcessNumbers.xsd as shown in figure : Page 2
  3. 3. • target Namespace • Prefix taken psobj • Take two elements 1) ProcessNumbersRequest 2) ProcessNumbersResponse • Define their complex types shown in blue boxes . • save xsd. HINT : Here in example consider two numbers i.e NumberA & NumberB & then we have to perform ADD operation . Page 3
  4. 4. Step 2: Click on Design Mode & u can see xsd in a well designed manner as shown in figure: Step 3 : To create WSDL file: Click NEW--->All Technologies --->Web Services --->WSDL Document ---> OK Page 4
  5. 5. Page 5
  6. 6. Step 4 : Fill all required blanks WSDL Name(ProcessNumbers) --->Directory name(leave as it is but delete up to your project name i.e Process numbers ) ----> Targetnamespace(give target name space but use wsdl in place of schema) ---> Create port type (ProcessNumbersInterface) ---> Select Service Style(Document) ----> OK . Service Style is mainly of two types : 1) Document 2)RPC • Document: the content of <soap:Body> is specified by XML Schema defined in the <wsdl:type> section. It does not need to follow specific SOAP conventions. In short, the SOAP message is sent as one "document" in the <soap:Body> element without additional formatting rules having to be considered. Document style is the default choice. • RPC: The structure of an RPC style <soap:Body> element needs to comply with the rules specified in detail in Section 7 of the SOAP 1.1 specification. According to these rules, <soap:Body> may contain only one element that is named after the operation, and all parameters must be represented as sub-elements of this wrapper element. Step 5: Shown below is Abstract WSDL File , in wsdl file <definitions></definitions> is the root element of wsdl schema . Page 6
  7. 7. • Target Namespace • tns is prefix of targetnamespace Elements Used In WSDL are : • TYPES: The types element encloses data type definitions that are relevant for the exchanged messages. For maximum interoperability and platform neutrality, WSDL prefers the use of XSD as the canonical type system, and treats it as the intrinsic type system. • MESSAGE: Inside Message we write whatever information is requested by service consumer & What response needed from service provider . These messages are transported through transporting medium example HTTP with SOAP protocol. Message element consists of PART name & element & part is a partition of message & there should be n number of parts inside a message. Messages should be one or more than one. • PORT TYPE : It is a web service interface port type defines interface , operation , operation , input & output . Step 6: Import ProcessNumbers.xsd inside <xsd:schema> as shown & keep this schema inside wsdl type. Step 7: Page 7
  8. 8. write message name & its part name & part element . note : Part element is prefixed So never forget to register its name space as shown below: Step 8: Mention its port type as shown below • Write name of Port type i.e "ProcessNumbersInterface" • we are Adding two numbers hence we choose ADD as its operation. • Write its input & output with prefix tns. Finally Save WSDL file by clicking save button Step 9: Click on Design Mode & see that relationship between Messages & port type. Page 8
  9. 9. Step 10: To create BPEL Process Click on composite .xml Step 11: This composite .xml is partitioned into three sections 1. Exposed Services 2. Components 3. External refrences Now right click on component section and choose BPEL Process. Page 9
  10. 10. Step 12: Fill all its blank spaces & browse wsdl file by clicking its icon Note : Here choose Template " Base on a WSDL " means we already have a wsdl file . In our Next Projects we will create wsdl file directly from template by choosing different options these are: Page 10
  11. 11. Click OK. Page 11
  12. 12. Step 13: Now observe Exposed Service as ProcessNumbersService and BPEL component ProcessNumbersProcess Step 14 : Cick on source mode at bottom & see the composite xml as shown below Page 12
  13. 13. Step 15: Again go to design mode of composite .xml & doubleclick on here Step 16: This window is ProcessNumbersProcess.bpel window & here we will create our logics & conditions by using Component Palette So here we have again three sections so first section is a process number service section or we can say service section , middle section is BPEL process section which works as mediator & third section is for reference section & cover it on latter examples. Page 13
  14. 14. Step 17: Drag assign activity from component palette & put between receive input & reply output. Right click on Assign activity & select edit --> General--> Name(Assign Result) Click on Copy Rules & Explore output variable & then result integer drag this expression icon into Result element & a new window prompt as shown below: Page 14
  15. 15. select Number A ---> click Insert Into Expression ----> Plus Sign (+) --->select Number B ---> Click Insert Into Expression . Now Click OK. Click OK Page 15
  16. 16. Step 18: Compile by clicking compile icon & see below that build succesfull , if there is an error make correction then again compile & diagnosis build Page 16
  17. 17. Page 17
  18. 18. Step 19 A : Deploy project by clicking Process Numbers Project . Step 19B : click Deploy to Application server ---> Next Page 18
  19. 19. Step 19 C: mark these fields & click to Next Step 20 : Start Server First as shown below : Click on Start /Stop Weblogic servers Mark Admin Server With SOA & EM then click START wait for few minutes Page 19
  20. 20. Server is now running Step21: Select your application server click Next Step 22: Looking up for soa server .. Page 20
  21. 21. Step23: Select admin server & click Next. Click Finish. Step 24 : Click on Browser icon shown below: Page 21
  22. 22. Step 25: Start your enterprise manager by writing url http: //localhost:7001/em/ Note : Here localhost is application server & 7001 is a port in which enterprise manager is running. Step 26 : Login using credentials User Name :weblogic Password : welcome1 click on login Step 27: We have successfully login inside Enterprise manager 11g (Farm_dev_soa) we can clearly observe here that admin server is up & all deployment status is also up it means that our admin server is running . Now In left pane of window under Farm_dev_soa click on SOA radio button now again expand & under default we can easily see all the deployed projects. Click twice on Process Numbers Project . Page 22
  23. 23. Step 28: Observe that all information regarding to Process Numbers Project is given Running instances 0 means that yet we have not tested any instance. Total 0 Project Status Active Now click on Browser tab Page 23
  24. 24. Step 29 : Click on WSDL URL Step 30: Now it is a Concrete WSDL , Right click on page & select View Page Source Now we can see full Concrete WSDL & this wsdl contains Binding & service information additionally. Page 24
  25. 25. Binding simply means that packaging message in packet with SOAP protocol again a question arises that what is soap protocol ? SOAP Protocol : SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks. It relies on XML Information Set for its message format, and usually relies on other Application Layer protocols, most notably Hypertext Transfer Protocol(HTTP) or Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission. Copy location address & paste in browser URL & now get the ABSTRACT WSDL & observe it . Page 25
  26. 26. NOTE: This abstract wsdl is similar to prior abstract wsdl which we had created in jdeveloper environment. Now Copy the schema location of imported xsd & observe it . Step 31: Click on TEST & create first instance or first test. Step 32: Scroll down page & observe Operation : ADD Request: Receive Inputs Response: Reply output This is a tree view we can also see it as XML view . Page 26
  27. 27. Now Insert Number A =5 & Number B = 10 Click on Test Web Service & get Result =15 as shown below Step 33: Click on Launch Flow Trace Page 27
  28. 28. Click on ProcessNumbersProcess & see the instance of process number process. Here we can Audit Trail , Flow. Sensor values, Faults. Step 34 : Click on Flow View flow diagram of process numbers process Page 28
  29. 29. Step 35: Click on Receive input & observe BPEL instance in xml Page 29
  30. 30. Step 36: Similarly click on Assign result in flow diagram & observe BPEL instance in xml Step 37: Similarly click on Reply Output Step 38: Click on Faults & check it. Page 30
  31. 31. Step 39: Now again double click on ProcessNumbersProcess project on left pane & observe that now after first test it created Instance with its instance id & instance state. Now since we have completed our test & wanted to exit from enterprise manager , Click on ShutDown Tab & then LogOut. Step 40 : Stop Admin server if don't want to further deploy any project Click Start/stop weblogic servers ----> mark on Admin Server radio ---> Stop Page 31