This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
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
Register / Login


JavaRanch » Java Forums » Java » Web Services
Reply 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: 2906
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))


"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Web service URL fails with 'https', not 'http'
 
Similar Threads
SAAJ
Soap response contains wsdl
Soap Error
SOAPMessage Frights
SAAJ - Empty SOAP Response / Null Pointer Exception