cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

JAX-RPC Web Service Client

Author: Jaroslav Pospisil
Version: 1.2
Last update: 12.3.2006
Introduction:

This test specification should test Web service client creation in J2SE and J2EE project. The specification covers developing of simple web service client in NetBeans 5.5.
Latest features allow to create also Web Service Client on JavaEE5 on SJAS 9(Glassfish).It differs from the previous one in a great way, so there's additional test suite for
JavaEE5 WSC and another test suite for new Application Client project type, which also allows using WSC.

Comment:

This test specification is based on End - to - end scenarios, written by Lukas Jungmann.




Table of Contents






Test suite 1: Web Service Client in J2SE application

Purpose: Functionality of J2SE WS Client.
Setup: First make sure Sun Application App Server is installed and add it in Runtime tab.
Create new Web Service of name MyWS.Invoke wizard File|New Project|Web|Web Application or File|New Project|Enterprise|EJB Module and then
File|Web Services|Web Service.Add operation to new web service - open Web Services node and right-click on service to invoke Context menu, select "Add Operation"
action and click "OK" in next dialog.In editor change return value of the operation to return "Hello".Deploy project and then Add service to registry by the same way
as adding operation, but selecting Add to Registry instead.Good advice - copy WSDL URL address shown in textfield to clipboard, we'll use it later.
Create new Java Application - go to File|New Project|General|Java Application.
Specify Hello as Project Name.
Specify project's directory.
Specify org.netbeans.hello.Main as project main class.
Click Finish.

#Test caseDescription
1Create web service client
1. Go to File|New File|Web services|Web Service Client|Next.
2. Specify WSDL - there are now three ways to do it. First copy URL from clipboard as Running Web Service WSDL URL,then you could specify project,where is web
service located.Third way is to specify wsdl file on hard disc.Try all three ways to test ws client.
3. Optional: if you're behind proxy check its settings via Proxy settings... button.
4. Specify package for the client, eg. org.netbeans.hello.client.
5. Select IDE-generated static stub as client type.
6. Click Retrieve WSDL.
7. Click Finish.
RESULT: In Projects tab|Hello open Web Service References node.Click on it and there should be reference to MyWS web service. .
2Test web service
1. Go to Projects tab|Hello|Web Service References|MyWS|MyWSSEIport|operation node.
2. Right-click on operation and then select "Test Operation"
3. In next window click on "Submit".
RESULT: You should see string "Hello" in Results|Value textbox of the same window .
3Refresh WSDL
1. Go to Projects tab|Hello|Web Service References|MyWS.
2. Right-click on web service and then select "Refresh WSDL"
RESULT: WSDL of web service in client will be updated .
4Delete web service client
1. Projects tab|Hello|Web Service References|MyWS node.
2. Right-click on web service and then select "Delete" and twice "Yes" in next windows.
RESULT: Web service (and Web Service references node,if the service was last one) should disappear from Projects tab .
Teardown:




Test suite 2: Web Service Client in J2EE application (J2EE 1.4)

Purpose: Functionality of J2EE WS Client.
Setup: First make sure Sun Application App Server is installed and add it in Runtime tab.
Create new Web Service of name MyWS.Invoke wizard File|New Project|Web|Web Application or File|New Project|Enterprise|EJB Module and then
File|Web Services|Web Service.Add operation to new web service - open Web Services node and right-click on service to invoke Context menu, select "Add Operation"
action and click "OK" in next dialog.In editor change return value of the operation to return "Hello".Deploy project and then Add service to registry by the same way
as adding operation, but selecting Add to Registry instead.Good advice - copy WSDL URL address shown in textfield to clipboard, we'll use it later.
Create new Web Application - go to File|New Project|Web|Web Application.
Specify Hello as Project Name.
Specify project's directory.
Select Sun App server as target server.
Click Finish.

#Test caseDescription
1Create web service client
1. Go to File|New File|Web services|Web Service Client|Next.
2. Specify WSDL - there are now three ways to do it. First copy URL from clipboard as Running Web Service WSDL URL,then you could specify project,where is web
service located.Third way is to specify wsdl file on hard disc.Try all three ways to test ws client.
3. Optional: if you're behind proxy check its settings via Proxy settings... button.
4. Specify package for the client, eg. org.netbeans.hello.client.
5. Select IDE-generated static stub as client type.
6. Click Retrieve WSDL.
7. Click Finish.
RESULT: In Projects tab|Hello open Web Service References node.Click on it and there should be reference to MyWS web service. .
2Test web service
1. Go to Projects tab|Hello|Web Service References|MyWS|MyWSSEIport|operation node.
2. Right-click on operation and then select "Test Operation"
3. In next window click on "Submit".
RESULT: You should see string "Hello" in Results|Value textbox of the same window .
3Refresh WSDL
1. Go to Projects tab|Hello|Web Service References|MyWS.
2. Right-click on web service and then select "Refresh WSDL"
RESULT: WSDL of web service in client will be updated .
4Delete web service client
1. Projects tab|Hello|Web Service References|MyWS node.
2. Right-click on web service and then select "Delete" and twice "Yes" in next windows.
RESULT: Web service (and Web Service references node,if the service was last one) should disappear from Projects tab .
Teardown:




Test suite 3: Web Service Client in J2EE application (JavaEE5)

Purpose: Functionality of JavaEE5 WS Client.
Setup: First make sure Glassfish(SJAS9) is installed and add it in Runtime tab.
Create new Web Service of name MyWS.Invoke wizard File|New Project|Web|Web Application or File|New Project|Enterprise|EJB Module and then
File|Web Services|Web Service.Don't forget to check, if J2EE version is set to JavaEE5 in project wizard ,othervise change it. Operation operation will
be automatically created. Deploy project.Right-click on web sesvice node in project and select Properties.Copy WSDL URL address shown in textfield to
clipboard, we'll use it later.
Create new Web Application - go to File|New Project|Web|Web Application.Don't forget to check, if J2EE version is set to JavaEE5 in project wizard ,othervise change it.
Specify Hello as Project Name.
Specify project's directory.
Select Glassfish(SJAS9) as target server.
Click Finish.

#Test caseDescription
1Create web service client
1. Go to File|New File|Web services|Web Service Client|Next.
2. Specify WSDL - there are now three ways to do it. First copy URL from clipboard as Running Web Service WSDL URL,then you could specify project,where is web
service located.Third way is to specify wsdl file on hard disc.Try all three ways to test ws client. 3. Optional: if you're behind proxy check its settings via Proxy settings... button.
4. Specify package for the client, eg. org.netbeans.hello.client.
5. Select IDE-generated static stub as client type.
6. Click Retrieve WSDL.
7. Click Finish.
RESULT: In Projects tab|Hello open Web Service References node.Click on it and there should be reference to MyWS web service. .
2Test web service
1. Go to Projects tab|Hello|Web Service References|MyWS.
2. Right-click on service and then select "TestWen Service"
3. Browser will open window, where you'll be asked to enter an input string.
4. Then click on button.
RESULT: You should see string you entered,in results browser window .
3Refresh WSDL
1. Go to Projects tab|Hello|Web Service References|MyWS.
2. Right-click on web service and then select "Refresh WSDL"
RESULT: WSDL of web service in client will be updated .
4Edit Web Service Attributes
1. Go to Projects tab|Hello|Web Service References|MyWS.
2. Right-click on web service and then select "Edit Web Service Attributes"
RESULT: WSDL Customization table will open and you could change ws attributes like ports or bindings .
5Configure Handlers
1. Go to Projects tab|Hello|Web Service References|MyWS.
2. Right-click on web service and then select "Configure Handlers"
RESULT: Configure Handlers dialog window of web service will open.
6Delete web service client
1. Projects tab|Hello|Web Service References|MyWS node.
2. Right-click on web service and then select "Delete" and twice "Yes" in next windows.
RESULT: Web service (and Web Service references node,if the service was last one) should disappear from Projects tab .
Teardown:




Test suite 4: Web Service Client in Application Client (J2EE1.4 or JavaEE5)

Purpose: Functionality of WS Client in Application Client.
Setup: First make sure Glassfish(SJAS9) is installed and add it in Runtime tab.
Create new Web Service of name MyWS.Invoke wizard File|New Project|Web|Web Application or File|New Project|Enterprise|EJB Module and then
File|Web Services|Web Service.Add operation to new web service - open Web Services node and right-click on service to invoke Context menu, select "Add Operation"
action and click "OK" in next dialog.In editor change return value of the operation to return "Hello".Deploy project and then Add service to registry by the same way
as adding operation, but selecting Add to Registry instead.Good advice - copy WSDL URL address shown in textfield to clipboard, we'll use it later.
Create new Application Client - go to File|New Project|Enterprise|Application Client.Select J2EE version and test with each of two choices.
Specify Hello as Project Name.
Specify project's directory.
Select Glassfish(SJAS9) as target server.
Click Finish.

#Test caseDescription
1Testing web service client
According to J2EE version selected whe you created the Application Client, test it the same way as J2SE web service client (if J2EE 1.4 selected) or
J2EE(JavaEE5) web service client (if selected JavaEE5).
RESULT: Results should be the same as of the J2SE or J2EE(JavaEE5) web service client.
Teardown:





Generated: Thu Feb 23 12:24:12 CEST 2006
Companion
Projects:
MySQL Database Server   GlassFish Community: an Open Source Application Server   Open Solaris  Open JDK: an Open SourceJDK   Mobile & Embedded Community     Sponsored by 
Sponsored by Sun Microsystems