File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Web service URL fails with 'https', not 'http' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Web service URL fails with Watch "Web service URL fails with New topic
Author

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

Michael Scott
Ranch Hand

Joined: Jan 20, 2003
Posts: 57
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

Joined: Aug 19, 2005
Posts: 2922
    
    5
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

Joined: Jan 20, 2003
Posts: 57
Thanks Peer. The links you provided contain much useful information.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web service URL fails with 'https', not 'http'