Currently your web services return XML reports of the following form.
<applicant> <availableCCCredit>2000</availableCCCredit> <currentlyBankrupt>false</currentlyBankrupt> <lastName>Smith</lastName> <firstName>John</firstName> <approvalLevel>Applicant is a high risk.</approvalLevel> <creditScore>560</creditScore> <taxID>222222222</taxID> </applicant>
But what if a client asked you to return an XML report of the following form?
<applicant id="222222222"> <name_last>Smith</name_last> <name_first>John</name_first> <bankrupt>false</bankrupt> <balance_remaining>2000</balance_remaining> <risk_estimate>Applicant is a high risk.</risk_estimate> <score_info> <credit_score>560</credit_score> <us_percentile>19.0</us_percentile> </score_info> <message>Credit Report complete.</message> </applicant>
In this step you will construct a credit report to your client's specifications with the aid of the schema file ClientB.xsd and a set of corresponding XMLBeans classes, ApplicantDocument and ApplicantDocument.Applicant, which are located in the Schemas folder.
When a schema file is placed in the Schemas project, WebLogic Workshop produces a set of XMLBean Java classes corresponding to the schema. These XMLBean classes let you construct or parse XML documents that are instances of the original schema. In this case, you will use the XMLBean classes to construct an XML document of the form desired by your client.
The tasks in this step are:
In this task you will place an XQuery map on the callback onCreditReportDone. The XQuery map will reshape the XML document currently sent back to clients into an XML document that conforms to the schema ClientB.xsd.
Source Schema | Target Schema |
taxID | id |
firstname | name_first |
lastName | name_last |
currentlyBankrupt | bankrupt |
availableCCCredit | balance_remaining |
creditScore | credit_score |
approvalLevel | risk_estimate |
message | message |
Your web service's onCreditReportDone callback now sends XML messages that conform to the ClientB.xsd schema.
To Test the Investigate Web Service
Note: Use one of the following (9 digit) taxID's to test your web service throughout the tutorial:
Click one of the following arrows to navigate through the tutorial: