aspose file tools
The moose likes Web Services and the fly likes HTTPS soap call using SAAJ Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "HTTPS soap call using SAAJ" Watch "HTTPS soap call using SAAJ" New topic
Author

HTTPS soap call using SAAJ

sriraman seshadri
Greenhorn

Joined: May 25, 2010
Posts: 7
Hi,

We are currently having a soap client as below

SOAPConnectionFactory soapConnFactory = SOAPConnectionFactory.newInstance();
SOAPConnection connection = soapConnFactory.createConnection();

URL url = new URL("http://localhost:8001/ws/services/TestService");


SOAPMessage msg = message;
msg.writeTo(System.out);

SOAPMessage reply = connection.call(msg,url );

This works fine for HTTp connection. Now we need to change it to HTTS connection.
We have installed the server certificate in our local machine.
now we need to change the above client code to support https.
One solution is to set the system properties
(System.setProperty("javax.net.ssl.keyStore", "")
System.setProperty("javax.net.ssl.keyStorePassword", "")
System.setProperty("javax.net.ssl.trustStore", "")
System.setProperty("javax.net.ssl.trustStorePassword", ""))

Is there any other way other than setting the system property to achieve https connection in SAAJ ?

Ivan Krizsan
Bartender

Joined: Oct 04, 2006
Posts: 2193
Hi!
Have you seen this webpage? http://java.sun.com/webservices/docs/2.0/saaj/saaj-security.html
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTPS soap call using SAAJ
 
Similar Threads
java.security.PrivilegedActionException: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl:
SOAPException: Error opening socket
Connection pooling of SOAPConnection objects
Java 1.3 client code to call a web service in secured mode "(using ssl)
How do I call doPost?