java cxf webservice 监听所有IP

public void StartWebService() throws Exception
    {
        JettyHTTPServerEngineFactory eg = new JettyHTTPServerEngineFactory();
        eg.createJettyHTTPServerEngine(9000,"http");
        
        
        WebServiceMethod webServiceMethod = new WebServiceMethod();
        ServerFactoryBean svrFactory = new ServerFactoryBean();
        svrFactory.setServiceClass(WebServiceMethod.class);
        svrFactory.setAddress("http://localhost:9000/Hello");
        svrFactory.setServiceBean(webServiceMethod);
        // svrFactory.getServiceFactory().setDataBinding(new
        // AegisDatabinding());    
        svrFactory.create();
    }


http://cxf.547215.n5.nabble.com/Virtual-host-with-jetty-standalone-RS-WS-need-help-td3414715.html

From Java, I THINK you can do something like:

bus.getExtention(JettyHTTPServerEngine.class)
     .createJettyHTTPServerEngine(null, 8080, "http");

and that will create the connector for the port on all hosts, not the one for
the passed in host.    Not 100% sure though.
 

 

原文地址:https://www.cnblogs.com/baishahe/p/2020734.html