The Friday Night Project #8 – TZA-InsuranceService

UDA
The UDA channel is for Teradata’s Unified Data Architecture including the Analytical Ecosystem and other UDA influences. This channel provides information specific to the integration and co-existence of multiple systems, in particular when a mix of Aster, Teradata, and Hadoop are present. It is also meant to support information around the UDA enabling technologies so products like Viewpoint, Data Mover, Connectors, QueryGrid, etc.
Teradata Employee

The Friday Night Project #8 – TZA-InsuranceService

So as we discussed previously TZA-Insurance operates as an Insurance Underwriter, allowing other Insurance Brokers to offer insurance services (insurance quotes and policies) to the final customer. In order to expose the business processes of TZA-Insurance we provide a Web service definition to its various Clients (Insurance Brokers, Web sites, etc) that allows them to create a Web service client interface within their application environment (Java or .Net). This Client interface then operates against the TZA Property Insurance Web service in order to initially get an insurance Quotation based upon the characteristics of the Property to be insured and then if acceptable to the Customer buy an Insurance Policy based around that Quotation.

TZA Property Insurance Web service Contract

From the high level description of the business a number of Business Objects can easily be identified and represented as XML Schema Definitions (XSD):

ClientDetails.xsd: Identifies the Person or System that is calling the service. Their organizationCode identifies the known Organization they represent (TZA-Insurance establishes contracts with their customers in advance) while the username and password provided may be utilized by the Web service to provide for authentication that this is a valid organization/user of the service. Services that are exposed over the public Internet and not made available through an Internet or Extranet will probably require that these elements (at least) are encrypted with the whole service being accessed via an HTTPS connection.

PropertyDetails.xsd: Describes all of the salient aspects of the property (House) for which an insurance quotation or policy is being requested (physical characteristics, address, etc, Insurance amounts and options).

CustomerDetails.xsd: Is the salient aspects of the final customer for whom the Insurance policy is being requested (Name, DOB, etc).

QuotationDetails.xsd: Provides information about a quotation provided to a customer (Quotation amount, Currency, Reference Number and Expiry Date).

PolicyDetails.xsd : provides information about the insurance Policy (contract) that has been taken out between the Client and TZA-Insurance on behalf of the Customer.

Each of the Business Objects described above is represented by the associated .XSD file that are then imported into a single TZA-PropertyInsurance.xsd file that is used to represent the input and output parameters of the TZA Property Insurance Web service represented by TZA-PropertyInsurance.wsdl. Note we are specifically talking (and recommending) a Contract First approach to Web service development.

Anatomy of the TZA Property Insurance Web service

The TZA Property Insurance Web service provides two simple methods the first being getQuote (that submits a QuoteRequest object consisting of Client, Customer and Property Details, and receives a QuoteResponse that contains either a Quote Details object or a ParameterFault Exception). A calling application may issue getQuote one or more times in order to allow the Client/Customer to match the coverage levels and quotation cost to mutually acceptable levels (TZA needs to recognize that getQuote will be called one or more times and manage its internal records accordingly in order to maintain the most recent Quotation provided for this combination of Client, Customer and Property details).

The second method, buyPolicy, is expected to only be called once for a given combination of Client, Customer, Property and Quotation details (as business objects maintained within the PolicyRequest object) as this represents a binding contract between TZA-Insurance and it's Client (and therefore the Customer that they represent). This Web service method either returns a PolicyResponse object (containing the Policy Details and associated Quotation Details) or one of the valid Faults (Exceptions) for this method, namely ParameterFault where one or more of the parameters/attributes in the input parameter objects is invalid in some way or an ExpiredQuotation fault where the quotation provided as part of the input had expired (TZA needs to verify the authenticity and expiry dates of incoming quotations against it records or it could become subject to an unacceptable risk by accepting historical or fraudulent quotations).

Creating TZA-InsuranceService

The TZA-InsuranceService Web service is a Servlet oriented Java Enterprise Edition (JEE) Application, therefore within the Friday Night Project workspace we need to create a Dynamic Web Application project and define somewhere for that project to run, i.e. an Application Server.

Tomcat Application Server

In order to host Servlet oriented, Java Enterprise applications a Java Application Server is required (Note this is not a full Java Entity Bean oriented Java Enterprise Edition Application and therefore does not "require" a JEE Application Container such as IBM Web Sphere or BEA Web Logic, although it will run fine on those platforms also).

The Java reference Application Server is known as Apache Tomcat, which while possibly seen as the lowest common denominator is still a fully functional JEE Servlet 2.4 Container.

  • To install Tomcat browse to Apache Tomcat and select one of the download links (i.e. Tomcat 5.5), unless you have a specific need to use an earlier version (select the appropriate Core download for your platform).
  • Unzip and install using the default settings.

On Windows set the CATALINA_HOME environment variable to match the installation directory.

  • Select Start -> Control Panel -> System -> Advanced -> Environment Variables -> System -> New
  • Set the Variable Name = CATALINA_HOME
  • Set the Variable Value = C:\apache-tomcat-5.5.26 (or wherever you installed Tomcat).
  • Select OK

CATALINA HOME Environment Variable

Repeat with the CATALINA_OPTS environment variable to increase the memory allocation.

  • Set the Variable Name = CATALINA_OPTS
  • Set the Variable Value = -Xms512M -Xmx512M.
  • Select OK, OK, OK to save the new Environment Variables.

Create a JEE Dynamic Web application

The TZA-InsuranceService Web service is a Servlet oriented Java Enterprise Edition (JEE) Application, therefore within the Friday Night Project workspace we need to create a Dynamic Web Application project.

Start up your Eclipse IDE (including the Teradata Plug-In) against your Friday Night Project Workspace.

Workspace Launcher

Once the IDE is started, create a New Dynamic Web Project.

  • Select File -> New -> Project -> Web -> Dynamic Web Project -> Next
  • Set the Project name: TZA-InsuranceService.

Define a Target Runtime

  • Select New…
  • Select the Apache Runtime you downloaded previously.

New Server Runtime

Locate Target Runtime and select the JDK to use with it.

  • Browse to the location of the Apache Runtime you downloaded previously.
  • Set the JRE to the JDK you installed previously

Tomcat Location and JDK

  • Select Finish (within the New Server Runtime Dialog).

New Dynamic Web Project

  • Select Next (within the New Dynamic Web Project Dialog).
  • Set the Content Directory = "web".
  • Set the Java Source Directory ="src/java"

Web Module Dialog

  • Select Finish.

The other source files required by the project can be added through the Project Explorer view

  • Right click on the TZA-InsuranceService project.
  • Select New -> Source Folder
  • Set the Folder Name = "src/config"

New Source Folder

  • Select Finish
  • Repeat for the src/resources folder.

Eclipse and WTP will create a complete directory structure that represents a Dynamic Web Application including the Configuration Information, the source directories and the 'web' directory.

We Project Directory Structure

Add a WSDL folder, populate with WSDL/XSD files.

  • Use File -> New -> Folder to include a new folder within the TZA-InsuranceService Project.
  • Expand the TZA-InsuranceService icon and Click on the 'web' icon to select it.
  • Set the Folder Name to "wsdl"

New Folder - WSDL

  • Select Finish.

This will create a "wsdl" directory within the TZA-Insurance directory [e.g. C:\Projects\FridayNightProject\TZA-InsuranceService\web\wsdl]. This is an important location as we will now load the previously defined .xsd and .wsdl files that represent the TZA-PropertyInsurance Web service into this location.

ClientDetails.xsd

ClientDetails.xsd: Identifies the Person or System that is calling the service. Start by creating a new XML Schema (ClientDetails.xsd) in the web/wsdl directory.

  • Right Click on web/wsdl and select New -> Other.. -> XML -> XML Schema
  • Select Next and set File Name = ClientDetails.xsd
  • Click Finish and a template XSD file will open within the Eclipse editor (select the Source tab rather than Design).
<?xml version="1.0" encoding="UTF-8"?>
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.org/ClientDetails"
xmlns:tns="http://www.example.org/ClientDetails"
elementFormDefault="qualified">
</schema>

The ClientDetails.xsd Schema can then be built up by replacing the template code with the following code segment within the ClientDetails.xsd file using copy and paste.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.teradata.com/tza/insurance/service"
xmlns:s="http://schemas.teradata.com/tza/insurance/service"
elementFormDefault="qualified"
id="ClientDetails"
targetNamespace="http://schemas.teradata.com/tza/insurance/service">

<xsd:annotation>
<xsd:documentation xml:lang="en">
The contents of this file are Teradata Public Content and have been released to the Public Domain.
Please see the license.txt file in the top level directory for more information.
</xsd:documentation>
</xsd:annotation>

<!-- Client Details - Client being the Person or Program that calls this service -->
<xsd:complexType name="ClientDetails">
<xsd:sequence>

<!-- orgCode: Organization Code associated with an existing TZA-Insurance Brokerage Account -->
<xsd:element name="orgCode" nillable="false" type="xsd:string"/>

<!-- username / password of the individual user from orgCode that is calling the service -->
<xsd:element name="username" nillable="false" type="xsd:string"/>
<xsd:element name="password" nillable="false" type="xsd:string"/>

</xsd:sequence>
</xsd:complexType>

</xsd:schema>

CustomerDetails.xsd

CustomerDetails.xsd: Identifies the final customer for whom the Insurance is being requested. Start by creating a new XML Schema (CustomerDetails.xsd) in the web/wsdl directory.

  • Right Click on web/wsdl and select New -> Other.. -> XML -> XML Schema
  • Select Next and set File Name = CustomerDetails.xsd
  • Click Finish and a template XSD file will open within the Eclipse editor.

The CustomerDetails.xsd Schema can then be built up by replacing the template code with the following code segment within the CustomerDetails.xsd file using copy and paste.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.teradata.com/tza/insurance/service"
xmlns:s="http://schemas.teradata.com/tza/insurance/service"
elementFormDefault="qualified" id="CustomerDetails"
targetNamespace="http://schemas.teradata.com/tza/insurance/service">

<xsd:annotation>
<xsd:documentation xml:lang="en">
The contents of this file are Teradata Public Content and have been released to the Public Domain.
Please see the license.txt file in the top level directory for more information.
</xsd:documentation>
</xsd:annotation>

<!-- CustomerDetails - Information about the final customer for the Policy -->
<xsd:complexType name="CustomerDetails">
<xsd:sequence>

<!-- Basic First, Middle, Last Name Information -->
<xsd:element name="firstName" nillable="true" type="xsd:string"/>
<xsd:element name="middleName" nillable="true" type="xsd:string"/>
<xsd:element name="lastName" nillable="true" type="xsd:string"/>

<!-- Date of Birth as Cross Reference -->
<xsd:element name="dateOfBirth" nillable="false" type="xsd:date"/>

<!-- Salutation Information for politeness -->
<xsd:element name="prefix" nillable="true" type="xsd:string"/>
<xsd:element name="salutation" nillable="true" type="xsd:string"/>

</xsd:sequence>
</xsd:complexType>
</xsd:schema>

PropertyDetails.xsd

PropertyDetails.xsd: Describes all of the salient aspects of the property. Start by creating a new XML Schema (PropertyDetails.xsd) in the web/wsdl directory.

  • Right Click on web/wsdl and select New -> Other.. -> XML -> XML Schema
  • Select Next and set File Name = PropertyDetails.xsd
  • Click Finish and a template XSD file will open within the Eclipse editor.

The PropertyDetails.xsd Schema can then be built up by replacing the template code with the following code segment within the PropertyDetails.xsd file using copy and paste.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.teradata.com/tza/insurance/service"
xmlns:s="http://schemas.teradata.com/tza/insurance/service"
elementFormDefault="qualified"
id="PropertyDetails"
targetNamespace="http://schemas.teradata.com/tza/insurance/service">

<xsd:annotation>
<xsd:documentation xml:lang="en">
The contents of this file are Teradata Public Content and have been released to the Public Domain.
Please see the license.txt file in the top level directory for more information.
</xsd:documentation>
</xsd:annotation>

<!-- Define Enumerations used to Restrict values returned be specific elements -->

<!-- Property Ownership Enumeration -->
<xsd:simpleType name="ownership">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Rented"/>
<xsd:enumeration value="Owned"/>
<xsd:enumeration value="Mortgaged"/>
</xsd:restriction>
</xsd:simpleType>

<!-- Property Age Restriction - i.e. 1900, 2004 -->
<xsd:simpleType name="yearBuilt">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9][0-9][0-9][0-9]"/>
</xsd:restriction>
</xsd:simpleType>

<!-- Zip Code Restriction - i.e. 92127, 90245 -->
<xsd:simpleType name="ZipCode">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9][0-9][0-9][0-9][0-9]"/>
</xsd:restriction>
</xsd:simpleType>

<!-- Property Type Enumeration -->
<xsd:simpleType name="propertyType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Apartment"/>
<xsd:enumeration value="Condominium"/>
<xsd:enumeration value="Townhouse"/>
<xsd:enumeration value="Duplex"/>
<xsd:enumeration value="Detached"/>
</xsd:restriction>
</xsd:simpleType>

<!-- PropertyDetails - Describes the physical porperty that we wish to insure -->
<xsd:complexType name="PropertyDetails">
<xsd:sequence>
<!-- USPS Address Information -->
<xsd:element name="houseNameNumber" nillable="true" type="xsd:string"/>
<xsd:element name="streetAddress1" nillable="false" type="xsd:string"/>
<xsd:element name="streetAddress2" nillable="true" type="xsd:string"/>
<xsd:element name="streetAddress3" nillable="true" type="xsd:string"/>
<xsd:element name="streetAddress4" nillable="true" type="xsd:string"/>
<xsd:element name="city" nillable="false" type="xsd:string"/>
<xsd:element name="state" nillable="false" type="xsd:string"/>
<xsd:element name="zipCode" nillable="false" type="ZipCode"/>

<!-- Property Description - Ownership, #Bedrooms, Year Built, Type -->
<xsd:element name="ownership" nillable="false" type="ownership"/>
<xsd:element name="numBedrooms" nillable="false" type="xsd:int"/>
<xsd:element name="yearBuilt" nillable="false" type="yearBuilt"/>
<xsd:element name="propertyType" nillable="false" type="propertyType"/>

<!-- Buildings Insurance coverage information -->
<xsd:element name="buildingsAmountInsured" nillable="false" type="xsd:decimal"/>
<xsd:element name="buildingsCover" nillable="false" type="xsd:boolean"/>
<xsd:element name="buildingsAccidentalCover" nillable="false" type="xsd:boolean"/>

<!-- Contents Insurance coverage information -->
<xsd:element name="contentsAmountInsured" nillable="false" type="xsd:decimal"/>
<xsd:element name="contentsCover" nillable="false" type="xsd:boolean"/>
<xsd:element name="contentsAccidentalCover" nillable="false" type="xsd:boolean"/>
<xsd:element name="singleItemLimit" nillable="true" type="xsd:decimal"/>

<!-- Security information -->
<xsd:element name="alarmed" nillable="false" type="xsd:boolean"/>
<xsd:element name="securityPatrolled" nillable="false" type="xsd:boolean"/>

<!-- Date Insurance is to start, not nillable (but probably default to today) -->
<xsd:element name="startDate" nillable="false" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

QuotationDetails.xsd

QuotationDetails.xsd: Describes all of the salient aspects of the Quotation. Start by creating a new XML Schema (QuotationDetails.xsd) in the web/wsdl directory.

  • Right Click on web/wsdl and select New -> Other.. -> XML -> XML Schema
  • Select Next and set File Name = QuotationDetails.xsd
  • Click Finish and a template XSD file will open within the Eclipse editor.

The QuotationDetails.xsd Schema can then be built up by replacing the template code with the following code segment within the QuotationDetails.xsd file using copy and paste.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.teradata.com/tza/insurance/service"
xmlns:s="http://schemas.teradata.com/tza/insurance/service"
elementFormDefault="qualified"
id="QuotationDetails"
targetNamespace="http://schemas.teradata.com/tza/insurance/service">

<!-- Define a Currency Code Restriction i.e. GBP, USD etc -->
<xsd:simpleType name="CurrencyCode">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[A-Z][A-Z][A-Z]"/>
</xsd:restriction>
</xsd:simpleType>

<!-- Quotation Details - Quotation in the local Currency -->
<xsd:complexType name="QuotationDetails">
<xsd:sequence>
<!-- Quotation is provided as Decimal refined by a local currency code -->
<xsd:element name="quotation" nillable="false" type="xsd:decimal"/>
<xsd:element name="currencyCode" nillable="false" type="CurrencyCode"/>

<!-- Each Quote is given a unique Reference Number and Expiry Date -->
<xsd:element name="referenceNumber" nillable="false" type="xsd:string"/>
<xsd:element name="expiryDate" nillable="false" type="xsd:date"/>

<!-- Each Quote is associated with the orgCode of the origniating Client -->
<xsd:element name="clientOrgCode" nillable="false" type="xsd:string"/>

</xsd:sequence>
</xsd:complexType>

</xsd:schema>

PolicyDetails.xsd

PolicyDetails.xsd: Describes all of the salient aspects of the policy. Start by creating a new XML Schema (PolicyDetails.xsd) in the web/wsdl directory.

  • Right Click on web/wsdl and select New -> Other.. -> XML -> XML Schema
  • Select Next and set File Name = PolicyDetails.xsd
  • Click Finish and a template XSD file will open within the Eclipse editor.

The PolicyDetails.xsd Schema can then be built up by replacing the template code with the following code segment within the PolicyDetails.xsd file using copy and paste.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.teradata.com/tza/insurance/service"
xmlns:s="http://schemas.teradata.com/tza/insurance/service"
elementFormDefault="qualified"
id="PolicyDetails"
targetNamespace="http://schemas.teradata.com/tza/insurance/service">

<xsd:annotation>
<xsd:documentation xml:lang="en">
The contents of this file are Teradata Public Content and have been released to the Public Domain.
Please see the license.txt file in the top level directory for more information.
</xsd:documentation>
</xsd:annotation>

<!-- Policy Details - Limited to Reference Number but larger in practice -->
<xsd:complexType name="PolicyDetails">
<xsd:sequence>
<!-- Policy Reference Number -->
<xsd:element name="referenceNumber" nillable="false" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>

</xsd:schema>

TZA-PropertyInsurance.xsd

TZA-PropertyInsurance.xsd: Brings together all of the above elements into a cohesive schema that we can associate with the TZA-PropertyInsurance Web service. Note TZA-Insurance might wish to branch out into, say, travel insurance later and would be able to reuse schema elements such as ClientDetails and CustomerDetails.

Start by creating a new XML Schema (TZA-PropertyInsurance.xsd) in the web/wsdl directory.

  • Right Click on web/wsdl and select New -> Other.. -> XML -> XML Schema
  • Select Next and set File Name = TZA-PropertyInsurance.xsd
  • Click Finish and a template XSD file will open within the Eclipse editor.

The TZA-PropertyInsurance.xsd Schema can then be built up by replacing the template code with the following code segment within the TZA-PropertyInsurance.xsd file using copy and paste.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.teradata.com/tza/insurance/service"
xmlns:s="http://schemas.teradata.com/tza/insurance/service"
elementFormDefault="qualified"
id="PropertyInsuranceSchemas"
targetNamespace="http://schemas.teradata.com/tza/insurance/service">

<xsd:annotation>
<xsd:documentation xml:lang="en">
The contents of this file are Teradata Public Content and have been released to the Public Domain.
Please see the license.txt file in the top level directory for more information.
</xsd:documentation>
</xsd:annotation>

<!-- Include the Individual Business Object Schemas to be used -->
<xsd:include schemaLocation="ClientDetails.xsd"/>
<xsd:include schemaLocation="PropertyDetails.xsd"/>
<xsd:include schemaLocation="QuotationDetails.xsd"/>
<xsd:include schemaLocation="PolicyDetails.xsd"/>
<xsd:include schemaLocation="CustomerDetails.xsd"/>

<!-- QuoteRequest is the Input Parameter set of the getQuote Method -->
<xsd:element name="QuoteRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Client" type="ClientDetails"/>
<xsd:element name="Customer" type="CustomerDetails"/>
<xsd:element name="Property" type="PropertyDetails"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<!-- QuoteResponse is the Output Parameter set of the getQuote Method -->
<xsd:element name="QuoteResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Quotation" type="QuotationDetails"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<!-- PolicyRequest is the Input Parameter set of the buyPolicy Method -->
<xsd:element name="PolicyRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Client" type="ClientDetails"/>
<xsd:element name="Customer" type="CustomerDetails"/>
<xsd:element name="Property" type="PropertyDetails"/>
<xsd:element name="Quotation" type="QuotationDetails"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<!-- PolicyResponse is the Output Parameter set of the buyPolicy Method -->
<xsd:element name="PolicyResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Policy" type="PolicyDetails"/>
<xsd:element name="Quotation" type="QuotationDetails"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

</xsd:schema>

TZA-PropertyInsurance.wsdl

TZA-PropertyInsurance.wsdl: Is the final public description of the TZA-PropertyInsurance Web service.

Start by creating a new WSDL File (TZA-PropertyInsurance.wsdl) in the web/wsdl directory.

  • Right Click on web/wsdl and select New -> Other.. -> XML -> XML
  • Select Next and set File Name = TZA-PropertyInsurance.wsdl
  • Click Finish and a template XML file (WSDL uses XML) will open within the Eclipse editor.

The TZA-PropertyInsurance.wsdl file can then be built up by replacing the template code with the following code segment within the TZA-PropertyInsurance.wsdl file using copy and paste.

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions
xmlns:schema="http://schemas.teradata.com/tza/insurance/service"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://teradata.com/tza/insurance/service"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://teradata.com/tza/insurance/service">

<xsd:annotation>
<xsd:documentation xml:lang="en">
The contents of this file are Teradata Public Content and have been released to the Public Domain.
Please see the license.txt file in the top level directory for more information.
</xsd:documentation>
</xsd:annotation>

<!-- Define all the Types (Business Objects) that will be used within this service -->
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- A single PropertyInsurance.xsd descibes all the types use by PropertyInsurance.wsdl -->
<xsd:import namespace="http://schemas.teradata.com/tza/insurance/service" schemaLocation="TZA-PropertyInsurance.xsd"/>
</xsd:schema>
</wsdl:types>

<!-- Define the messages - input and output - that will make uo the PropertyInsurance Web service -->
<wsdl:message name="QuoteRequest">
<wsdl:part element="schema:QuoteRequest" name="QuoteRequest"/>
</wsdl:message>

<wsdl:message name="QuoteResponse">
<wsdl:part element="schema:QuoteResponse" name="QuoteReturn"/>
</wsdl:message>

<wsdl:message name="PolicyRequest">
<wsdl:part element="schema:PolicyRequest" name="PolicyRequest"/>
</wsdl:message>

<wsdl:message name="PolicyResponse">
<wsdl:part element="schema:PolicyResponse" name="PolicyReturn"/>
</wsdl:message>

<!-- Define any Fault messages (Excpetions) that might be required -->
<wsdl:message name="ParameterFault">
</wsdl:message>

<wsdl:message name="ExpiredQuotation">
</wsdl:message>

<!-- Define the PropertyInsurance PortType, this describes each Web service method -->
<wsdl:portType name="PropertyInsurance">

<!-- QuoteResponse = getQuote(QuoteResquest) throws ParameterFault -->
<wsdl:operation name="getQuote" parameterOrder="QuoteRequest">
<wsdl:input message="tns:QuoteRequest" name="QuoteRequest"/>
<wsdl:output message="tns:QuoteResponse" name="QuoteResponse"/>
<wsdl:fault message="tns:ParameterFault" name="ParameterFault"/>
</wsdl:operation>

<!-- PolicyResponse = buyPolicy(PolicyResquest) throws ParameterFault, ExpiredQuotation -->
<wsdl:operation name="buyPolicy" parameterOrder="PolicyRequest">
<wsdl:input message="tns:PolicyRequest" name="PolicyRequest"/>
<wsdl:output message="tns:PolicyResponse" name="PolicyResponse"/>
<wsdl:fault message="tns:ParameterFault" name="ParameterFault"/>
<wsdl:fault message="tns:ExpiredQuotation" name="ExpiredQuotation"/>
</wsdl:operation>

</wsdl:portType>

<!-- Define the PropertyInsuranceSoapBinding as Document/Literal -->
<wsdl:binding name="PropertyInsuranceSoapBinding" type="tns:PropertyInsurance">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

<!-- QuoteResponse = getQuote(QuoteResquest) throws ParameterFault -->
<wsdl:operation name="getQuote">
<soap:operation soapAction=""/>

<wsdl:input name="QuoteRequest">
<soap:body use="literal"/>
</wsdl:input>

<wsdl:output name="QuoteResponse">
<soap:body use="literal"/>
</wsdl:output>

<wsdl:fault name="ParameterFault">
<soap:fault name="ParameterFault" use="literal"/>
</wsdl:fault>

</wsdl:operation>

<!-- PolicyResponse = buyPolicy(PolicyResquest) throws ParameterFault, ExpiredQuotation -->
<wsdl:operation name="buyPolicy">
<soap:operation soapAction=""/>

<wsdl:input name="PolicyRequest">
<soap:body use="literal"/>
</wsdl:input>

<wsdl:output name="PolicyResponse">
<soap:body use="literal"/>
</wsdl:output>

<wsdl:fault name="ParameterFault">
<soap:fault name="ParameterFault" use="literal"/>
</wsdl:fault>

<wsdl:fault name="ExpiredQuotation">
<soap:fault name="ExpiredQuotation" use="literal"/>
</wsdl:fault>

</wsdl:operation>

</wsdl:binding>

<!-- Define the PropertyInsuranceService as a SOAP Binding at a physical HTTP address -->
<wsdl:service name="PropertyInsuranceService">

<wsdl:port binding="tns:PropertyInsuranceSoapBinding" name="PropertyInsurance">

<soap:address location="http://localhost:8080/TZA-PropertyInsurance/services/PropertyInsurance"/>

</wsdl:port>

</wsdl:service>

</wsdl:definitions>

If you switch the XML Editor View from Source mode to Design mode you will see the TZA-PropertyInsurance Web service illustrated as follows:

Property Insurance Web service design

The completed WSDL directory will look like this within the Project Explorer view:

WSDL Directory

Create the TZA-InsuranceService Web service

The Eclipse Web Tools Project (WTP) provides a number of tools that support the creation of Static and Dynamic web applications such as support for multiple server configurations (Tomcat, BEA, IBM, JBoss), JSP code assist etc. WTP also provides excellent support for Web services, using the WS-I compatible Axis Servlet, (this is a little dated now as Axis2 is now available but it will serve for this exercise). Alternative approaches are CXF and Spring-WS.

Build the Plumbing Code

The advocated approach to providing a Web service interface into a Teradata Enterprise Application is Contract First where we start with a WS-I compatible Web service definition (TZA-PropertyInsurance.wsdl) and utilize appropriate tooling (in this case WTP) to generate all of the necessary plumbing code.

  • In the Project Explorer (shown above) Right Click on the TZA-PropertyInsurance.wsdl file
  • Select Web services -> Generate Java Bean Skeleton
  • Note the Web service type is set to “Top Down Java bean Web service”

WTP Web services Wizard

  • Within the Web Service Wizard draw the slider associated with the Client to the top (Test Client)
  • Select Finish.

The WSDL and associated XSD's will be parsed and all of the Java classes required for the server side Web service implementation will be automatically (and reliably) created.

If asked to do so start the Tomcat server and select Finish again to create and install the TZA-InsuranceServiceClient (again all of the JSP files required to provide the test client will be automatically created).

Once the deployment of the Web service application and the Web based Test Client application are complete the Web Service Test Client will appear as shown.

Initial Web services Test Client

This Test Client Project (TZA-InsuranceServiceClient) allows you to exercise the associated Web service to check it's operation (Note it will not work immediately as WTP does not handle the Enumeration Restriction that was placed in the original PropertyDetails.xsd).

Enhancing the Test Client

The TZA-InsuranceServiceClient Web application ultimately consist of an auto-generated Java Proxy used to call upon the Web service. This Java Proxy is fronted by 4 Java Server Pages with TestClient.jsp providing a framed environment for the other 3 to exist on a single Web page. Method.jsp provides a menu of the Web service methods available with Input.jsp and Result.jsp providing an Input and Output view of each available Web service method.

Modified versions of Input.jsp and Result.jsp are provided below to allow for easy installation of the modifications necessary to address issues such as Enumeration Processing and Default values (to stop you needing to type everything back in each time the Web page refreshes). The auto-generated versions of these two files exist within the \WebContent\samplePropertyInsuranceProxy directory of the TZA-InsuranceServiceClient project and can be updated as follows.

Input.jsp

Update the existing Input.jsp by opening the file and replacing the existing code with the following code segment using copy and paste.

<%@page contentType="text/html;charset=UTF-8"%>
<HTML>
<HEAD>
<TITLE>Inputs</TITLE>
</HEAD>
<BODY>
<H1>Inputs</H1>

<%
String method = request.getParameter("method");
int methodID = 0;
if (method == null) methodID = -1;

boolean valid = true;

if(methodID != -1) methodID = Integer.parseInt(method);
switch (methodID){
case 2:
valid = false;
%>
<FORM METHOD="POST" ACTION="Result.jsp" TARGET="result">
<INPUT TYPE="HIDDEN" NAME="method" VALUE="<%=method%>">
<BR>
<INPUT TYPE="SUBMIT" VALUE="Invoke">
<INPUT TYPE="RESET" VALUE="Clear">
</FORM>
<%
break;
case 5:
valid = false;
%>
<FORM METHOD="POST" ACTION="Result.jsp" TARGET="result">
<INPUT TYPE="HIDDEN" NAME="method" VALUE="<%=method%>">
<TABLE>
<TR>
<TD COLSPAN="1" ALIGN="LEFT">endpoint:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="endpoint8" SIZE=20></TD>
</TR>
</TABLE>
<BR>
<INPUT TYPE="SUBMIT" VALUE="Invoke">
<INPUT TYPE="RESET" VALUE="Clear">
</FORM>
<%
break;
case 10:
valid = false;
%>
<FORM METHOD="POST" ACTION="Result.jsp" TARGET="result">
<INPUT TYPE="HIDDEN" NAME="method" VALUE="<%=method%>">
<BR>
<INPUT TYPE="SUBMIT" VALUE="Invoke">
<INPUT TYPE="RESET" VALUE="Clear">
</FORM>
<%
break;
case 13:
valid = false;
%>
<FORM METHOD="POST" ACTION="Result.jsp" TARGET="result">
<INPUT TYPE="HIDDEN" NAME="method" VALUE="<%=method%>">
<TABLE>
<TR>
<TD COLSPAN="3" ALIGN="LEFT">quoteRequest:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD COLSPAN="2" ALIGN="LEFT">client:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">username:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="username36" SIZE=20 VALUE="TZA_User"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">password:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="password32" SIZE=20 VALUE="TZA_Password"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">orgCode:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="orgCode34" SIZE=20 VALUE="TZA_Broker"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD COLSPAN="2" ALIGN="LEFT">property:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">buildingsAccidentalCover:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="buildingsAccidentalCover40" SIZE=20 VALUE="true"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">startDate:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="startDate42" SIZE=20 VALUE="October 16, 2009"></TD>
<%
java.text.DateFormat dateFormatstartDate42 = java.text.DateFormat.getDateInstance();
java.util.GregorianCalendar gcExampstartDate42 = new java.util.GregorianCalendar();
java.util.Date datestartDate42 = gcExampstartDate42.getTime();
String tempResultstartDate42 = dateFormatstartDate42.format(datestartDate42);
%>
<TD ALIGN="left">
</TR>
<TR>
<TD> </TD>
<TD ALIGN="left"> eg. <%= tempResultstartDate42 %> </TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">buildingsCover:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="buildingsCover44" SIZE=20 VALUE="true"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">singleItemLimit:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="singleItemLimit46" SIZE=20 VALUE="5000"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">houseNameNumber:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="houseNameNumber48" SIZE=20 VALUE="A2-2401"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">state:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="state50" SIZE=20 VALUE="CA"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">buildingsAmountInsured:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="buildingsAmountInsured52" SIZE=20 VALUE="500000"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">securityPatrolled:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="securityPatrolled54" SIZE=20 VALUE="true"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">alarmed:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="alarmed56" SIZE=20 VALUE="true"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">zipCode:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="zipCode58" SIZE=20 VALUE="92127"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">contentsAmountInsured:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="contentsAmountInsured60" SIZE=20 VALUE="50000"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">streetAddress4:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="streetAddress462" SIZE=20></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">streetAddress3:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="streetAddress364" SIZE=20></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">streetAddress2:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="streetAddress266" SIZE=20></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">streetAddress1:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="streetAddress168" SIZE=20 VALUE="17095 Via Del Campo"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">city:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="city70" SIZE=20 VALUE="San Diego"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">contentsCover:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="contentsCover72" SIZE=20 VALUE="true"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">yearBuilt:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="yearBuilt74" SIZE=20 VALUE="1965"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">contentsAccidentalCover:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="contentsAccidentalCover76" SIZE=20 VALUE="true"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">numBedrooms:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="numBedrooms78" SIZE=20 VALUE="2"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">ownership:</TD>
<TD ALIGN="left">
<select name="ownership101">
<option value ="Mortgaged" selected="selected">Mortgaged</option>
<option value ="Rented">Rented</option>
<option value ="Owned">Owned</option>
</select>
</TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">propertyType:</TD>
<TD ALIGN="left">
<select name="propertyType101">
<option value ="Condominium" selected="selected">Condominium</option>
<option value ="Apartment">Apartment</option>
<option value ="Townhouse">Townhouse</option>
<option value ="Duplex">Duplex</option>
<option value ="Detached">Detached</option>
</select>
</TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD COLSPAN="2" ALIGN="LEFT">customer:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">firstName:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="firstName88" SIZE=20 VALUE="Tera"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">middleName:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="middleName84" SIZE=20></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">lastName:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="lastName82" SIZE=20 VALUE="Data"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">dateOfBirth:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="dateOfBirth86" SIZE=20 VALUE="May 1, 1965"></TD>
<%
java.text.DateFormat dateFormatdateOfBirth86 = java.text.DateFormat.getDateInstance();
java.util.GregorianCalendar gcExampdateOfBirth86 = new java.util.GregorianCalendar();
java.util.Date datedateOfBirth86 = gcExampdateOfBirth86.getTime();
String tempResultdateOfBirth86 = dateFormatdateOfBirth86.format(datedateOfBirth86);
%>
<TD ALIGN="left">
</TR>
<TR>
<TD> </TD>
<TD ALIGN="left"> eg. <%= tempResultdateOfBirth86 %> </TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">prefix:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="prefix90" SIZE=20></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">salutation:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="salutation92" SIZE=20 VALUE="Teradata"></TD>
</TR>
</TABLE>
<BR>
<INPUT TYPE="SUBMIT" VALUE="Invoke">
<INPUT TYPE="RESET" VALUE="Clear">
</FORM>
<%
break;
case 94:
valid = false;
%>
<FORM METHOD="POST" ACTION="Result.jsp" TARGET="result">
<INPUT TYPE="HIDDEN" NAME="method" VALUE="<%=method%>">
<TABLE>
<TR>
<TD COLSPAN="3" ALIGN="LEFT">policyRequest:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD COLSPAN="2" ALIGN="LEFT">client:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">username:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="username121" SIZE=20 VALUE="TZA_User"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">password:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="password117" SIZE=20 VALUE="TZA_Password"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">orgCode:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="orgCode119" SIZE=20 VALUE="TZA_Broker"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD COLSPAN="2" ALIGN="LEFT">quotation:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">clientOrgCode:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="clientOrgCode125" SIZE=20 VALUE="TZA_Broker"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">expiryDate:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="expiryDate127" SIZE=20 VALUE="December 31, 2009"></TD>
<%
java.text.DateFormat dateFormatexpiryDate127 = java.text.DateFormat.getDateInstance();
java.util.GregorianCalendar gcExampexpiryDate127 = new java.util.GregorianCalendar();
java.util.Date dateexpiryDate127 = gcExampexpiryDate127.getTime();
String tempResultexpiryDate127 = dateFormatexpiryDate127.format(dateexpiryDate127);
%>
<TD ALIGN="left">
</TR>
<TR>
<TD> </TD>
<TD ALIGN="left"> eg. <%= tempResultexpiryDate127 %> </TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">currencyCode:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="currencyCode129" SIZE=20 VALUE="USD"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">quotation:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="quotation131" SIZE=20 VALUE="Change Me"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">referenceNumber:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="referenceNumber133" SIZE=20 VALUE="Change Me"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD COLSPAN="2" ALIGN="LEFT">property:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">buildingsAccidentalCover:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="buildingsAccidentalCover137" SIZE=20 VALUE="true"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">startDate:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="startDate139" SIZE=20 VALUE="December 31, 2009"></TD>
<%
java.text.DateFormat dateFormatstartDate139 = java.text.DateFormat.getDateInstance();
java.util.GregorianCalendar gcExampstartDate139 = new java.util.GregorianCalendar();
java.util.Date datestartDate139 = gcExampstartDate139.getTime();
String tempResultstartDate139 = dateFormatstartDate139.format(datestartDate139);
%>
<TD ALIGN="left">
</TR>
<TR>
<TD> </TD>
<TD ALIGN="left"> eg. <%= tempResultstartDate139 %> </TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">buildingsCover:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="buildingsCover141" SIZE=20 VALUE="true"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">singleItemLimit:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="singleItemLimit143" SIZE=20 VALUE="5000"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">houseNameNumber:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="houseNameNumber145" SIZE=20 VALUE="A2-2401"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">state:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="state147" SIZE=20 VALUE="CA"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">buildingsAmountInsured:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="buildingsAmountInsured149" SIZE=20 VALUE="500000"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">securityPatrolled:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="securityPatrolled151" SIZE=20 VALUE="true"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">alarmed:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="alarmed153" SIZE=20 VALUE="true"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">zipCode:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="zipCode155" SIZE=20 VALUE="92127"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">contentsAmountInsured:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="contentsAmountInsured157" SIZE=20 VALUE="5000"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">streetAddress4:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="streetAddress4159" SIZE=20></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">streetAddress3:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="streetAddress3161" SIZE=20></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">streetAddress2:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="streetAddress2163" SIZE=20></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">streetAddress1:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="streetAddress1165" SIZE=20 VALUE="17095 Via Del Campo"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">city:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="city167" SIZE=20 VALUE="San Diego"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">contentsCover:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="contentsCover169" SIZE=20 VALUE="true"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">yearBuilt:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="yearBuilt171" SIZE=20 VALUE="1965"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">contentsAccidentalCover:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="contentsAccidentalCover173" SIZE=20 VALUE="true"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">numBedrooms:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="numBedrooms175" SIZE=20 VALUE="2"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">ownership:</TD>
<TD ALIGN="left">
<select name="ownership102">
<option value ="Mortgaged" selected="selected">Mortgaged</option>
<option value ="Rented">Rented</option>
<option value ="Owned">Owned</option>
</select>
</TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">propertyType:</TD>
<TD ALIGN="left">
<select name="propertyType102">
<option value ="Condominium" selected="selected">Condominium</option>
<option value ="Apartment">Apartment</option>
<option value ="Townhouse">Townhouse</option>
<option value ="Duplex">Duplex</option>
<option value ="Detached">Detached</option>
</select>
</TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD COLSPAN="2" ALIGN="LEFT">customer:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">firstName:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="firstName185" SIZE=20 VALUE="Tera"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">middleName:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="middleName181" SIZE=20></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">lastName:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="lastName179" SIZE=20 VALUE="Data"></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">dateOfBirth:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="dateOfBirth183" SIZE=20 VALUE="May 1, 1965"></TD>
<%
java.text.DateFormat dateFormatdateOfBirth183 = java.text.DateFormat.getDateInstance();
java.util.GregorianCalendar gcExampdateOfBirth183 = new java.util.GregorianCalendar();
java.util.Date datedateOfBirth183 = gcExampdateOfBirth183.getTime();
String tempResultdateOfBirth183 = dateFormatdateOfBirth183.format(datedateOfBirth183);
%>
<TD ALIGN="left">
</TR>
<TR>
<TD> </TD>
<TD ALIGN="left"> eg. <%= tempResultdateOfBirth183 %> </TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">prefix:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="prefix187" SIZE=20></TD>
</TR>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">salutation:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="salutation189" SIZE=20 VALUE="Teradata"></TD>
</TR>
</TABLE>
<BR>
<INPUT TYPE="SUBMIT" VALUE="Invoke">
<INPUT TYPE="RESET" VALUE="Clear">
</FORM>
<%
break;
case 1111111111:
valid = false;
%>
<FORM METHOD="POST" ACTION="Result.jsp" TARGET="result">
<INPUT TYPE="HIDDEN" NAME="method" VALUE="<%=method%>">
<TABLE>
<TR>
<TD COLSPAN="1" ALIGN="LEFT">URLString:</TD>
<TD ALIGN="left"><INPUT TYPE="TEXT" NAME="url1111111111" SIZE=20></TD>
</TR>
</TABLE>
<BR>
<INPUT TYPE="SUBMIT" VALUE="Invoke">
<INPUT TYPE="RESET" VALUE="Clear">
</FORM>
<%
break;
case 1111111112:
valid = false;
%>
<FORM METHOD="POST" ACTION="Result.jsp" TARGET="result">
<INPUT TYPE="HIDDEN" NAME="method" VALUE="<%=method%>">
<BR>
<INPUT TYPE="SUBMIT" VALUE="Invoke">
<INPUT TYPE="RESET" VALUE="Clear">
</FORM>
<%
break;
}
if (valid) {
%>
Select a method to test.
<%
return;
}
%>

</BODY>
</HTML>

Result.jsp

Update the existing Result.jsp by opening the file and replacing the existing code with the following code segment using copy and paste.

<%@page contentType="text/html;charset=UTF-8"%>
<% request.setCharacterEncoding("UTF-8"); %>
<HTML>
<HEAD>
<TITLE>Result</TITLE>
</HEAD>
<BODY>
<H1>Result</H1>

<jsp:useBean id="samplePropertyInsuranceProxyid" scope="session" class="com.teradata.tza.insurance.service.PropertyInsuranceProxy" />
<%
if (request.getParameter("endpoint") != null && request.getParameter("endpoint").length() > 0)
samplePropertyInsuranceProxyid.setEndpoint(request.getParameter("endpoint"));
%>

<%
String method = request.getParameter("method");
int methodID = 0;
if (method == null) methodID = -1;

if(methodID != -1) methodID = Integer.parseInt(method);
boolean gotMethod = false;

try {
switch (methodID){
case 2:
gotMethod = true;
java.lang.String getEndpoint2mtemp = samplePropertyInsuranceProxyid.getEndpoint();
if(getEndpoint2mtemp == null){
%>
<%=getEndpoint2mtemp %>
<%
}else{
String tempResultreturnp3 = org.eclipse.jst.ws.util.JspUtils.markup(String.valueOf(getEndpoint2mtemp));
%>
<%= tempResultreturnp3 %>
<%
}
break;
case 5:
gotMethod = true;
String endpoint_0id= request.getParameter("endpoint8");
java.lang.String endpoint_0idTemp = null;
if(!endpoint_0id.equals("")){
endpoint_0idTemp = endpoint_0id;
}
samplePropertyInsuranceProxyid.setEndpoint(endpoint_0idTemp);
break;
case 10:
gotMethod = true;
com.teradata.tza.insurance.service.PropertyInsurance getPropertyInsurance10mtemp = samplePropertyInsuranceProxyid.getPropertyInsurance();
if(getPropertyInsurance10mtemp == null){
%>
<%=getPropertyInsurance10mtemp %>
<%
}else{
if(getPropertyInsurance10mtemp!= null){
String tempreturnp11 = getPropertyInsurance10mtemp.toString();
%>
<%=tempreturnp11%>
<%
}}
break;
case 13:
gotMethod = true;
String password_3id= request.getParameter("password32");
java.lang.String password_3idTemp = null;
if(!password_3id.equals("")){
password_3idTemp = password_3id;
}
String orgCode_4id= request.getParameter("orgCode34");
java.lang.String orgCode_4idTemp = null;
if(!orgCode_4id.equals("")){
orgCode_4idTemp = orgCode_4id;
}
String username_5id= request.getParameter("username36");
java.lang.String username_5idTemp = null;
if(!username_5id.equals("")){
username_5idTemp = username_5id;
}
%>
<jsp:useBean id="com1teradata1schemas1tza1insurance1service1ClientDetails_2id" scope="session" class="com.teradata.schemas.tza.insurance.service.ClientDetails" />
<%
com1teradata1schemas1tza1insurance1service1ClientDetails_2id.setPassword(password_3idTemp);
com1teradata1schemas1tza1insurance1service1ClientDetails_2id.setOrgCode(orgCode_4idTemp);
com1teradata1schemas1tza1insurance1service1ClientDetails_2id.setUsername(username_5idTemp);
String buildingsAccidentalCover_7id= request.getParameter("buildingsAccidentalCover40");
boolean buildingsAccidentalCover_7idTemp = Boolean.valueOf(buildingsAccidentalCover_7id).booleanValue();
String startDate_8id= request.getParameter("startDate42");
java.util.Date startDate_8idTemp = null;
if(!startDate_8id.equals("")){
java.text.DateFormat dateFormatstartDate42 = java.text.DateFormat.getDateInstance();
startDate_8idTemp= dateFormatstartDate42.parse(startDate_8id);
}
String buildingsCover_9id= request.getParameter("buildingsCover44");
boolean buildingsCover_9idTemp = Boolean.valueOf(buildingsCover_9id).booleanValue();
String singleItemLimit_10id= request.getParameter("singleItemLimit46");
java.math.BigDecimal singleItemLimit_10idTemp = null;
if(!singleItemLimit_10id.equals("")){
singleItemLimit_10idTemp = new java.math.BigDecimal(singleItemLimit_10id);
}
String houseNameNumber_11id= request.getParameter("houseNameNumber48");
java.lang.String houseNameNumber_11idTemp = null;
if(!houseNameNumber_11id.equals("")){
houseNameNumber_11idTemp = houseNameNumber_11id;
}
String state_12id= request.getParameter("state50");
java.lang.String state_12idTemp = null;
if(!state_12id.equals("")){
state_12idTemp = state_12id;
}
String buildingsAmountInsured_13id= request.getParameter("buildingsAmountInsured52");
java.math.BigDecimal buildingsAmountInsured_13idTemp = null;
if(!buildingsAmountInsured_13id.equals("")){
buildingsAmountInsured_13idTemp = new java.math.BigDecimal(buildingsAmountInsured_13id);
}
String securityPatrolled_14id= request.getParameter("securityPatrolled54");
boolean securityPatrolled_14idTemp = Boolean.valueOf(securityPatrolled_14id).booleanValue();
String alarmed_15id= request.getParameter("alarmed56");
boolean alarmed_15idTemp = Boolean.valueOf(alarmed_15id).booleanValue();
String zipCode_16id= request.getParameter("zipCode58");
java.lang.String zipCode_16idTemp = null;
if(!zipCode_16id.equals("")){
zipCode_16idTemp = zipCode_16id;
}
String contentsAmountInsured_17id= request.getParameter("contentsAmountInsured60");
java.math.BigDecimal contentsAmountInsured_17idTemp = null;
if(!contentsAmountInsured_17id.equals("")){
contentsAmountInsured_17idTemp = new java.math.BigDecimal(contentsAmountInsured_17id);
}
String streetAddress4_18id= request.getParameter("streetAddress462");
java.lang.String streetAddress4_18idTemp = null;
if(!streetAddress4_18id.equals("")){
streetAddress4_18idTemp = streetAddress4_18id;
}
String streetAddress3_19id= request.getParameter("streetAddress364");
java.lang.String streetAddress3_19idTemp = null;
if(!streetAddress3_19id.equals("")){
streetAddress3_19idTemp = streetAddress3_19id;
}
String streetAddress2_20id= request.getParameter("streetAddress266");
java.lang.String streetAddress2_20idTemp = null;
if(!streetAddress2_20id.equals("")){
streetAddress2_20idTemp = streetAddress2_20id;
}
String streetAddress1_21id= request.getParameter("streetAddress168");
java.lang.String streetAddress1_21idTemp = null;
if(!streetAddress1_21id.equals("")){
streetAddress1_21idTemp = streetAddress1_21id;
}
String city_22id= request.getParameter("city70");
java.lang.String city_22idTemp = null;
if(!city_22id.equals("")){
city_22idTemp = city_22id;
}
String contentsCover_23id= request.getParameter("contentsCover72");
boolean contentsCover_23idTemp = Boolean.valueOf(contentsCover_23id).booleanValue();
String yearBuilt_24id= request.getParameter("yearBuilt74");
java.lang.String yearBuilt_24idTemp = null;
if(!yearBuilt_24id.equals("")){
yearBuilt_24idTemp = yearBuilt_24id;
}
String contentsAccidentalCover_25id= request.getParameter("contentsAccidentalCover76");
boolean contentsAccidentalCover_25idTemp = Boolean.valueOf(contentsAccidentalCover_25id).booleanValue();
String numBedrooms_26id= request.getParameter("numBedrooms78");
int numBedrooms_26idTemp = Integer.parseInt(numBedrooms_26id);
String ownership101 = request.getParameter("ownership101");
String propertyType101 = request.getParameter("propertyType101");

%>
<jsp:useBean id="com1teradata1schemas1tza1insurance1service1PropertyDetails_6id" scope="session" class="com.teradata.schemas.tza.insurance.service.PropertyDetails" />
<%
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setBuildingsAccidentalCover(buildingsAccidentalCover_7idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setStartDate(startDate_8idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setBuildingsCover(buildingsCover_9idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setSingleItemLimit(singleItemLimit_10idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setHouseNameNumber(houseNameNumber_11idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setState(state_12idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setBuildingsAmountInsured(buildingsAmountInsured_13idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setSecurityPatrolled(securityPatrolled_14idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setAlarmed(alarmed_15idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setZipCode(zipCode_16idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setContentsAmountInsured(contentsAmountInsured_17idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setStreetAddress4(streetAddress4_18idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setStreetAddress3(streetAddress3_19idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setStreetAddress2(streetAddress2_20idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setStreetAddress1(streetAddress1_21idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setCity(city_22idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setContentsCover(contentsCover_23idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setYearBuilt(yearBuilt_24idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setContentsAccidentalCover(contentsAccidentalCover_25idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setNumBedrooms(numBedrooms_26idTemp);
if (ownership101.equals("Rented"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setOwnership(com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.getOwnership().Rented);
else if (ownership101.equals("Mortgaged"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setOwnership(com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.getOwnership().Mortgaged);
else // if (ownership101.equals("Mortgaged"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setOwnership(com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.getOwnership().Owned);

if (propertyType101.equals("Apartment"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setPropertyType(com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.getPropertyType().Apartment);
else if (propertyType101.equals("Apartment"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setPropertyType(com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.getPropertyType().Condominium);
else if (propertyType101.equals("Detached"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setPropertyType(com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.getPropertyType().Detached);
else if (propertyType101.equals("Duplex"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setPropertyType(com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.getPropertyType().Duplex);
else // if (propertyType101.equals("Townhouse"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.setPropertyType(com1teradata1schemas1tza1insurance1service1PropertyDetails_6id.getPropertyType().Townhouse);
String lastName_28id= request.getParameter("lastName82");
java.lang.String lastName_28idTemp = null;
if(!lastName_28id.equals("")){
lastName_28idTemp = lastName_28id;
}
String middleName_29id= request.getParameter("middleName84");
java.lang.String middleName_29idTemp = null;
if(!middleName_29id.equals("")){
middleName_29idTemp = middleName_29id;
}
String dateOfBirth_30id= request.getParameter("dateOfBirth86");
java.util.Date dateOfBirth_30idTemp = null;
if(!dateOfBirth_30id.equals("")){
java.text.DateFormat dateFormatdateOfBirth86 = java.text.DateFormat.getDateInstance();
dateOfBirth_30idTemp= dateFormatdateOfBirth86.parse(dateOfBirth_30id);
}
String firstName_31id= request.getParameter("firstName88");
java.lang.String firstName_31idTemp = null;
if(!firstName_31id.equals("")){
firstName_31idTemp = firstName_31id;
}
String prefix_32id= request.getParameter("prefix90");
java.lang.String prefix_32idTemp = null;
if(!prefix_32id.equals("")){
prefix_32idTemp = prefix_32id;
}
String salutation_33id= request.getParameter("salutation92");
java.lang.String salutation_33idTemp = null;
if(!salutation_33id.equals("")){
salutation_33idTemp = salutation_33id;
}
%>
<jsp:useBean id="com1teradata1schemas1tza1insurance1service1CustomerDetails_27id" scope="session" class="com.teradata.schemas.tza.insurance.service.CustomerDetails" />
<%
com1teradata1schemas1tza1insurance1service1CustomerDetails_27id.setLastName(lastName_28idTemp);
com1teradata1schemas1tza1insurance1service1CustomerDetails_27id.setMiddleName(middleName_29idTemp);
com1teradata1schemas1tza1insurance1service1CustomerDetails_27id.setDateOfBirth(dateOfBirth_30idTemp);
com1teradata1schemas1tza1insurance1service1CustomerDetails_27id.setFirstName(firstName_31idTemp);
com1teradata1schemas1tza1insurance1service1CustomerDetails_27id.setPrefix(prefix_32idTemp);
com1teradata1schemas1tza1insurance1service1CustomerDetails_27id.setSalutation(salutation_33idTemp);
%>
<jsp:useBean id="com1teradata1schemas1tza1insurance1service1QuoteRequest_1id" scope="session" class="com.teradata.schemas.tza.insurance.service.QuoteRequest" />
<%
com1teradata1schemas1tza1insurance1service1QuoteRequest_1id.setClient(com1teradata1schemas1tza1insurance1service1ClientDetails_2id);
com1teradata1schemas1tza1insurance1service1QuoteRequest_1id.setProperty(com1teradata1schemas1tza1insurance1service1PropertyDetails_6id);
com1teradata1schemas1tza1insurance1service1QuoteRequest_1id.setCustomer(com1teradata1schemas1tza1insurance1service1CustomerDetails_27id);
com.teradata.schemas.tza.insurance.service.QuoteResponse getQuote13mtemp = samplePropertyInsuranceProxyid.getQuote(com1teradata1schemas1tza1insurance1service1QuoteRequest_1id);
if(getQuote13mtemp == null){
%>
<%=getQuote13mtemp %>
<%
}else{
%>
<TABLE>
<TR>
<TD COLSPAN="3" ALIGN="LEFT">returnp:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD COLSPAN="2" ALIGN="LEFT">quotation:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">clientOrgCode:</TD>
<TD>
<%
if(getQuote13mtemp != null){
com.teradata.schemas.tza.insurance.service.QuotationDetails tebece0=getQuote13mtemp.getQuotation();
if(tebece0 != null){
java.lang.String typeclientOrgCode18 = tebece0.getClientOrgCode();
String tempResultclientOrgCode18 = org.eclipse.jst.ws.util.JspUtils.markup(String.valueOf(typeclientOrgCode18));
%>
<%= tempResultclientOrgCode18 %>
<%
}}%>
</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">expiryDate:</TD>
<TD>
<%
if(getQuote13mtemp != null){
com.teradata.schemas.tza.insurance.service.QuotationDetails tebece0=getQuote13mtemp.getQuotation();
if(tebece0 != null){
java.util.Date typeexpiryDate20 = tebece0.getExpiryDate();
java.text.DateFormat dateFormatexpiryDate20 = java.text.DateFormat.getDateInstance();
String tempResultexpiryDate20 = org.eclipse.jst.ws.util.JspUtils.markup(dateFormatexpiryDate20.format(typeexpiryDate20));
%>
<%= tempResultexpiryDate20 %>
<%
}}%>
</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">currencyCode:</TD>
<TD>
<%
if(getQuote13mtemp != null){
com.teradata.schemas.tza.insurance.service.QuotationDetails tebece0=getQuote13mtemp.getQuotation();
if(tebece0 != null){
java.lang.String typecurrencyCode22 = tebece0.getCurrencyCode();
String tempResultcurrencyCode22 = org.eclipse.jst.ws.util.JspUtils.markup(String.valueOf(typecurrencyCode22));
%>
<%= tempResultcurrencyCode22 %>
<%
}}%>
</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">quotation:</TD>
<TD>
<%
if(getQuote13mtemp != null){
com.teradata.schemas.tza.insurance.service.QuotationDetails tebece0=getQuote13mtemp.getQuotation();
if(tebece0 != null){
java.math.BigDecimal typequotation24 = tebece0.getQuotation();
String tempResultquotation24 = org.eclipse.jst.ws.util.JspUtils.markup(typequotation24.toString());
%>
<%= tempResultquotation24 %>
<%
}}%>
</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">referenceNumber:</TD>
<TD>
<%
if(getQuote13mtemp != null){
com.teradata.schemas.tza.insurance.service.QuotationDetails tebece0=getQuote13mtemp.getQuotation();
if(tebece0 != null){
java.lang.String typereferenceNumber26 = tebece0.getReferenceNumber();
String tempResultreferenceNumber26 = org.eclipse.jst.ws.util.JspUtils.markup(String.valueOf(typereferenceNumber26));
%>
<%= tempResultreferenceNumber26 %>
<%
}}%>
</TD>
</TABLE>
<%
}
break;
case 94:
gotMethod = true;
String password_36id= request.getParameter("password117");
java.lang.String password_36idTemp = null;
if(!password_36id.equals("")){
password_36idTemp = password_36id;
}
String orgCode_37id= request.getParameter("orgCode119");
java.lang.String orgCode_37idTemp = null;
if(!orgCode_37id.equals("")){
orgCode_37idTemp = orgCode_37id;
}
String username_38id= request.getParameter("username121");
java.lang.String username_38idTemp = null;
if(!username_38id.equals("")){
username_38idTemp = username_38id;
}
%>
<jsp:useBean id="com1teradata1schemas1tza1insurance1service1ClientDetails_35id" scope="session" class="com.teradata.schemas.tza.insurance.service.ClientDetails" />
<%
com1teradata1schemas1tza1insurance1service1ClientDetails_35id.setPassword(password_36idTemp);
com1teradata1schemas1tza1insurance1service1ClientDetails_35id.setOrgCode(orgCode_37idTemp);
com1teradata1schemas1tza1insurance1service1ClientDetails_35id.setUsername(username_38idTemp);
String clientOrgCode_40id= request.getParameter("clientOrgCode125");
java.lang.String clientOrgCode_40idTemp = null;
if(!clientOrgCode_40id.equals("")){
clientOrgCode_40idTemp = clientOrgCode_40id;
}
String expiryDate_41id= request.getParameter("expiryDate127");
java.util.Date expiryDate_41idTemp = null;
if(!expiryDate_41id.equals("")){
java.text.DateFormat dateFormatexpiryDate127 = java.text.DateFormat.getDateInstance();
expiryDate_41idTemp= dateFormatexpiryDate127.parse(expiryDate_41id);
}
String currencyCode_42id= request.getParameter("currencyCode129");
java.lang.String currencyCode_42idTemp = null;
if(!currencyCode_42id.equals("")){
currencyCode_42idTemp = currencyCode_42id;
}
String quotation_43id= request.getParameter("quotation131");
java.math.BigDecimal quotation_43idTemp = null;
if(!quotation_43id.equals("")){
quotation_43idTemp = new java.math.BigDecimal(quotation_43id);
}
String referenceNumber_44id= request.getParameter("referenceNumber133");
java.lang.String referenceNumber_44idTemp = null;
if(!referenceNumber_44id.equals("")){
referenceNumber_44idTemp = referenceNumber_44id;
}
%>
<jsp:useBean id="com1teradata1schemas1tza1insurance1service1QuotationDetails_39id" scope="session" class="com.teradata.schemas.tza.insurance.service.QuotationDetails" />
<%
com1teradata1schemas1tza1insurance1service1QuotationDetails_39id.setClientOrgCode(clientOrgCode_40idTemp);
com1teradata1schemas1tza1insurance1service1QuotationDetails_39id.setExpiryDate(expiryDate_41idTemp);
com1teradata1schemas1tza1insurance1service1QuotationDetails_39id.setCurrencyCode(currencyCode_42idTemp);
com1teradata1schemas1tza1insurance1service1QuotationDetails_39id.setQuotation(quotation_43idTemp);
com1teradata1schemas1tza1insurance1service1QuotationDetails_39id.setReferenceNumber(referenceNumber_44idTemp);
String buildingsAccidentalCover_46id= request.getParameter("buildingsAccidentalCover137");
boolean buildingsAccidentalCover_46idTemp = Boolean.valueOf(buildingsAccidentalCover_46id).booleanValue();
String startDate_47id= request.getParameter("startDate139");
java.util.Date startDate_47idTemp = null;
if(!startDate_47id.equals("")){
java.text.DateFormat dateFormatstartDate139 = java.text.DateFormat.getDateInstance();
startDate_47idTemp= dateFormatstartDate139.parse(startDate_47id);
}
String buildingsCover_48id= request.getParameter("buildingsCover141");
boolean buildingsCover_48idTemp = Boolean.valueOf(buildingsCover_48id).booleanValue();
String singleItemLimit_49id= request.getParameter("singleItemLimit143");
java.math.BigDecimal singleItemLimit_49idTemp = null;
if(!singleItemLimit_49id.equals("")){
singleItemLimit_49idTemp = new java.math.BigDecimal(singleItemLimit_49id);
}
String houseNameNumber_50id= request.getParameter("houseNameNumber145");
java.lang.String houseNameNumber_50idTemp = null;
if(!houseNameNumber_50id.equals("")){
houseNameNumber_50idTemp = houseNameNumber_50id;
}
String state_51id= request.getParameter("state147");
java.lang.String state_51idTemp = null;
if(!state_51id.equals("")){
state_51idTemp = state_51id;
}
String buildingsAmountInsured_52id= request.getParameter("buildingsAmountInsured149");
java.math.BigDecimal buildingsAmountInsured_52idTemp = null;
if(!buildingsAmountInsured_52id.equals("")){
buildingsAmountInsured_52idTemp = new java.math.BigDecimal(buildingsAmountInsured_52id);
}
String securityPatrolled_53id= request.getParameter("securityPatrolled151");
boolean securityPatrolled_53idTemp = Boolean.valueOf(securityPatrolled_53id).booleanValue();
String alarmed_54id= request.getParameter("alarmed153");
boolean alarmed_54idTemp = Boolean.valueOf(alarmed_54id).booleanValue();
String zipCode_55id= request.getParameter("zipCode155");
java.lang.String zipCode_55idTemp = null;
if(!zipCode_55id.equals("")){
zipCode_55idTemp = zipCode_55id;
}
String contentsAmountInsured_56id= request.getParameter("contentsAmountInsured157");
java.math.BigDecimal contentsAmountInsured_56idTemp = null;
if(!contentsAmountInsured_56id.equals("")){
contentsAmountInsured_56idTemp = new java.math.BigDecimal(contentsAmountInsured_56id);
}
String streetAddress4_57id= request.getParameter("streetAddress4159");
java.lang.String streetAddress4_57idTemp = null;
if(!streetAddress4_57id.equals("")){
streetAddress4_57idTemp = streetAddress4_57id;
}
String streetAddress3_58id= request.getParameter("streetAddress3161");
java.lang.String streetAddress3_58idTemp = null;
if(!streetAddress3_58id.equals("")){
streetAddress3_58idTemp = streetAddress3_58id;
}
String streetAddress2_59id= request.getParameter("streetAddress2163");
java.lang.String streetAddress2_59idTemp = null;
if(!streetAddress2_59id.equals("")){
streetAddress2_59idTemp = streetAddress2_59id;
}
String streetAddress1_60id= request.getParameter("streetAddress1165");
java.lang.String streetAddress1_60idTemp = null;
if(!streetAddress1_60id.equals("")){
streetAddress1_60idTemp = streetAddress1_60id;
}
String city_61id= request.getParameter("city167");
java.lang.String city_61idTemp = null;
if(!city_61id.equals("")){
city_61idTemp = city_61id;
}
String contentsCover_62id= request.getParameter("contentsCover169");
boolean contentsCover_62idTemp = Boolean.valueOf(contentsCover_62id).booleanValue();
String yearBuilt_63id= request.getParameter("yearBuilt171");
java.lang.String yearBuilt_63idTemp = null;
if(!yearBuilt_63id.equals("")){
yearBuilt_63idTemp = yearBuilt_63id;
}
String contentsAccidentalCover_64id= request.getParameter("contentsAccidentalCover173");
boolean contentsAccidentalCover_64idTemp = Boolean.valueOf(contentsAccidentalCover_64id).booleanValue();
String numBedrooms_65id= request.getParameter("numBedrooms175");
int numBedrooms_65idTemp = Integer.parseInt(numBedrooms_65id);
%>
<jsp:useBean id="com1teradata1schemas1tza1insurance1service1PropertyDetails_45id" scope="session" class="com.teradata.schemas.tza.insurance.service.PropertyDetails" />
<%
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setBuildingsAccidentalCover(buildingsAccidentalCover_46idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setStartDate(startDate_47idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setBuildingsCover(buildingsCover_48idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setSingleItemLimit(singleItemLimit_49idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setHouseNameNumber(houseNameNumber_50idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setState(state_51idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setBuildingsAmountInsured(buildingsAmountInsured_52idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setSecurityPatrolled(securityPatrolled_53idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setAlarmed(alarmed_54idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setZipCode(zipCode_55idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setContentsAmountInsured(contentsAmountInsured_56idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setStreetAddress4(streetAddress4_57idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setStreetAddress3(streetAddress3_58idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setStreetAddress2(streetAddress2_59idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setStreetAddress1(streetAddress1_60idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setCity(city_61idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setContentsCover(contentsCover_62idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setYearBuilt(yearBuilt_63idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setContentsAccidentalCover(contentsAccidentalCover_64idTemp);
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setNumBedrooms(numBedrooms_65idTemp);

String ownership102 = request.getParameter("ownership102");
String propertyType102 = request.getParameter("propertyType102");

if (ownership102.equals("Rented"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setOwnership(com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.getOwnership().Rented);
else if (ownership102.equals("Mortgaged"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setOwnership(com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.getOwnership().Mortgaged);
else // if (ownership102.equals("Owned"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setOwnership(com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.getOwnership().Owned);

if (propertyType102.equals("Apartment"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setPropertyType(com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.getPropertyType().Apartment);
else if (propertyType102.equals("Condominium"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setPropertyType(com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.getPropertyType().Condominium);
else if (propertyType102.equals("Detached"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setPropertyType(com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.getPropertyType().Detached);
else if (propertyType102.equals("Duplex"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setPropertyType(com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.getPropertyType().Duplex);
else // if (propertyType102.equals("Townhouse"))
com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.setPropertyType(com1teradata1schemas1tza1insurance1service1PropertyDetails_45id.getPropertyType().Townhouse);

String lastName_67id= request.getParameter("lastName179");
java.lang.String lastName_67idTemp = null;
if(!lastName_67id.equals("")){
lastName_67idTemp = lastName_67id;
}
String middleName_68id= request.getParameter("middleName181");
java.lang.String middleName_68idTemp = null;
if(!middleName_68id.equals("")){
middleName_68idTemp = middleName_68id;
}
String dateOfBirth_69id= request.getParameter("dateOfBirth183");
java.util.Date dateOfBirth_69idTemp = null;
if(!dateOfBirth_69id.equals("")){
java.text.DateFormat dateFormatdateOfBirth183 = java.text.DateFormat.getDateInstance();
dateOfBirth_69idTemp= dateFormatdateOfBirth183.parse(dateOfBirth_69id);
}
String firstName_70id= request.getParameter("firstName185");
java.lang.String firstName_70idTemp = null;
if(!firstName_70id.equals("")){
firstName_70idTemp = firstName_70id;
}
String prefix_71id= request.getParameter("prefix187");
java.lang.String prefix_71idTemp = null;
if(!prefix_71id.equals("")){
prefix_71idTemp = prefix_71id;
}
String salutation_72id= request.getParameter("salutation189");
java.lang.String salutation_72idTemp = null;
if(!salutation_72id.equals("")){
salutation_72idTemp = salutation_72id;
}
%>
<jsp:useBean id="com1teradata1schemas1tza1insurance1service1CustomerDetails_66id" scope="session" class="com.teradata.schemas.tza.insurance.service.CustomerDetails" />
<%
com1teradata1schemas1tza1insurance1service1CustomerDetails_66id.setLastName(lastName_67idTemp);
com1teradata1schemas1tza1insurance1service1CustomerDetails_66id.setMiddleName(middleName_68idTemp);
com1teradata1schemas1tza1insurance1service1CustomerDetails_66id.setDateOfBirth(dateOfBirth_69idTemp);
com1teradata1schemas1tza1insurance1service1CustomerDetails_66id.setFirstName(firstName_70idTemp);
com1teradata1schemas1tza1insurance1service1CustomerDetails_66id.setPrefix(prefix_71idTemp);
com1teradata1schemas1tza1insurance1service1CustomerDetails_66id.setSalutation(salutation_72idTemp);
%>
<jsp:useBean id="com1teradata1schemas1tza1insurance1service1PolicyRequest_34id" scope="session" class="com.teradata.schemas.tza.insurance.service.PolicyRequest" />
<%
com1teradata1schemas1tza1insurance1service1PolicyRequest_34id.setClient(com1teradata1schemas1tza1insurance1service1ClientDetails_35id);
com1teradata1schemas1tza1insurance1service1PolicyRequest_34id.setQuotation(com1teradata1schemas1tza1insurance1service1QuotationDetails_39id);
com1teradata1schemas1tza1insurance1service1PolicyRequest_34id.setProperty(com1teradata1schemas1tza1insurance1service1PropertyDetails_45id);
com1teradata1schemas1tza1insurance1service1PolicyRequest_34id.setCustomer(com1teradata1schemas1tza1insurance1service1CustomerDetails_66id);
com.teradata.schemas.tza.insurance.service.PolicyResponse buyPolicy94mtemp = samplePropertyInsuranceProxyid.buyPolicy(com1teradata1schemas1tza1insurance1service1PolicyRequest_34id);
if(buyPolicy94mtemp == null){
%>
<%=buyPolicy94mtemp %>
<%
}else{
%>
<TABLE>
<TR>
<TD COLSPAN="3" ALIGN="LEFT">returnp:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD COLSPAN="2" ALIGN="LEFT">quotation:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">clientOrgCode:</TD>
<TD>
<%
if(buyPolicy94mtemp != null){
com.teradata.schemas.tza.insurance.service.QuotationDetails tebece0=buyPolicy94mtemp.getQuotation();
if(tebece0 != null){
java.lang.String typeclientOrgCode99 = tebece0.getClientOrgCode();
String tempResultclientOrgCode99 = org.eclipse.jst.ws.util.JspUtils.markup(String.valueOf(typeclientOrgCode99));
%>
<%= tempResultclientOrgCode99 %>
<%
}}%>
</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">expiryDate:</TD>
<TD>
<%
if(buyPolicy94mtemp != null){
com.teradata.schemas.tza.insurance.service.QuotationDetails tebece0=buyPolicy94mtemp.getQuotation();
if(tebece0 != null){
java.util.Date typeexpiryDate101 = tebece0.getExpiryDate();
java.text.DateFormat dateFormatexpiryDate101 = java.text.DateFormat.getDateInstance();
String tempResultexpiryDate101 = org.eclipse.jst.ws.util.JspUtils.markup(dateFormatexpiryDate101.format(typeexpiryDate101));
%>
<%= tempResultexpiryDate101 %>
<%
}}%>
</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">currencyCode:</TD>
<TD>
<%
if(buyPolicy94mtemp != null){
com.teradata.schemas.tza.insurance.service.QuotationDetails tebece0=buyPolicy94mtemp.getQuotation();
if(tebece0 != null){
java.lang.String typecurrencyCode103 = tebece0.getCurrencyCode();
String tempResultcurrencyCode103 = org.eclipse.jst.ws.util.JspUtils.markup(String.valueOf(typecurrencyCode103));
%>
<%= tempResultcurrencyCode103 %>
<%
}}%>
</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">quotation:</TD>
<TD>
<%
if(buyPolicy94mtemp != null){
com.teradata.schemas.tza.insurance.service.QuotationDetails tebece0=buyPolicy94mtemp.getQuotation();
if(tebece0 != null){
java.math.BigDecimal typequotation105 = tebece0.getQuotation();
String tempResultquotation105 = org.eclipse.jst.ws.util.JspUtils.markup(typequotation105.toString());
%>
<%= tempResultquotation105 %>
<%
}}%>
</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">referenceNumber:</TD>
<TD>
<%
if(buyPolicy94mtemp != null){
com.teradata.schemas.tza.insurance.service.QuotationDetails tebece0=buyPolicy94mtemp.getQuotation();
if(tebece0 != null){
java.lang.String typereferenceNumber107 = tebece0.getReferenceNumber();
String tempResultreferenceNumber107 = org.eclipse.jst.ws.util.JspUtils.markup(String.valueOf(typereferenceNumber107));
%>
<%= tempResultreferenceNumber107 %>
<%
}}%>
</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD COLSPAN="2" ALIGN="LEFT">policy:</TD>
<TR>
<TD WIDTH="5%"></TD>
<TD WIDTH="5%"></TD>
<TD COLSPAN="1" ALIGN="LEFT">referenceNumber:</TD>
<TD>
<%
if(buyPolicy94mtemp != null){
com.teradata.schemas.tza.insurance.service.PolicyDetails tebece0=buyPolicy94mtemp.getPolicy();
if(tebece0 != null){
java.lang.String typereferenceNumber111 = tebece0.getReferenceNumber();
String tempResultreferenceNumber111 = org.eclipse.jst.ws.util.JspUtils.markup(String.valueOf(typereferenceNumber111));
%>
<%= tempResultreferenceNumber111 %>
<%
}}%>
</TD>
</TABLE>
<%
}
break;
}
} catch (Exception e) {
%>
exception: <%= e %>
<%
return;
}
if(!gotMethod){
%>
result: N/A
<%
}
%>
</BODY>
</HTML>

Completing the Web service

The Eclipse WTP Web service Wizard in combination with AXIS does a great job of generating all of the standard Web service plumbing code that is required to handle Web service requests.

It generates Java classes to represent the various elements represented by the original XML Schema documents and places them in an appropriate Java package (com.teradata.tza.insurance.service.schemas). These will subsequently be used as the Web service Presentation Veneer level Business Objects.

It also generates (within the package com.teradata.tza.insurance.service) support classes such as ParameterFault.java, ExpiredQuotation.java and a series of Web service plumbing classes like PropertyInsuranceService.java, PropertyInsuranceSoapBindingSkeleton.java etc.

Finally it imports the Web service libraries (axis, commons-discovery, commons-logging, jaxrpc, saaj and wsdl4j) into the web/lib folder of the project as show below.

Project Explorer Source and Libraries

All of these classes, bar one, can be left completely alone, they are standard Web services plumbing automatically generated by the tooling from the WSDL contract.

SoapBindingImpl

The one class of interest to the developer, who must implement the Web service Presentation Veneer, is the SoapBindingImpl class (here it is PropertyInsuranceSoapBindingImpl.java). This is the Web service entry point or transition point between the Web service plumbing and the underlying Business Process. It, like any other Presentation Veneer, is expected to Validate Parameters, Authenticate the user and orchestrate the use of the underlying Business processes in order to provide some response to the calling user. As generated by the tooling it looks like this:

/**
* PropertyInsuranceSoapBindingImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/

package com.teradata.tza.insurance.service;

public class PropertyInsuranceSoapBindingImpl implements com.teradata.tza.insurance.service.PropertyInsurance
{
public com.teradata.schemas.tza.insurance.service.QuoteResponse
getQuote(com.teradata.schemas.tza.insurance.service.QuoteRequest quoteRequest)
throws java.rmi.RemoteException, com.teradata.tza.insurance.service.ParameterFault
{
return null;
}

public com.teradata.schemas.tza.insurance.service.PolicyResponse
buyPolicy(com.teradata.schemas.tza.insurance.service.PolicyRequest policyRequest)
throws java.rmi.RemoteException, com.teradata.tza.insurance.service.ParameterFault, com.teradata.tza.insurance.service.ExpiredQuotation
{
return null;
}
}

In order to complete our initial test of the Web service it is necessary to, temporarily, add a small amount of code to the getQuote method of the PropertyInsuranceSoapBindingImpl.java file.

  • Open the PropertyInsuranceSoapBindingImpl.java (this can be found in the src/java/com.teradata.tza.insurance.service package of the TZA-InsuranceService project).
  • Replace the default "return null;" within the getQuote method with the following code using copy and paste:
// Initialize the QuoteReponse and QuotationDetails
com.teradata.schemas.tza.insurance.service.QuoteResponse quoteResponse =
new com.teradata.schemas.tza.insurance.service.QuoteResponse();

com.teradata.schemas.tza.insurance.service.QuotationDetails quotationDetails =
new com.teradata.schemas.tza.insurance.service.QuotationDetails();

quotationDetails.setClientOrgCode(quoteRequest.getClient().getOrgCode());
quotationDetails.setCurrencyCode("USD");
quotationDetails.setExpiryDate(new java.util.Date());
quotationDetails.setQuotation(new java.math.BigDecimal("100.00"));
quotationDetails.setReferenceNumber(new Integer(new java.util.Random().nextInt()).toString());

// Add the QuotationDetails to the QuoteResponse
quoteResponse.setQuotation(quotationDetails);

return quoteResponse;
  • Save the file (File -> Save or Save Icon).

Restart the Application Server

Changes to the Java code typically require that the application server be restarted in order to load up the new classes into memory.

  • Restart the Server using the Start Icon on the Server View

Restart Server

  • Within the Web Services Test Client browser select the getQuote method in the Methods frame.
  • Scroll down through the Inputs frame and Select the Invoke button.
  • Examine the Web service response in the Result frame.

Web service Test Client


So you now have a WS-I, Contract First, Stateless Web service, perfect if all you ever want to do is issue Property Insurance quotes of 100 USD.

There might be a business model in there somewhere Toto; however, it is probably better to Leverage and Reuse all the good work we did in the previous weeks to build the TZA-Database and the Simple Quotation Engine. Next week on the Friday Night Project we will wire this Web service into the Simple Quotation Engine.