Wednesday, August 21, 2013

ตัวอย่าง Mediator, BPEL และ Oracle Service Bus เบื้องต้น

ตัวอย่าง Mediator, BPEL และ Oracle Service Bus เบื้องต้น

 

1.      สร้าง Artifact file เช่น XML schema ของ Inbound/Outbound, Transformation ที่จำเป็น และ Database Adapter เป็นต้น

2.      สร้าง Mediator เป็น Service Endpoint (Outbound)

3.      สร้าง BPEL เป็น Service Endpoint (Outbound)

4.      สร้าง Proxy Service (OSB) เพื่อผูก Service เข้าด้วยกัน (Inbound)

Let 's start.

5.      Create new complexType => sequence => element (name,type)

 

6.      Create element

<?xml version="1.0" encoding="windows-1252" ?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

            xmlns:ns1="http://www.v-smart.com/WebService/TestProject1/PolicyDetail"

            targetNamespace="http://www.v-smart.com/WebService/TestProject1/PolicyDetail"

            elementFormDefault="qualified">

  <xsd:element name="exampleElement">

    <xsd:annotation>

      <xsd:documentation>

        A sample element

      </xsd:documentation>

    </xsd:annotation>

  </xsd:element>

  <xsd:complexType name="PolicyDetailRequestType">

    <xsd:sequence>

      <xsd:element name="running_no" type="xsd:int"/>

    </xsd:sequence>

  </xsd:complexType>

  <xsd:complexType name="PolicyDetailResponseType">

    <xsd:sequence>

      <xsd:element name="policy_no" type="xsd:string"/>

      <xsd:element name="status" type="xsd:string"/>

      <xsd:element name="ref_no" type="xsd:string"/>

      <xsd:element name="claim_date" type="xsd:dateTime"/>

    </xsd:sequence>

  </xsd:complexType>

  <xsd:complexType name="PolicyDetailFaultType">

    <xsd:sequence>

      <xsd:element name="error_msg" type="xsd:string"/>

    </xsd:sequence>

  </xsd:complexType>

  <xsd:element name="PolicyDetailRequest" type="ns1:PolicyDetailRequestType"/>

  <xsd:element name="PolicyDetailResponse" type="ns1:PolicyDetailResponseType"/>

  <xsd:element name="PolicyDetailFault" type="ns1:PolicyDetailFaultType"/>

</xsd:schema>

 

7.      Create WSDL file name PolicyDetail.wsdl

 

 

8.      Import XSD and add mandatory tag to completed

 

 

 

 

Create Message and Part

 

 

·       Create PortType and Operation

 

 

9.      Use WSDL generate Web Service

·       SOA composite – Use Mediator or BPEL process

·       OSB – Use for create proxy service

 

a)      Create Mediator

 

 

 

 

 

 

Use web service to query database like this

 

 

 

 

Create XSL

SOA composite

Deployment

Testing

http://bpmsrv1.v-smart.com:7001/em

Test by SOAPUI

 

 

b)     Create BPEL process like this

SOA composite

Result (same result see in Mediator)

 

 

c)      Create proxy service in OSB

Create folder like this

 

ให้ Copy file  ที่จำเป็นต้องใช้ในเชื่อมต่อ database จากตัวอย่างก่อนหน้านี้ไว้ที่ folder adapter

 

ข้อควรระวัง:

1.      ให้แก้ไข path ใน WSDL ที่ชี้ไปยัง XSD

 

 

Create Business service from JCA

 

Copy XSD and WSDL then modify WSDL by adding Binding info

 

Change service type of proxy service as WSDL web service

 

 

สร้าง XSL ด้วย JDev

 

Create Message Flow

 

Deployment (or Publishing) and testing

Test via Service Bus Web Console

 

Test via SOAP UI

 

 

================

Good Luck.

================

 

No comments:

Post a Comment