public class SearchInterClient {
public static void registIP(String hostIP,String remoteIP){
if(!hostIP.equals(remoteIP)){
if(!ParseIP.getHostIP().equals(ParseIP.getRemoteIP()))  //从机
ParseIP.writeIP(remoteIP);
Service srvcModel = new ObjectServiceFactory().create(SearchInter.class);
XFireProxyFactory factory = 
new XFireProxyFactory(XFireFactory.newInstance().getXFire()); String websearchURL = "http://"+remoteIP+":8080/godeep/services/CSService";
try {
SearchInter srvc = (SearchInter) factory.create(srvcModel, websearchURL);
srvc.registIP(hostIP);
} catch (MalformedURLException e) {

e.printStackTrace();
}
}
}
请高手讲解一下这段代码的大体意思

解决方案 »

  1.   

    new XFireProxyFactory(XFireFactory.newInstance().getXFire());
    这句是什么意思啊,能给解释一下吗
      

  2.   

    public class SearchInterClient {
    public static void registIP(String hostIP,String remoteIP){
    //判断本机ip是不是和远程ip相同
    if(!hostIP.equals(remoteIP)){
    //同上
    if(!ParseIP.getHostIP().equals(ParseIP.getRemoteIP())) //从机
    ParseIP.writeIP(remoteIP);
    //根据SearchInter这个接口创建services对象
    Service srvcModel = new ObjectServiceFactory().create(SearchInter.class);
    //创建xfire的webservice工厂
    XFireProxyFactory factory =  
    new XFireProxyFactory(XFireFactory.newInstance().getXFire());
    //webservice地址
    String websearchURL = "http://"+remoteIP+":8080/godeep/services/CSService";
    try {
    //通过webservice工厂创建客户端接口对象srvc
    SearchInter srvc = (SearchInter) factory.create(srvcModel, websearchURL);
    //调用webservice方法
    srvc.registIP(hostIP);
    } catch (MalformedURLException e) {e.printStackTrace();
    }


    这个事webservice开发的客户端程序
      

  3.   

    是一个xfire的代理。
    LZ可以去看看MyEclipse帮助文档,楼主的做法是yEclipse帮助文档提供的代码。
      

  4.   

    谢谢大家,我好像有点明白了,谁有xfire教程吗