示例#1
0
 public SoapWsConsumer(Endpoint endpoint, SoapWsConfiguration configuration, Processor processor) {
   super(endpoint, processor);
   this.configuration = configuration;
   builder =
       Wsdl.parse(ResourceUtils.getResource(configuration.getWsdl()).toString())
           .binding()
           .localPart(configuration.getLocalPart())
           .find();
 }
示例#2
0
文件: SoapUtils.java 项目: ossbase/p1
 public Wsdl validateWsdl(String url) {
   try {
     Wsdl wsdl = Wsdl.parse(url);
     messages.info("validated");
     return wsdl;
   } catch (Exception e) {
     messages.error(e.getMessage());
   }
   return null;
 }
示例#3
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;
  }
示例#4
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;
 }