コード例 #1
0
ファイル: SoapUtils.java プロジェクト: ossbase/p1
  public List<String> getOperations(String url) {
    List<String> result = new ArrayList<>();
    try {
      Wsdl wsdl = Wsdl.parse(url);
      List<QName> bindings = wsdl.getBindings();
      for (QName binding : bindings) {
        SoapBuilder builder = wsdl.binding().localPart(binding.getLocalPart()).find();
        for (SoapOperation operation : builder.getOperations())
          result.add(operation.getOperationName());
      }

    } catch (Exception e) {
      logger.info(e.getLocalizedMessage());
    }

    return result;
  }
コード例 #2
0
ファイル: SoapUtils.java プロジェクト: ossbase/p1
 public String generateResponseRequestForOperation(String url, String operation) {
   String result = "";
   try {
     Wsdl wsdl = Wsdl.parse(url);
     List<QName> bindings = wsdl.getBindings();
     for (QName binding : bindings) {
       SoapBuilder builder = wsdl.binding().localPart(binding.getLocalPart()).find();
       SoapOperationBuilder operationBuilder = builder.operation().name(operation).find();
       if (operationBuilder != null) {
         SoapContext sc = new SoapContext(false, true, true, true, false);
         result = operationBuilder.buildOutputMessage(sc);
         break;
       }
     }
   } catch (Exception e) {
     logger.info(e.getLocalizedMessage());
   }
   return result;
 }