Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web service URL fails with 'https', not 'http'

 
Michael Scott
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following is some of the code I use to connect to a web service. This code functions only if the web service URL starts with 'http' rather than 'https' even though both URL's are valid.

I'd appreciate any ideas on why the code fails when the web service URL starts with 'https', but not when 'http' is used. Thanks.

The error is also included below.
_______________________________________
CODE:


SOAPMessage message = null;
SOAPMessage response = null;
private String EndPointUrl = null;
_________________________________________________
SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
SOAPConnection con = scFactory.createConnection();

EndPointUrl = "http:// ... "; // web service URL

URLEndpoint endpoint = new URLEndpoint(EndPointUrl);
response = con.call(message, endpoint);
__________________________________________________

ERROR:


javax.xml.soap.SOAPException: java.net.MalformedURLException: unknown protocol: https at org.apache.axis.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:93)
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using SSL with Axis
Web Services Over SSL - HOW TO
Chapter 11: Web Service Security (PDF) (Page 18)
Chapter 3: SAAJ (PDF) Setting up the client system (page 156 (73))
 
Michael Scott
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peer. The links you provided contain much useful information.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic