skip to main |
skip to sidebar
Exercise 13-1
- Generate SSL artefacts
- Edit certgen.bat (do not double click). Adapt the paths at the top of the file to reflect the correct paths on your machine.
- The individual steps that are executed by the script are explained in Practice A-2
- Run the script from the command line
- Configure WebLogic for WS-Security
- Edit sslconfig.bat (do not double click). Adapt the paths at the top of the file to reflect the correct paths on your machine.
- Edit sslconfig.py. Adapt the paths at the top of the file to reflect the correct paths on your machine.
- The script uses the WebLogic Scripting Tool (WLST). The same procedure using the administration Console is explained in Practice A-3.
- If WebLogic is not running, start it.
- run sslconfig.bat from the command line
- The script stops WebLogic. Start it again afterwards.
- Connect to the WebLogic Admin Console over SSL, using URL
https://localhost:7002/console
- The browser warns you because it does not know the certificate authority
- Verify the certificate
- Approve the connection
- Open theCardDecksWS project
- If you did not enable JAX-WS HTTP dumping in Excercise 5-7, do it now.
- Add a new library to NetBeans using Tools> Ant Libraries
- Create a new library
- Name: WebLogic Web Services API
- Type: Server Libraries
- Press Add JAR/Folder, browse to the WebLogic folder and add modules/ws.api_2.0.0.0.jar
- Click OK
- Add the "WebLogic Web Services API" library to the CardDecksWS project
- View the policy file you will use
- Expand Libraries> Oracle WebLogic Server> weblogic.jar> weblogic.wsee.policy.runtime
- Double click Wssp1.2-2007-Wss1.1-UsernameToken-Plain-X509-Basic256.xml
- Examine the file
- Close the file
- Open ejbs.CardDeckSessionBean.java
- Annotate the class with @Policy to
- use the policy you have just viewed
- add it to the WSDL
- Using the @Policies and @Policy annotation on every method indicate that
- webservice calls should be signed
- webservice calls should be encrypted
- this should be added to the WSDL
- Correct any errors and save
- View the WSDL at http://localhost:7001/CardDeckSessionBean/CardDeckSessionBeanService?wsdl
- Notice the wsp1_2:Policy elements that have been added
- Open the GenericCardGameWS project in NetBeans
- Open games.CardGameService
- After the creation of the port in the createCardGame method, add code to use WS-Security, as shown in slides 13-17 to 13-19
- Refresh the JAX-WS artefacts and cached WSDL
- In the Web Service References Node, right click the CardDeckSessionBeanService and choose Refresh
- Select the checkbox to also replace the WSDL
- Click Yes
- Correct any errors and save
- Clear the WebLogic Server Output window (right click>clear)
- Open the Weblogic Test Client at http://localhost:7001/wls_utc
- Enter WSDL http://localhost:7001/GenericCardGameWS/CardGameService?wsdl
- Create a cardGame with 1 deck and 2 jokers
- Inspect the SOAP messages
- View the Oracle WebLogic Server output window in NetBeans
- Compare the calls to Try to see the difference between the calls to
- CardGameService
- CardDeckSessionBeanService
Exercise 13-2
- Check the time between the first and last message in a call in the previous exercise
- In the CardGameService class, modify the usage of the CarDeckSessionBeanService. Apply the same kind of optimisations on the service as in step 2 in the activity guide.
- Apply the same kind of optimisations on the CarDeckSessionBean port as in step 3 in the activity guide
- Correct errors and save.
- Check the time again between the calls when creating a card game.
No comments:
Post a Comment