コード例 #1
0
    protected void afterRun(RunnerContext context) {
      if (context.getStatus() != RunnerContext.RunnerStatus.FINISHED) return;

      try {
        String wsdlUrl =
            "file:"
                + outDir.getAbsolutePath()
                + File.separatorChar
                + "wsdl"
                + File.separatorChar
                + serviceName
                + ".wsdl";
        Interface[] ifaces = WsdlInterfaceFactory.importWsdl(project, wsdlUrl, true);

        if (ifaces.length > 0) {
          context.log("Added Interface [" + ifaces[0].getName() + "] to project");
          ifaces[0]
              .getSettings()
              .setString(
                  WSToolsRegenerateJava2WsdlAction.class.getName() + "@values",
                  getDialog().getValues().toXml());
          UISupport.select(ifaces[0]);
        }
      } catch (SoapUIException e) {
        SoapUI.logError(e);
      }
    }
コード例 #2
0
ファイル: SoapUIUtil.java プロジェクト: lymons/EasyMocker
  private static WsdlInterface getWsdlInterface(String wsdlUrl) {

    WsdlInterface intr = null;

    try {
      setSoapUISettings();

      WsdlProject soapUIProject = new WsdlProject();

      WsdlInterface[] intrs =
          WsdlInterfaceFactory.importWsdl(soapUIProject, wsdlUrl.replaceAll(" ", "%20"), true);

      if (intrs == null || intrs.length == 0 || intrs.length > 1)
        throw new MockException("Not supported at the moment");

      intr = intrs[0];

      intrMap.put(wsdlUrl, intr);

    } catch (Exception e) {

      e.printStackTrace();
      throw new MockException("Unable to import WSDL from " + wsdlUrl);
    }

    return intr;
  }
コード例 #3
0
  public void perform(WsdlProject project, Object param) {
    String url = UISupport.prompt("Enter WSDL URL", "Add WSDL from URL", "");
    if (url == null) return;

    try {
      Boolean createRequests =
          UISupport.confirmOrCancel("Create default requests for all operations", "Import WSDL");
      if (createRequests == null) return;

      Interface[] ifaces = WsdlInterfaceFactory.importWsdl(project, url, createRequests);
      if (ifaces != null && ifaces.length > 0) UISupport.select(ifaces[0]);
    } catch (Exception ex) {
      UISupport.showErrorMessage(ex.getMessage() + ":" + ex.getCause());
    }
  }