Bottom-up Web service with custom mapping
Description:
This test will cover the complex type and nested complex type buttom-up
Java Web service creation scenarios (custom mapping enabled). AddressBook
contains a complex type (Address), which also contains a complex type (PhoneNumber).
Instructions:
Unzip this into a directory:
Custom-MapAddressBookDiffPkg.zip
Part 1: Creating the Web Service using the Web Services Wizard.
Workspace set-up, and launching the wizard.
-
Create a dynamic Web project named address.
-
Select the "Java Resources" folder under the newly created "address" Web
Project, right click and choose "Import..."
-
Choose "File system", click next.
-
Choose the directory "Custom-MapAddressBookDiffPkg" and import
the directories and java files under "webservice"
-
Expand, and highlight on AddressBook.java in Web perspective.
-
Start Web services wizard by clicking on the "New Wizard" button located
at the top left-hand corner, then select Web services in the left listbox,
followed by the "Web service" in the right. Click Next.
Web Services page.
-
Choose "Java Web service" as the Web service type.
-
Enable "Generate a proxy" checkbox.
-
Enable "Test the generated proxy" checkbox.
-
Enable "Overwrite files without warning".
-
Enable "Create folders when necessary".
-
Click Next.
Service Deployment Configuration page
-
Under the Server-Side Deployment Selection, make sure "Apache Axis"
is selected as the Web service runtime.
-
choose server which supports Apache Axis 1. 0 (optional).
-
Accept the default Web project (address)
-
Under the Client-Side Environment Selection, ake sure "Apache Axis"
is selected.
-
choose server which supports Apache Axis.
-
Accept the default client Web project, or
-
enter your own Web project name (optional)
-
Click Next.
Web Service Java Bean Selection
-
Make sure the bean name is webservice.addressbookTest.AddressBook.
-
Click Next
Web Service Java Bean Identity
-
Enable the check box "Define custom mapping for package to namespace".
-
Click next.
Web Service package to namespace mapping
-
Click Add
-
replace "default.javapackage" under package to "webservice.addressbooksimple"
and replace "http://default.namespace" to "http://phone.test"
-
Click Add
-
replace "default.javapackage" under package to "webservice.addressbooktest"
and replace "http://default.namespace" to "http://service.test"
-
Click Add
-
replace "default.javapackage" under package to "webservice.addressbooktest2"
and replace "http://default.namespace" to "http://address.test"
-
Click Next repeatly and take everything as default, or Finish to complete
Web service creation with default settings (optional).
Web Service Test
-
Use the sample JSP and make sure you can invoke the service.