Sun Java System Application Server |
<?xml version="1.0" encoding="UTF-8"?>Once the endpoint is deployed, you can access the service using https protocol (instead of http) as follows, and see the
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
<context-root>ssl-jaxws</context-root>
<servlet>
<servlet-name>Tax</servlet-name>
<webservice-endpoint>
<!-- default name is namePort -->
<port-component-name>Tax</port-component-name>
<!-- default name service_name/name -->
<endpoint-address-uri>TaxService</endpoint-address-uri>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</webservice-endpoint>
</servlet>
</sun-web-app>
<soap:address
location="https://..">
in the wsdl file with https protocol:https://localhost:8181/ssl-jaxws-war/TaxService?wsdl
set
VMARGS=-Djavax.net.ssl.trustStore=${javaee.domaindir}/config/cacerts.jks
where cacerts.jks is the default trust store for the application
server.
${javaee.home}/bin/wsimport -d ./build
http://${javaee.server.name}:${javaee.server.port}/ssl-jaxws-war/TaxService?wsdl"/>
set
VMARGS=-Djavax.net.ssl.trustStore=${javaee.domaindir}/config/cacerts.jks
cd ./build
${javaee.home}/bin/appclient
webservices.ssl_jaxws_appclient.TaxCalClient income deductions
To debug whether SSL is involved or not, you can add -Djavax.net.debug=SSL,handshake
(JSSE system property) to VMARGS. During runtime you can see all the
activities of ssl handshake.
The source code can be viewed by clicking these links: jax-ws
web service and client.
Follow these instructions to build, deploy, and run this sample application.
app_dir
is the sample application base
directory: samples_install_dir/javaee5/webservices/ssl-jaxws-ear
.
Change directory to app_dir.
app_dir>
ant
all
run-client:
[exec] Invoking TaxService...
[exec] Income=90000.0
[exec] Deductions=10000.0
[exec] Federal tax=16000.0
Working with NetBeans team to make this sample work in NetBeans IDE. Will update this section with the progress.
If you have problems when running the application, refer to troubleshooting document.
If you see the following certificate error, make sure that the VMARGS (for appclient) or -Djavax.net.ssl.trustStore (for Java SE client) environment has the trust store path.
javax.xml.ws.WebServiceException: HTTP transport error:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: No trusted certificate found