|
@@ -8,6 +8,7 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
|
|
|
|
|
import javax.xml.ws.Endpoint;
|
|
|
+import java.net.InetAddress;
|
|
|
|
|
|
@SpringBootApplication
|
|
|
@Slf4j
|
|
@@ -18,10 +19,17 @@ public class ThmzApplication extends SpringBootServletInitializer {
|
|
|
SpringApplication.run(ThmzApplication.class, args);
|
|
|
|
|
|
//发布webservice服务
|
|
|
- String address = "http://127.0.0.1:7611/webService/criticalWebService";
|
|
|
- //发布WebService,WebServiceImpl类是WebServie接口的具体实现类
|
|
|
- Endpoint.publish(address, new CriticalWebServiceImpl());
|
|
|
- System.out.println("使用WebServicePublishListener发布webservice成功!");
|
|
|
+ try {
|
|
|
+ InetAddress ia=InetAddress.getLocalHost();
|
|
|
+ String localip=ia.getHostAddress();
|
|
|
+ String address = "http://"+localip+":7611/webService/criticalWebService";
|
|
|
+ //发布WebService,WebServiceImpl类是WebServie接口的具体实现类
|
|
|
+ Endpoint.publish(address, new CriticalWebServiceImpl());
|
|
|
+ System.out.println("使用WebServicePublishListener发布webservice成功!");
|
|
|
+ } catch (Exception e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override//为了打包springboot项目
|