InetAddress

		String ip = "";
		InetAddress addr;
		try {
			addr = InetAddress.getLocalHost();
			ip = addr.getHostAddress().toString();
		} catch (Exception e) {
			e.printStackTrace();
		}
		String url = "http://" + ip + ":29080/webservices/hellworld";
		System.out.println(url);
//		Endpoint.publish(url, new HelloWorld());

	

你可能感兴趣的:(InetAddress)