Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in Calling Web service Through SSL

 
Nilu Deshmukh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am Trying to call a web service Client in my code but it gives following error



My Code is As follows
web service call ...

 
Nilu Deshmukh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I searched through google and found that its issue in Certificate installation..
can any one tell me how to install a certificate in trustore.

Thanks in Advance..
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I have a step-by-step guide on how to set up certificates for ordinary SSL and mutual authentication in my SCDJWS study notes, which you can find here: http://faq.javaranch.com/content/Exam-Objectives-5.pdf
Take a look at section 8.3. Hope this is of any help!
Best wishes!
 
Nilu Deshmukh
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks For Yor Help.

I came to new the Problem. The Prblem is in Java keystore. JDK is not able to load the keystore. that why i can call the web service through browser https. but not through my code..

So Please Tell me how to load the certificat in JDK or do I need to set any Security Policy for my code....

Becase when I check the system Property through java code... it gives null.

 
Leonardo Rodriguez
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I run in this problem in an Jboss with some EARs previously deployed, after a lot of test I realize that the problem was the the System/ssl variables set by other EAR, so the fix is remove ssl properties before invoke Axis.


 
charles jones
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found some resource in http://www.longhowl.com/howls/144
 
Jitao Liu
Greenhorn
Posts: 2
Android Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that: I got the final solution to this issue:

Properties p = System.getProperties();
System.getProperties().put("javax.net.ssl.trustStore", "C:/Documents and Settings/rc3570/.keystore");
System.getProperties().put("javax.net.ssl.trustStorePassword", "password");
WelcomeTestImplServiceLocator welcomeTestImplServiceLocator = new WelcomeTestImplServiceLocator();
WelcomeTest welcomeTest = welcomeTestImplServiceLocator.getWelcomeTestImplPort();
// to use Basic HTTP Authentication:
((Stub)welcomeTest)._setProperty(Call.USERNAME_PROPERTY, "admin");
((Stub)welcomeTest)._setProperty(Call.PASSWORD_PROPERTY, "password");
System.out.println(welcomeTest.getWelcomeTestStringWithName("jitao"));

Note: before build the client, need to create ./keystore
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic