Note: This article is free from Section 16.2 of bpel1.1 specifications.
This article discusses an example of a simple loan approval web service. In this example, the customer sends a loan approval request, including the customer's personal email.
Interest and loan amount. The loan approval Web Service uses this information to run a simple process to obtain "loan consent" or "loan rejection"
Result. For loans of less than $10000 and customers with good credit, approval is automated. For customers with high loans and uncertain credit
Users, we need to use the functions provided by the other two web services. The "Risk Assessment Service" is used to query the credit risks of an individual.
The home evaluation service is used to obtain experts' opinions on the project.
1. Service Description
Assuming that xmlns: lNS = "http://loans.org/wsdl/loan-approval" already exists, the service description file is as follows:
<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: credit information message. A message is equivalent to a value object.
<Message name = "creditinformationmessage">
<Part name = "firstname" type = "XSD: string"/>
<Part name = "name" type = "XSD: string"/>
<Part name = "amount" type = "XSD: integer"/>
</Message>
H: Approval message
<Message name = "approvalmessage">
<Part name = "accept" type = "XSD: string"/>
</Message>
H: Risk Assessment message
<Message name = "riskassessmentmessage">
<Part name = "level" type = "XSD: string"/>
</Message>
H: error message
<Message name = "errormessage">
<Part name = "errorcode" type = "XSD: integer"/>
</Message>
H: Understand porttype as our OO method! It specifies the input, output, and error handling.
<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 is used to differentiate roles.
<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>