文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>接口 工程

接口 工程

时间:2010-03-18  来源:fome2010

//接口包 import org.apache.axis.client.Service;
import org.apache.axis.client.Call;
import org.apache.axis.encoding.XMLType;
//接口方方 public static String getTaskCode() {
   String result = "";
   String url = "";
   try {
     //创建一个服务
     Service one = new Service();
     //建立服务调用实例
     Call call = (Call) one.createCall();
     url = org.trundle.message.Message.getMessage("webServiceUrlTaakceode");;
     //设定调用路径
     call.setTargetEndpointAddress(url);
     //设定调用方法
     call.setOperation("getTaskCode");
     //设定返回类型
     call.setReturnType(XMLType.XSD_STRING);
     //开始调用
     System.out.println(call.getClass());
     result = (String) call.invoke(new Object[] {});
   }catch (Exception e) {
     e.printStackTrace();
   }
   return result;
 }
//接口 #url webServiceUrlTaakceode= http://202.101.166.172/pubcmwebservice/services/CGTService?wsdl   接口方法   public static String TaskDeal(String placeCode,String encryptCode,String tradeCode,String contentXml){
    String innerXml = "";
    String outXml = "";
    String startXml = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
    startXml += "<CispWeb>";
    String outxml = "";
    String endXml = "</CispWeb>";
//    CitySymbol cs = CispService.getCitysymbol(placeCode);
//    if(cs!=null){
//      if(cs.getVilidatecode().equals(encryptCode)){
        String returnStr = "";
        if(tradeCode.equals("0001")){                                          //增加业务系统的举报人
          returnStr = CispService.copyReportUser(contentXml);
        }
        if(tradeCode.equals("0002")){                                          //问题申报接口
          returnStr = CispService.copyEvent(contentXml);
        }
        if(tradeCode.equals("0003")){                                          //上传问题上报中的多媒体附件接口
          returnStr = CispService.copyEventMedia(contentXml);
        }
        if(tradeCode.equals("0004")){                                          //问题类型数据的同步
          returnStr = CispService.copyEventtype(placeCode);
        }
//        if(tradeCode.equals("0005")){                                          //问题小类数据的同步
//          returnStr = CispService.copyEventSubtypedic(placeCode);
//        }
        if(tradeCode.equals("0006")){                                          //区域数据的同步
          returnStr = CispService.copyRegion(placeCode);
        }
        if (tradeCode.equals("0007")) {                                        //获得问题的处理信息
          returnStr = CispService.getEventInfo(contentXml);
        }
        if (tradeCode.equals("0008")) {                                        //获得问题的详细日志
          returnStr = CispService.getEventLog(contentXml);
        }
        if(returnStr.length()==0){
          returnStr = "<ErrorCode>0005</ErrorCode><ErrorMessage>没有相应的任务代号!</ErrorMessage>";
        }
        innerXml = "<CityCode>"+placeCode+"</CityCode><VilidateCode>"+encryptCode+"</VilidateCode>"+returnStr;
//      }else{
//        innerXml = "<CityCode>"+placeCode+"</CityCode><VilidateCode>"+encryptCode+"<VilidateCode>"+
//          "<ErrorCode>0002</ErrorCode><ErrorMessage>地市加密代码验证不通过!</ErrorMessage>";
//      }
//    }else{
//      innerXml = "<CityCode>"+placeCode+"</CityCode><VilidateCode>"+encryptCode+"<VilidateCode>"+
//          "<ErrorCode>0001</ErrorCode><ErrorMessage>无该地市信息或者地市编号有误!</ErrorMessage>";
//    }
    outxml = startXml + innerXml + endXml;
    System.out.println("-------outxml:"+outxml);
    return outxml;
  }
   
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载