1 Reply Latest reply on Mar 8, 2014 5:03 PM by yerraguntla07

    Error invoking a web method on jax-ws based web service on SSL enabled JBoss AS

    sadav

      My aim is to get proper result/response from a web method of a jax-ws based web service on SSL enabled server (wsdl location is known and the web service client is created successfully using NetBeans). Everything works properly when the service is on normal http.

      I used a self signed certificate in the JBoss which hosts the web service. The certificate is imported into java keystore where the client JBoss is running. Part of the stack trace is as follows,

       

      11:39:27,825 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (http--127.0.0.1-8080-6) Creating Service {http://wshome.operations/}MyAPIService from WSDL: https://myhost.com:8443/testapiws/MyTestAPI?wsdl

      11:39:27,850 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (http--127.0.0.1-8080-6) Could not find a matching method for operation {http://wshome.operations/}AddOperation. Operation will be unavailable.

      11:39:27,857 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (http--127.0.0.1-8080-6) Could not find a matching method for operation {http://wshome.operations/}SubOperation. Operation will be unavailable.

      11:39:28,206 INFO  [stdout] (http--127.0.0.1-8080-6) MyServicesUtil: AddOperation Exception................javax.xml.ws.WebServiceException: Could not find wsdl:binding operation info for web method addOperation.

      11:39:28,207 ERROR [stderr] (http--127.0.0.1-8080-6) javax.xml.ws.WebServiceException: Could not find wsdl:binding operation info for web method addOperation.

      11:39:28,209 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:123) 11:39:28,210 ERROR [stderr] (http--127.0.0.1-8080-6)     at com.sun.proxy.$Proxy63.addOperation(Unknown Source)

      11:39:28,211 ERROR [stderr] (http--127.0.0.1-8080-6)     at mypackage.MyServicesUtil.addOperation(MyServicesUtil.java:39) 11:39:28,212 ERROR [stderr] (http--127.0.0.1-8080-6)     at mypackage.MyServicesUtil.addOperation(MyServicesUtil.java:100) 11:39:28,213 ERROR [stderr] (http--127.0.0.1-8080-6)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 11:39:28,216 ERROR [stderr] (http--127.0.0.1-8080-6)     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 11:39:28,217 ERROR [stderr] (http--127.0.0.1-8080-6)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 11:39:28,218 ERROR [stderr] (http--127.0.0.1-8080-6)     at java.lang.reflect.Method.invoke(Unknown Source)

      11:39:28,219 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.el.parser.AstValue.invoke(AstValue.java:262) 11:39:28,219 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)

      11:39:28,220 ERROR [stderr] (http--127.0.0.1-8080-6)     at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)

      11:39:28,222 ERROR [stderr] (http--127.0.0.1-8080-6)     at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) 11:39:28,223 ERROR [stderr] (http--127.0.0.1-8080-6)     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) 11:39:28,225 ERROR [stderr] (http--127.0.0.1-8080-6)     at javax.faces.component.UICommand.broadcast(UICommand.java:315) 11:39:28,226 ERROR [stderr] (http--127.0.0.1-8080-6)     at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794) 11:39:28,228 ERROR [stderr] (http--127.0.0.1-8080-6)     at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259) 11:39:28,229 ERROR [stderr] (http--127.0.0.1-8080-6)     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) 11:39:28,230 ERROR [stderr] (http--127.0.0.1-8080-6)     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) 11:39:28,231 ERROR [stderr] (http--127.0.0.1-8080-6)     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) 11:39:28,232 ERROR [stderr] (http--127.0.0.1-8080-6)     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) 11:39:28,233 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) 11:39:28,234 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) 11:39:28,235 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) 11:39:28,236 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) 11:39:28,237 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) 11:39:28,239 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) 11:39:28,240 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 11:39:28,241 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 11:39:28,242 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) 11:39:28,243 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) 11:39:28,245 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) 11:39:28,246 ERROR [stderr] (http--127.0.0.1-8080-6)     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) 11:39:28,247 ERROR [stderr] (http--127.0.0.1-8080-6)     at java.lang.Thread.run(Unknown Source)

       

      Please note that, invoking the service after disabling the certificate verification is also unsuccessful. Following code is used to disable certificate verification,

       

          TrustManager[] trustAllCerts = new TrustManager[] {new X509TrustManager() {
                  public java.security.cert.X509Certificate[] getAcceptedIssuers() {
                      return null;
                  }
                  public void checkClientTrusted(X509Certificate[] certs, String authType) {
                  }
                  public void checkServerTrusted(X509Certificate[] certs, String authType) {
                  }
              }
          };

       

          try {
          // Install the all-trusting trust manager
          SSLContext sc = SSLContext.getInstance("SSL");
          sc.init(null, trustAllCerts, new java.security.SecureRandom());
          HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());

       

          // Create all-trusting host name verifier
          HostnameVerifier allHostsValid = new HostnameVerifier() {
              public boolean verify(String hostname, SSLSession session) {
                  return true;
              }
          };

       

          // Install the all-trusting host verifier
          HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
          }
          catch (Exception Exc) {
            
          }
        

      Is there any specific configuration required on JBoss AS 7.1 to succesfully parse the wsdl document from a secure service and invoke the web method successfully? Please let me know work around. Thanks in advance....