Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connecting to a Web Service over SSL

 
Dom Ryan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello fellow Java coders,

I am new to Web Services and SSL.
What I want to do is to connect to a Web Service that is running on SSL (https) from my client program that is running as a normal POJO using Axis classes. I have stored the certificate of the server in a keystore using the keytool, and have added it to my system properties using the following code:



The method used to execute the Web Service call is:



This doesnt work ... I get the following error:

Server did not recognize the value of HTTP Header SOAPAction: .


Any thoughts on what is going wrong would be of huge help!
Does the fetchWebServicesData() method need any additional code to connect to the server using SSL or is the current code sufficient?

Thanks in advance!
[ January 16, 2008: Message edited by: Dom Ryan ]
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welvcome to JavaRanch.

Does the code work when connecting to a non-SSL service? The error talks about a missing SOAPAction header, which has nothing to do with SSL or the lack of it.
 
Dom Ryan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey again,

Thanks for the fast reply!
You were so right, what I needed to do was set the SOAPAction request header to a correct value. After that it worked just as Id hoped.

One question remains though:
For the code mentioned above to run over SSL, will I need to make any modifications to it? Since the only SSL related feature that is being performed now is adding the keystore to the System properties. Dont I need to create some SSL socket or something like that, or will this happen automatically?

Thanks again for any help!
 
Chirayu Sapre
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post full source code for the web service call?
 
jose heitor
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dom,

Did you get your solution running?

I am just starting to investigate this and would appreciate some advice on all the steps to get this working...

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic