This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 2921
    
    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.
 
 
subject: Web service URL fails with 'https', not 'http'
 
Similar Threads
SAAJ
Soap response contains wsdl
SOAPMessage Frights
Soap Error
SAAJ - Empty SOAP Response / Null Pointer Exception