[jboss-dev-forums] [JBoss Web Services Development] - Re: cxf.xml doesn't work under JBoss 6.1

Tao Sang do-not-reply at jboss.com
Mon Dec 12 06:27:47 EST 2011


Tao Sang [http://community.jboss.org/people/tao_dl] created the discussion

"Re: cxf.xml doesn't work under JBoss 6.1"

To view the discussion, visit: http://community.jboss.org/message/641046#641046

--------------------------------------------------------------
Hello Soldano, thanks a lot for your tipp! I solved the problem with the following line:

+System.setProperty("org.jboss.security.ignoreHttpsHost", "true");+

Another way to solve the problem is to use the +*JaxWsProxyFactoryBean*+ method:

MyWebServiceEndpoint port = null;

|  |  |  | JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); |  |  |  |
|  |  |  | //factory.getInInterceptors().add(new LoggingInInterceptor()); //Print feedback soap message |
|  |  |  | //factory.getOutInterceptors().add(new LoggingOutInterceptor()); //Print output soap message |
|  |  |  | factory.setServiceClass(MyWebServiceEndpoint.class); |
|  |  |  | factory.setAddress(_mbean.getMyWebServiceURL()); |
|  |  |  | port = (MyWebServiceEndpoint) factory.create(); |
|  |  |  | configHttpConduit(port); |

BindingProvider bp = (BindingProvider)port;
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, username);
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
...


private void configHttpConduit(Object service) {
        Client clientProxy = ClientProxy.getClient(service);

        HTTPConduit conduit = (HTTPConduit) clientProxy.getConduit();
        String targetAddr = conduit.getTarget().getAddress().getValue();
        if (targetAddr.toLowerCase().startsWith("https:")) {
            TrustManager[] simpleTrustManager = new TrustManager[] { new X509TrustManager() {
                public java.security.cert.X509Certificate[] getAcceptedIssuers() {
                    return null;
                }

                public void checkClientTrusted(
                        java.security.cert.X509Certificate[] certs, String authType) {
                }

                public void checkServerTrusted(
                        java.security.cert.X509Certificate[] certs, String authType) {
                }
            } };
            TLSClientParameters tlsParams = new TLSClientParameters();
            tlsParams.setTrustManagers(simpleTrustManager);
            tlsParams.setDisableCNCheck(true);
            tlsParams.setSecureSocketProtocol("SSL"); // This line is not very necessary.
            conduit.setTlsClientParameters(tlsParams);

        }
    }
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/641046#641046]

Start a new discussion in JBoss Web Services Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2047]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20111212/cff0a692/attachment.html 


More information about the jboss-dev-forums mailing list