งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

Session 5: Case Study Session 5 - 1 Dr. Nipat Jongsawat.

งานนำเสนอที่คล้ายกัน


งานนำเสนอเรื่อง: "Session 5: Case Study Session 5 - 1 Dr. Nipat Jongsawat."— ใบสำเนางานนำเสนอ:

1 Session 5: Case Study Session 5 - 1 Dr. Nipat Jongsawat

2 หัวข้อนำเสนอ Session 5 - 2 เนื้อหานำเสนอในเชิงปฏิบัติการ โดยแบ่งเป็น 4 หัวข้อดังนี้ –กรณีศึกษาที่ 1 การพัฒนาด้วยจาวา อาร์เอ็มไอ –กรณีศึกษาที่ 2 การพัฒนาแบบเว็บเซอร์วิซในสภาพแวดล้อมเดียว –กรณีศึกษาที่ 3 การเรียกใช้ Service ต่าง platform –กรณีศึกษาที่ 4การใช้ BPEL ในการควบคุมกิจกรรมทางธุรกิจ อ้างอิงเอกสารประกอบการฝึกอบรม Service-Oriented Architectureกรณีศึกษาที่ใช้ในส่วนปฏิบัติการ (Lab Book) ที่มี Dr. Nipat Jongsawat

3 กรณีศึกษาที่ 1 การพัฒนาด้วยจาวา อาร์เอ็มไอ SOA Lab 1 : Java RMI Session 5 - 3 Dr. Nipat Jongsawat

4 หัวข้อนำเสนอ รายละเอียดกรณีศึกษา กรณีศึกษาย่อยที่ 1.1 : การใช้งาน RMI กรณีศึกษาย่อยที่ 1.2 : การเพิ่มเติม RMI Service กรณีศึกษาย่อยที่ 1.3 : การเรียกใช้ RMI ข้าม เครื่อง Session 5 - 4 Dr. Nipat Jongsawat

5 กรณีศึกษา : ระบบการสั่งสินค้า ลูกค้าทำการป้อนข้อมูลการสั่งสินค้าเข้าระบบ ระบบทำการตรวจสอบ – มีสินค้าเพียงพอ – ลูกค้ามีเครดิตเพียงพอ ระบบทำการคำนวณราคา ตัดจำนวนสินค้า และ ปรับยอดเครดิตของลูกค้า Session 5 - 5 Dr. Nipat Jongsawat

6 Session 5 - 6 Dr. Nipat Jongsawat

7 กรณีศึกษาย่อยที่ 1.1 : การใช้งาน RMI Session 5 - 7 OrderInventory Client “Place Order” “Check Item Availability” “Check Item Cost” “Check-out Stock” Dr. Nipat Jongsawat

8 Session 5 - 8 Dr. Nipat Jongsawat

9 สิ่งที่จะต้องทำ ทำความคุ้นเคยกับเครื่องมือ NetBeans Open Project RMI_CASE1 ทำการ Run InventoryServer ทำการ Run OrderServerLab ทำการทดสอบระบบโดยการ Run ClientRMI – ป้อนรหัสลูกค้า (001) – ป้อนรหัสสินค้า (002) – ป้อนจำนวน (5) Session 5 - 9 Dr. Nipat Jongsawat

10 กรณีศึกษาย่อยที่ 1.2 : การเพิ่มเติม RMI Service Session 5 - 10 OrderInventory Client “Place Order” “Check Item Availability” “Check Item Cost” “Check-out Stock” Customer Credit “Get Customer Status” “Get Customer Credit” “Decrease Customer Credit” Dr. Nipat Jongsawat

11 Session 5 - 11 Dr. Nipat Jongsawat

12 การเรียกใช้ Java Method และ RMI CheckAvailabilityResult = InventoryServer.getItemAvailability(catID); try { CheckAvailabilityResult = InventoryServer.getItemAvailability(catID); } catch (Exception ex) { } Session 5 - 12 OrderInventory Dr. Nipat Jongsawat

13 การทำงานของ RMI : Service Registering Session 5 - 13 Order Inventory Registry Register: “InventoryServer” Skeleton Dr. Nipat Jongsawat

14 การทำงานของ RMI : Service Binding Session 5 - 14 Order Inventory Registry Lookup: “InventoryServer” SkeletonStub Dr. Nipat Jongsawat

15 การทำงานของ RMI : Service Invoking Session 5 - 15 Order Inventory Registry CheckAvailabilityResult = InventoryServer.getItemAvailability(catID); SkeletonStub Dr. Nipat Jongsawat

16 สิ่งที่จะต้องทำ Open Project RMI_CASE2 – มี Interface สำหรับ CustomerCreditService ทำการ แก้ไข OrderServerLab เพื่อเรียกใช้ CustomerCreditService – เพิ่มรายละเอียดของเครื่องและ port ของ Registry ที่มี CustomerCreditService String CustomerCreditServerAddress = “127.0.0.1”; Registry CustomerCreditServerRegistry; String CustomerCreditServerPort = “3234 ”; Session 5 - 16 Dr. Nipat Jongsawat

17 สิ่งที่จะต้องทำ – ทำการเรียกใช้ Registry เพื่อจัดทำ Proxy ที่ใช้ใน การ Binding กับตัว Service CustomerCreditServerRegistry = LocateRegistry.getRegistry(CustomerCreditServerAddress, (new Integer(CustomerCreditServerPort).intValue()); CustomerCreditServer= (CustomerCreditService)(CustomerCreditServerRegistry.lookup("CustomerServer" )); Session 5 - 17 Dr. Nipat Jongsawat

18 สิ่งที่จะต้องทำ – ทำการเรียกใช้ Service try { CheckExistingCustomerResult = CustomerCreditServer.getCustomerStatus(custID); System.out.println("CheckExistingCustomer=“ + CheckExistingCustomerResult ); } catch (Exception ex) { } try { CheckCreditResult = CustomerCreditServer.getCredit(custID); System.out.println("CheckCreditResult = “ + CheckCreditResult); } catch (Exception ex) { } Session 5 - 18 Dr. Nipat Jongsawat

19 สิ่งที่จะต้องทำ ทำการ Run InventoryServer ทำการ Run OrderServerLab ทำการทดสอบระบบโดยการ Run ClientRMI – ป้อนรหัสลูกค้า (003) – ป้อนรหัสสินค้า (001) – ป้อนจำนวน (1) Session 5 - 19 Dr. Nipat Jongsawat

20 กรณีศึกษาย่อยที่ 1.3 : การเรียกใช้ RMI ข้ามเครื่อง Session 5 - 20 OrderInventory Client “Place Order” “Check Item Availability” “Check Item Cost” “Check-out Stock” Bank Customer Credit “Get Customer Status” “Get Customer Credit” “Decrease Customer Credit” Dr. Nipat Jongsawat

21 Session 5 - 21 Dr. Nipat Jongsawat

22 สิ่งที่จะต้องทำ Open Project RMI_CASE3 – มี Interface สำหรับ BankCustomerCtrditService ทำการ แก้ไข OrderServerLab เพื่อเรียกใช้ BankCustomerCreditService – เพิ่มรายละเอียดของเครื่องและ port ของ Registry ที่มี BankCustomerCreditService – ทำการเรียกใช้ Registry เพื่อจัดทำ Proxy ที่ใช้ใน การ Binding กับตัว Service – ทำการเรียกใช้ Service Session 5 - 22 Dr. Nipat Jongsawat

23 สิ่งที่จะต้องทำ ทำการ Run InventoryServer ทำการ Run OrderServerLab ทำการทดสอบระบบโดยการ Run ClientRMI – ป้อนรหัสลูกค้า (003) – ป้อนรหัสสินค้า (001) – ป้อนจำนวน (1) Session 5 - 23 Dr. Nipat Jongsawat

24 บทสรุป หลักการทำงานของ RMI การเพิ่มเติม RMI Service การเรียกใช้ RMI ข้ามเครื่อง Session 5 - 24 Dr. Nipat Jongsawat

25 กรณีศึกษาที่ 2 การพัฒนาแบบเว็บเซอร์วิซในสภาพแวดล้อมเดียว SOA Lab 2 : JAX-WS (Homogeneous Env.) Session 5 - 25 Dr. Nipat Jongsawat

26 หัวข้อนำเสนอ Creating a Web Service Consuming the Web Service กรณีศึกษาย่อยที่ 2.1 : การใช้งาน JAX-WS กรณีศึกษาย่อยที่ 2.2 : การเพิ่มเติม JAX-WS Service กรณีศึกษาย่อยที่ 2.3 : การเรียกใช้ JAX-WS ข้ามเครื่อง กรณีศึกษาที่ 3 การเรียกใช้ Service ต่าง platform Session 5 - 26 Dr. Nipat Jongsawat

27 Creating a Web Service Create a new Web Application Add new Web Service – @WebService Add Web Service Operation – @WebMethod – @WebParam Session 5 - 27 Dr. Nipat Jongsawat

28 Coding the Client @WebServiceRef to declare a reference to a web service. WebServiceRef uses the wsdlLocation element to specify the URI of the deployed service’s WSDL file. @WebServiceRef(wsdlLocation = "http://localhost:8080/ InventoryManagementSystem/InventoryService?WSDL"); private InventoryService inventoryService; Retrieves a proxy to the service, also known as a port, by invoking Inventory inventoryPort = InventoryService.getInventoryPort(); – The port implements the SEI defined by the service. Invokes the port’s method, passing to the service a name. int CheckAvailableResult = inventoryPort.getItemAvailability(catID); Session 5 - 28 Dr. Nipat Jongsawat

29 Consuming the Web Service in Netbeans Create new client application (Web, Servlet, JSP page) New > Web Service Client Servlet: New > Servlet – In Editor Web Service Client Resource > Call Web Service Operation JSP: drag Web service operation -> index.jsp Session 5 - 29 Dr. Nipat Jongsawat

30 กรณีศึกษาที่ 2 Session 5 - 30 Dr. Nipat Jongsawat

31 กรณีศึกษา 2.1 : ระบบการสั่งสินค้า ลูกค้าทำการป้อนข้อมูลการสั่งสินค้าเข้าระบบ ระบบทำการตรวจสอบ – มีสินค้าเพียงพอ ระบบทำการคำนวณราคา ตัดจำนวนสินค้า Session 5 - 31 Dr. Nipat Jongsawat

32 กรณีศึกษาย่อยที่ 2.1 : การใช้งาน JAX-WS Session 5 - 32 OrderInventory Client “Place Order” “Check Item Availability” “Check Item Cost” “Check-out Stock” Dr. Nipat Jongsawat

33 Session 5 - 33 Dr. Nipat Jongsawat

34 Session 5 - 34 Dr. Nipat Jongsawat

35 กรณีศึกษา 2.2 : ระบบการสั่งสินค้า ลูกค้าทำการป้อนข้อมูลการสั่งสินค้าเข้าระบบ ระบบทำการตรวจสอบ – มีสินค้าเพียงพอ – ลูกค้ามีเครดิตเพียงพอ ระบบทำการคำนวณราคา ตัดจำนวนสินค้า และ ปรับยอดเครดิตของลูกค้า Session 5 - 35 Dr. Nipat Jongsawat

36 Session 5 - 36 Dr. Nipat Jongsawat

37 กรณีศึกษา 2.3 : ระบบการสั่งสินค้า ลูกค้าทำการป้อนข้อมูลการสั่งสินค้าเข้าระบบ ระบบทำการตรวจสอบ – มีสินค้าเพียงพอ – ลูกค้ามีเครดิตกับธนาคารเพียงพอ ระบบทำการคำนวณราคา ตัดจำนวนสินค้า และ เรียกใช้บริการปรับยอดเครดิตลูกค้าของธนาคาร Session 5 - 37 Dr. Nipat Jongsawat

38 Session 5 - 38 Dr. Nipat Jongsawat

39 กรณีศึกษาที่ 3 การเรียกใช้ Service ต่าง platform Session 5 - 39 Dr. Nipat Jongsawat

40 กรณีศึกษาที่ 3 Session 5 - 40 Dr. Nipat Jongsawat

41 Session 5 - 41 Dr. Nipat Jongsawat

42 . NET Web Service Web Service References ตัวเดิม @WebServiceRef(wsdlLocation = "http://localhost:8080/ InventoryManagementSystem/InventoryService?WSDL"); private org.inventory.InventoryService inventoryService; แทนที่ด้วย @WebServiceRef(wsdlLocation = "http://161.200.92.194/ InventoryManagementSystem/InventoryService.asmx?WSDL"); private org.inventory.InventoryService inventoryService; Port/Endpoint ตัวเดิม org.inventory.Inventory inventoryPort = inventoryService.getInventoryPort(); แทนที่ด้วย org.inventory.InventoryServiceSoap inventoryPort = inventoryService.getInventoryServiceSoap(); Session 5 - 42 Dr. Nipat Jongsawat

43 Session 5 - 43 Dr. Nipat Jongsawat

44 WebSphere Web Service Web Service References ตัวเดิม @WebServiceRef(wsdlLocation="http://161.200.92.194:8080/ CustomerManagementSystem/CustomerCreditService?WSDL"); private org.customer.CustomerCreditService customerCreditService; แทนที่ด้วย @WebServiceRef(wsdlLocation = "http://161.200.92.157:9080/CustomerMgtSystem/services/ CustomerMgtSystem/wsdl/CustomerMgtSystem.wsdl"); private org.customer.CustomerMgtSystemService customerCreditService; Session 5 - 44 Dr. Nipat Jongsawat

45 WebSphere Web Service Port/Endpoint ตัวเดิม org.customer.CustomerCredit customerPort = customerCreditService.getCustomerCreditPort(); แทนที่ด้วย org.customer.CustomerMgtSystem customerPort = customerCreditService.getCustomerMgtSystem(); Customer Status Return ตัวเดิม if(!customerPort.getCustomerStatus(custID)) แทนที่ด้วย if(!customerPort.getCustomerStatus(custID).equals( “ 1 ” )) Session 5 - 45 Dr. Nipat Jongsawat

46 Session 5 - 46 Dr. Nipat Jongsawat

47 Index.jsp Port/Endpoint ตัวเดิม org.order.OrderService service = new org.order.OrderService(); org.order.Order port = service.getOrderPort(); แทนที่ด้วย org.order.OrderService service = new org.order.OrderService(); org.order.OrderServiceSoap port = service.getOrderServiceSoap(); Session 5 - 47 Dr. Nipat Jongsawat

48 กรณีศึกษาที่ 4 การใช้ BPEL ในการควบคุมกิจกรรมทางธุรกิจ Session 5 - 48 Dr. Nipat Jongsawat


ดาวน์โหลด ppt Session 5: Case Study Session 5 - 1 Dr. Nipat Jongsawat.

งานนำเสนอที่คล้ายกัน


Ads by Google