BPEL之貸款審批案例(1)

來源:互聯網
上載者:User

說明:本文意譯自BPEL1.1規範16.2節。

本文討論一個簡單的貸款審批的WEB服務的例子。在該例子中,客戶發送貸款核准請求,包括客戶個人信

息和貸款金額。貸款審批的WEB服務利用該資訊運行一個簡單流程,得到“同意貸款”或“拒絕貸款”的

結果。對於低於10000美元的貸款和有良好信用的客戶,審批是自動的。對於高額貸款和信用不確定的客

戶,我們需要用到另外兩個WEB服務提供的功能。“風險評估服務”用來查詢某個個人的信用風險,“專

家評估服務”用來獲得專家對該項目的具體評估意見。

1。服務描述
我們假定已經存在xmlns:lns="http://loans.org/wsdl/loan-approval",服務描述檔案如下:
<definitions
      targetNamespace="http://loans.org/wsdl/loan-approval"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"   
     xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"     
      xmlns:lns="http://loans.org/wsdl/loan-approval">

H:信用資訊訊息。訊息相當於我們的值對象。
<message name="creditInformationMessage">
   <part name="firstName" type="xsd:string"/>
   <part name="name" type="xsd:string"/>
   <part name="amount" type="xsd:integer"/>
</message>
H:審批訊息
<message name="approvalMessage">
   <part name="accept" type="xsd:string"/>
</message>
H:風險評估訊息
<message name="riskAssessmentMessage">
   <part name="level" type="xsd:string"/>
</message>  
H:錯誤訊息
<message name="errorMessage">
   <part name="errorCode" type="xsd:integer"/>
</message>

H:把portType理解為我們的OO中的方法吧!它指定了輸入,輸出,出錯處理。
<portType name="loanServicePT">
   <operation name="request">
      <input message="lns:creditInformationMessage"/>
      <output message="lns:approvalMessage"/>
      <fault name="unableToHandleRequest"
             message="lns:errorMessage"/>
   </operation>
</portType>

<portType name="riskAssessmentPT">
   <operation name="check">
      <input message="lns:creditInformationMessage"/>
      <output message="lns:riskAssessmentMessage"/>
      <fault name="loanProcessFault"
             message="lns:errorMessage"/>
   </operation>
</portType>

<portType name="loanApprovalPT">
   <operation name="approve">
      <input message="lns:creditInformationMessage"/>
      <output message="lns:approvalMessage"/>
      <fault name="loanProcessFault"
             message="lns:errorMessage"/>
   </operation>
</portType>     

H:partnerLinkType用來區分角色。
<plnk:partnerLinkType name="loanPartnerLinkType">
   <plnk:role name="loanService">
       <plnk:portType name="lns:loanServicePT"/>
   </plnk:role>
</plnk:partnerLinkType>

<plnk:partnerLinkType name="loanApprovalLinkType">
   <plnk:role name="approver">
       <plnk:portType name="lns:loanApprovalPT"/>
   </plnk:role>  
</plnk:partnerLinkType>

<plnk:partnerLinkType name="riskAssessmentLinkType">
   <plnk:role name="assessor">
       <plnk:portType name="lns:riskAssessmentPT"/>
   </plnk:role>  
</plnk:partnerLinkType>

</definitions>

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.