2 Replies Latest reply: May 6, 2013 4:09 AM by Ajay Sharma RSS

    Unable to test https Web service url.

    Ajay Sharma
      Hi,

      I deployed a Java web service on Glassfish server. While testing the web service I got two URL.
      Links:
      [server]     http://AJAYPC:8787/TestWS/TWS?Tester
      [server]     https://AJAYPC:8181/TestWS/TWS?Tester
      I am able to test web service using first url but when I clicked on url with "https" I got following error on browser
      Error generating artifacts for the following WSDL https://AJAYPC:8181/TestWS/TWS?WSDL
      
      Possible causes can be invoking https when the application is not configured for security
      How can I test the https URL ?

      regards,
      Ajay Sharma
        • 1. Re: Unable to test https Web service url.
          r035198x
          Have you configured the application for https?
          http://docs.oracle.com/cd/E17802_01/webservices/webservices/reference/tutorials/wsit/doc/WSIT_Security5.html
          • 2. Re: Unable to test https Web service url.
            Ajay Sharma
            Hi,

            Thanks You.

            I added following code in web service class
            static {
                //WORKAROUND. TO BE REMOVED.
            
                    HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
            
                        @Override
                        public boolean verify(String hostname, SSLSession sslSession) {
                            
                            if(hostname.equals("AJAYPC")){
                                return true;
                            }
                            return false;
                            //throw new UnsupportedOperationException("Not supported yet.");
                        }
                    });
                }
            Now I am getting following response on browser:
            TWS is a secured web service; Tester feature is not supported for secured services
            How can I test the web service ?


            Regards,
            Ajay Sharma