test_class.declarator: reqSoap = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:test=\"http://ws2restful.PING.csb/\">\n"
              + "<soapenv:Header/>\n" + "<soapenv:Body>\n" + "   <test:ws2restful>\n" + "      <name>abc</name>\n"
              + "   </test:ws2restful>\n" + "</soapenv:Body>\n" + "</soapenv:Envelope>\n"
test_class.modifier: private static final
test_class.original_string: private static final String reqSoap = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:test=\"http://ws2restful.PING.csb/\">\n"
              + "<soapenv:Header/>\n" + "<soapenv:Body>\n" + "   <test:ws2restful>\n" + "      <name>abc</name>\n"
              + "   </test:ws2restful>\n" + "</soapenv:Body>\n" + "</soapenv:Envelope>\n";
test_class.type: String
test_class.var_name: reqSoap
test_class.declarator: reqSoap2 = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://webservices.amazon.com/AWSECommerceService/2011-08-01\">\n" +
              "   <soapenv:Header/>\n" +
              "   <soapenv:Body>\n" +
              "      <ns:CartAdd>\n" +
              "         <ns:MarketplaceDomain>a</ns:MarketplaceDomain>\n" +
              "      </ns:CartAdd>\n" +
              "   </soapenv:Body>\n" +
              "</soapenv:Envelope>"
test_class.modifier: private static final
test_class.original_string: private static final String reqSoap2 = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://webservices.amazon.com/AWSECommerceService/2011-08-01\">\n" +
              "   <soapenv:Header/>\n" +
              "   <soapenv:Body>\n" +
              "      <ns:CartAdd>\n" +
              "         <ns:MarketplaceDomain>a</ns:MarketplaceDomain>\n" +
              "      </ns:CartAdd>\n" +
              "   </soapenv:Body>\n" +
              "</soapenv:Envelope>";
test_class.type: String
test_class.var_name: reqSoap2
test_class.file: ws-client/src/test/java/com/alibaba/csb/ws/sdk/CmdWsCallerTest.java
test_class.identifier: CmdWsCallerTest
test_case.body: @Test
      public void testCmdWsCaller() {
          String[] args = {
                  "-soap12", "true",
                  "-ak", "ak",
                  "-sk", "sk",
                  "-api", "PING",
                  "-version", "vcsb",
                  "-ea", "http://11.239.187.178:9081/PING/vcsb/ws2restful",
                  "-ns", "http://ws2restful.PING.csb/",
                  "-sname", "PING",
                  "-pname", "ws2restfulPortType",
                  "-d",
                  "-rd", reqSoap
  
          };
          CmdWsCaller.main(args);
      }
test_case.class_method_signature: CmdWsCallerTest.testCmdWsCaller()
test_case.full_signature: @Test public void testCmdWsCaller()
test_case.identifier: testCmdWsCaller
test_case.invocations: main
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCmdWsCaller()
focal_class.declarator: SDK_VERSION = "1.1.5.8"
focal_class.modifier: private static final
focal_class.original_string: private static final String SDK_VERSION = "1.1.5.8";
focal_class.type: String
focal_class.var_name: SDK_VERSION
focal_class.file: ws-client/src/main/java/com/alibaba/csb/ws/sdk/CmdWsCaller.java
focal_class.identifier: CmdWsCaller
focal_class.class_method_signature: CmdWsCaller.usage(Options opt)
focal_class.full_signature: private static void usage(Options opt)
focal_class.identifier: usage
focal_class.modifiers: private static
focal_class.parameters: (Options opt)
focal_class.return: void
focal_class.signature: void usage(Options opt)
focal_class.class_method_signature: CmdWsCaller.isEmpty1(String str, String msg)
focal_class.full_signature: private static boolean isEmpty1(String str, String msg)
focal_class.identifier: isEmpty1
focal_class.modifiers: private static
focal_class.parameters: (String str, String msg)
focal_class.return: boolean
focal_class.signature: boolean isEmpty1(String str, String msg)
focal_class.class_method_signature: CmdWsCaller.isEmpty(String str)
focal_class.full_signature: private static boolean isEmpty(String str)
focal_class.identifier: isEmpty
focal_class.modifiers: private static
focal_class.parameters: (String str)
focal_class.return: boolean
focal_class.signature: boolean isEmpty(String str)
focal_class.class_method_signature: CmdWsCaller.print(boolean debug, String format, Object args)
focal_class.full_signature: private static void print(boolean debug, String format, Object args)
focal_class.identifier: print
focal_class.modifiers: private static
focal_class.parameters: (boolean debug, String format, Object args)
focal_class.return: void
focal_class.signature: void print(boolean debug, String format, Object args)
focal_class.class_method_signature: CmdWsCaller.invokeWithDispath(WSParams params, String ns, String sname,
                                            String pname, String soapActionUri, boolean isSoap12, String ea, String reqSoap, Map<String, String> requestHeaders)
focal_class.full_signature: private static void invokeWithDispath(WSParams params, String ns, String sname,
                                            String pname, String soapActionUri, boolean isSoap12, String ea, String reqSoap, Map<String, String> requestHeaders)
focal_class.identifier: invokeWithDispath
focal_class.modifiers: private static
focal_class.parameters: (WSParams params, String ns, String sname,
                                            String pname, String soapActionUri, boolean isSoap12, String ea, String reqSoap, Map<String, String> requestHeaders)
focal_class.return: void
focal_class.signature: void invokeWithDispath(WSParams params, String ns, String sname,
                                            String pname, String soapActionUri, boolean isSoap12, String ea, String reqSoap, Map<String, String> requestHeaders)
focal_class.class_method_signature: CmdWsCaller.main(String[] args)
focal_class.full_signature: public static void main(String[] args)
focal_class.identifier: main
focal_class.modifiers: public static
focal_class.parameters: (String[] args)
focal_class.return: void
focal_class.signature: void main(String[] args)
focal_method.body: public static void main(String[] args) {
          Options opt = new Options();
          opt.addOption("ak", true, "accessKey, 可选");
          opt.addOption("sk", true, "secretKey, 可选");
          opt.addOption("api", true, "服务名, 可选");
          opt.addOption("version", true, "服务版本, 可选");
  		opt.addOption("wa", true, "wsdl地址，e.g: http://broker-ip:9081/api/version/method?wsdl");
          opt.addOption("ea", true, "endpoint地址，e.g: http://broker-ip:9081/api/version/method");
          opt.addOption("ns", true, "在wsdl中定义的服务的target namespace");
          opt.addOption("sname", "serviceName", true, "在wsdl中定义的服务名");
          opt.addOption("pname", "portName", true, "在wsdl中定义的端口名");
          opt.addOption("action", "SOAPAction", true, "SOAPAction值");
          opt.addOption("soap12", false, "-soap12 为soap12调用, 不定义为soap11");
          opt.addOption("nonce", false, "-nonce 是否做nonce防重放处理，不定义为不做nonce重放处理");
          opt.addOption("skipTimestamp", false, "-skipTimestamp 不设置时间戳，默认是设置");
          opt.addOption("fingerStr", true, "签名指纹串, 可选");
          opt.addOption("H", true, "http header, 格式: -H \"key:value\"");
          opt.addOption("h", "help", false, "打印帮助信息");
          opt.addOption("d", "debug", false, "打印调试信息");
          opt.addOption("rf", true, "soap请求文件，文件里存储soap请求的Message格式内容");
          opt.addOption("rd", true, "soap请求内容(Message)，如果设置该选项时，-rf选项被忽略");
          opt.addOption("sdkv", "sdk-version", false, "sdk版本");
          opt.addOption("bizIdKey", true, "业务id Key");
          opt.addOption("bizId", true, "业务id");
  
          CommandLineParser parser = new DefaultParser();
  
          Boolean isDebug = false;
          try {
              CommandLine commandline = parser.parse(opt, args);
              if (commandline.hasOption("h") || commandline.getOptions().length == 0) {
                  usage(opt);
                  return;
              }
  
              String ak = commandline.getOptionValue("ak");
              String sk = commandline.getOptionValue("sk");
              String api = commandline.getOptionValue("api");
              String version = commandline.getOptionValue("version");
              Boolean sdkv = commandline.hasOption("sdkv");
              String ea = commandline.getOptionValue("ea");
              String ns = commandline.getOptionValue("ns");
              String sname = commandline.getOptionValue("sname");
              String pname = commandline.getOptionValue("pname");
              String action = commandline.getOptionValue("action");
              String rf = commandline.getOptionValue("rf");
              String rd = commandline.getOptionValue("rd");
              String fingerStr = commandline.getOptionValue("fingerStr");
              String[] headers = commandline.getOptionValues("H");
              boolean isSoap12 = commandline.hasOption("soap12");
              boolean nonce = commandline.hasOption("nonce");
              boolean skipTimestamp = commandline.hasOption("skipTimestamp");
              isDebug = commandline.hasOption("d");
              String bizIdKey = commandline.getOptionValue("bizIdKey");
              String bizId = commandline.getOptionValue("bizId");
  
              if (sdkv) {
                  Version.version();
                  return;
              }
  
              if (isDebug) {
                  // printParams();
                  System.out.println("ak=" + ak);
                  System.out.println("sk=" + sk);
                  System.out.println("api=" + api);
                  System.out.println("version=" + version);
                  System.out.println("bizIdKey=" + bizIdKey);
                  System.out.println("bizId=" + bizId);
                  System.out.println("isSoap12=" + isSoap12);
                  System.out.println("nonce=" + nonce);
                  System.out.println("ea=" + ea);
                  System.out.println("ns=" + ns);
                  System.out.println("sname=" + sname);
                  System.out.println("pname=" + pname);
                  System.out.println("action=" + action);
                  System.out.println("headers=" + Arrays.toString(headers));
                  System.out.println("rd=" + rd);
                  if (isEmpty(rd)) {
                      System.out.println("rf=" + rf);
                  }
                  System.out.println("nonce=" + nonce);
                  System.out.println("skipTimestamp=" + skipTimestamp);
                  System.out.println("fingerStr=" + fingerStr);
              }
  
              if (isEmpty1(ea, "-ea endpoint地址")) {
                  usage(opt);
                  return;
              }
  
              if (isEmpty1(ea, "-ns namespace")) {
                  usage(opt);
                  return;
              }
  
              if (isEmpty1(ea, "-sname serviceName")) {
                  usage(opt);
                  return;
              }
  
              if (isEmpty1(pname, "-pname portName")) {
                  usage(opt);
                  return;
              }
  
              if (isEmpty1(pname, "-action SOAPAction")) {
                  usage(opt);
                  return;
              }
  
              if (isEmpty(rf) && isEmpty(rd)) {
                  System.out.println("-rf 或 -rd 参数没有定义");
                  usage(opt);
                  return;
              }
  
              String reqData = (isEmpty(rd)) ? FileUtils.readFileToString(new File(rf)) : rd;
              print(isDebug, "-- 请求报文: \n%s\n", reqData);
              if (isEmpty(reqData)) {
                  print(true, "-- 操作失败：文件%s请求报文为空", rf);
                  return;
              }
              if (bizIdKey != null && !bizIdKey.trim().equals("")) {
                  WSClientSDK.bizIdKey(bizIdKey);
              }
              WSParams params = WSParams.create().accessKey(ak).secretKey(sk).fingerPrinter(fingerStr)
                      .api(api).bizId(bizId).version(version).nonce(nonce).timestamp(!skipTimestamp).debug(isDebug);
  
              Map<String, String> httpHeaders = new HashMap<String, String>();
  
              if (headers != null) {
                  for (String header : headers) {
                      String[] kv = header.split(":", 2);
                      if (kv == null || kv.length != 2) {
                          System.out.println("错误的HTTP头定义 正确格式: -H \"key:value\" !!" + header);
                          return;
                      }
                      httpHeaders.put(kv[0], kv[1]);
                  }
              }
  
              invokeWithDispath(params, ns, sname, pname, action, isSoap12, ea, reqData, httpHeaders);
          } catch (Exception e) {
              System.out.println("-- 操作失败：" + e.getMessage());
              if (isDebug)
                  e.printStackTrace(System.out);
          }
      }
focal_method.class_method_signature: CmdWsCaller.main(String[] args)
focal_method.full_signature: public static void main(String[] args)
focal_method.identifier: main
focal_method.invocations: addOption addOption addOption addOption addOption addOption addOption addOption addOption addOption addOption addOption addOption addOption addOption addOption addOption addOption addOption addOption addOption addOption parse hasOption getOptions usage getOptionValue getOptionValue getOptionValue getOptionValue hasOption getOptionValue getOptionValue getOptionValue getOptionValue getOptionValue getOptionValue getOptionValue getOptionValue getOptionValues hasOption hasOption hasOption hasOption getOptionValue getOptionValue version println println println println println println println println println println println println println println toString println isEmpty println println println println isEmpty1 usage isEmpty1 usage isEmpty1 usage isEmpty1 usage isEmpty1 usage isEmpty isEmpty println usage isEmpty readFileToString print isEmpty print equals trim bizIdKey debug timestamp nonce version bizId api fingerPrinter secretKey accessKey create split println put invokeWithDispath println ()); printStackTrace
focal_method.modifiers: public static
focal_method.parameters: (String[] args)
focal_method.return: void
focal_method.signature: void main(String[] args)