请问怎样调用上面的那种webservice???十万火急

解决方案 »

  1.   

    public void initialSoapClient(Vector params) throws Exception{
            Properties p = new Properties();
            p.load(ClassLoaderUtils.getResourceAsStream(
                    "bizqryinterface.properties", AbstractInquireAction.class));        String ServerIP = p.getProperty("SoapServiceIp");
            String ServerPort = p.getProperty("SoapServicePort");
    String bizUrn = p.getProperty("SoapServiceId");
    String bizMethods = p.getProperty("SoapServiceMethods");
    Call c = null;
    URL url = null;
    Response rep = null;
    url = new URL("http://"+ServerIP+":"+ServerPort+"/ulcc/servlet/rpcrouter");
    log.debug("Passing to our deployed " + url.getPath());
    c = new Call();
    c.setTargetObjectURI(bizUrn);
    c.setMethodName(bizMethods);
    c.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
    //设置查询参数
    c.setParams(params);
    log.debug("BizQueryInterface's echos are: ");
    rep = c.invoke(url, "");
    if (rep.generatedFault()) {
    Fault fault = rep.getFault();
    log.debug("\nCall failed!");
    log.debug("Code = " + fault.getFaultCode());
    log.debug("String = " + fault.getFaultString());
    } else {
    Parameter result = rep.getReturnValue();
    log.debug(result.getValue());
    }

    }