I am developing a Java desktop application and I want to consume a web service in it. The web service requires two-way SSL connection with message level security using binarysecuritytoken. I am using NetBeans IDE 6.9.1 with JDK 1.6.0.23 and JAX-WS as ws wrapper. How can I communicate with the ws without using any web server on client machine. Most of the stuff I read needs to have tomcat or some other web server on client machine (configuring the keystore in tomcat or so...). Is it possible to do? Please suggest some article for SSL based ws client for Java desktop application.
-
1In simple words, i need a J2SE solution for consuming SSL-secured web service without using any J2EE containerTausif Baber– Tausif Baber2011-01-18 12:03:31 +00:00Commented Jan 18, 2011 at 12:03
Add a comment
|
1 Answer
Consuming web services in JavaSE - see NetBeans tutorial
Use BindingProvider to set your properties before you invoke the service. See example of using BindingProvider here
7 Comments
Tausif Baber
How to Sign the SOAPHeader using the BindingProvidor?? I want to add a signed SOAPHeader to the request/port generated by JAX-WS. There are extensions of BindingProvidor such as WSBindingProvider in jaxws-rt but it also uses J2EE container.
Chuk Lee
When the webservice publish the WSDL, there will be security descriptors. You will then use wsimport to generate the client side artifact from the WSDL document then configure it appropriately. There is a simple tutorial (a bit dated but the concepts are all there) here (netbeans.org/kb/docs/websvc/wsit.html) using Netbeans.
Chuk Lee
What I mention above is message level security. If you just want to secure point-to-point with SSL, then see this java-tips.org/java-ee-tips/java-api-for-xml-web-services/…
Tausif Baber
So there is no solution for the problem. I have to install either a web server(Tomcat) or an application server(Glassfish) on every client machine to run a small application. Even for custom SoapHeaders there is no built-in mechanism in J2SE and one has to use WSS4J, axis or metro (for example accessing BinarySecurityToken or SecurityTokenReference)
Chuk Lee
You mentioned in your question that you want to consume webserivce in JavaSE. In JDK6, there is a wsimport tool which generates the artifact for a deployed service. If the deployed service has security descriptors in the wSDL, then wsimport will generate a corresponding set of handlers for you like BinarySecurityToken, etc.
|