Package xsul5.wsdl

Examples of xsul5.wsdl.WsdlDocumentation


     * @throws ComponentException
     */
    public static List<WSComponent> createComponents(XmlElement componentElement)
            throws ComponentException {
        try {
            WsdlDefinitions definitions = new WsdlDefinitions(componentElement);
            return createComponents(definitions);
        } catch (RuntimeException e) {
            throw new ComponentException(ErrorMessages.COMPONENT_FORMAT_ERROR,
                    e);
        }
View Full Code Here


    Map<WsdlDefinitions, String> ids = new HashMap<WsdlDefinitions, String>();
    // Use LinkedHashMap to preserve the order of WSDLs, which is useful for
    // some unit tests.

    for (WSNode node : GraphUtil.getNodes(this.graph, WSNode.class)) {
      WsdlDefinitions wsdl = node.getComponent().getWSDL();
      if (wsdls.containsValue(wsdl)) {
        String id = ids.get(wsdl);
        node.setWSDLID(id);
      } else {
        // Assign unique key
View Full Code Here

    workflowElement.addElement(this.graph.toXML());

    // WSDLs
    XmlElement wsdlsElement = workflowElement.addElement(NS_XWF, WSDLS_TAG);
    for (String id : wsdls.keySet()) {
      WsdlDefinitions wsdl = wsdls.get(id);
      XmlElement wsdlElement = wsdlsElement.addElement(NS_XWF, WSDL_TAG);
      wsdlElement.setAttributeValue(NS_XWF, ID_ATTRIBUTE, id);
      wsdlElement.setText(XMLUtil.xmlElementToString(wsdl.xml()));
    }

    // Image
    if (this.image != null) {
      try {
View Full Code Here

    // This map is to avoid creating multiple instances for the a component
    Map<WSComponentKey, WSComponent> components = new HashMap<WSComponentKey, WSComponent>();
    for (WSNode node : GraphUtil.getWSNodes(this.graph)) {
      String id = node.getWSDLID();
      logger.finest("id: " + id);
      WsdlDefinitions wsdl = this.wsdlMap.get(id);

      if (wsdl == null) {
        // XXX This happens while loading a workflow that is created by
        // the version 2.2.6_2 or below from GPEL.
        // Need to look for wsdl manually.
View Full Code Here

    this.graph = WSGraphFactory.createGraph(graphElement);

    XmlElement wsdlsElement = workflowElement.element(WSDLS_TAG);
    for (XmlElement wsdlElement : wsdlsElement.elements(null, WSDL_TAG)) {
      String wsdlText = wsdlElement.requiredText();
      WsdlDefinitions wsdl = WSDLUtil.stringToWSDL(wsdlText);
      String id = wsdlElement.attributeValue(NS_XWF, ID_ATTRIBUTE);
      if (id == null || id.length() == 0) {
        // xwf up to 2.2.6_2 doesn't have ID.
        id = WSDLUtil.getWSDLQName(wsdl).toString();
      }
      addWSDL(id, wsdl);
    }

    bindComponents();

    // Image
    XmlElement imageElement = workflowElement.element(IMAGE_TAG);
    if (imageElement != null) {
      String base64 = imageElement.requiredText();
      byte[] bytes = Base64.decodeBase64(base64.getBytes());
      try {
        this.image = ImageIO.read(new ByteArrayInputStream(bytes));
      } catch (IOException e) {
        // This should not happen and it's OK that image is broken. We
        // can reproduce it anytime.
        logger.caught(e);
      }
    }

    XmlElement bpelElement = workflowElement.element(BPEL_TAG);
    if (bpelElement != null) {
      try {
        String bpelString = bpelElement.requiredText();
        XmlNamespace gpelNS = XmlInfosetBuilder.newInstance()
            .newNamespace(BPELScript.GPEL, BPELScript.GPELNS);
        GpelConstants.GPEL_NS = gpelNS;
        this.gpelProcess = new GpelProcess(
            XMLUtil.stringToXmlElement(bpelString));
      } catch (RuntimeException e) {
        String error = "Failed to parse the BPEL document.";
        throw new GraphException(error, e);
      }
    }

    XmlElement workflowWSDLElement = workflowElement
        .element(WORKFLOW_WSDL_TAG);
    if (workflowWSDLElement != null) {
      try {
        String wsdlText = workflowWSDLElement.requiredText();
        this.workflowWSDL = new WsdlDefinitions(
            XMLUtil.stringToXmlElement(wsdlText));
      } catch (RuntimeException e) {
        String error = "Failed to parse the workflow WSDL.";
        throw new GraphException(error, e);
      }
View Full Code Here

    ODEWSDLTransformer wsdlTransformer = new ODEWSDLTransformer();
    script.create(BPELScriptType.BPEL2);
    this.odeProcess = script.getGpelProcess();
    this.odeProcess.setTargetNamespace(XBayaConstants.LEAD_NS);

    WsdlDefinitions abstractWorkflowWsdl = script.getWorkflowWSDL()
        .getWsdlDefinitions();
    this.odeWorkflowWSDL = abstractWorkflowWsdl;
    this.odeInvokableWSDL = WSDLUtil.stringToWSDL(abstractWorkflowWsdl
        .xmlString());
    wsdlTransformer.makeWorkflowWSDLConcrete(this.odeInvokableWSDL,
        this.getName(), dscUrl);
    wsdlTransformer.setOdeLocation(odeEprEndingWithPort, this.getName(),
        this.odeInvokableWSDL);

    this.odeWsdlMap = new HashMap<String, WsdlDefinitions>();
    Collection<XmlElement> itr = script.getWSDLs();
    for (XmlElement xmlElement : itr) {
      WsdlDefinitions wsdl = WSDLUtil.stringToWSDL(XmlConstants.BUILDER
          .serializeToString(xmlElement));
      String id = xmlElement.attributeValue(NS_XWF, ID_ATTRIBUTE);
      if (id == null || id.length() == 0) {
        // xwf up to 2.2.6_2 doesn't have ID.
        id = WSDLUtil.getWSDLQName(wsdl).toString();
        if (null == id || "".equals(id)
            || (id.startsWith("{") && id.endsWith("}"))) {
          QName wsdlQname = new QName(NS_XWF.getName(),
              WSDLUtil.getFirstOperationName(wsdl,
                  WSDLUtil.getFirstPortTypeQName(wsdl)));
          id = wsdlQname.toString();
          wsdl.xml().setAttributeValue("name",
              wsdlQname.getLocalPart());
        }
      }
      WSDLCleaner.cleanWSDL(wsdl);
      this.odeWsdlMap.put(id, wsdl);
    }

    new ODEBPELTransformer().generateODEBPEL(this.odeProcess,
        this.getName(), this.odeWorkflowWSDL, this.odeWsdlMap);

    wsdlTransformer.trasnformToODEWsdls(this.getName(), dscUrl,
        this.odeWorkflowWSDL, this.odeWsdlMap);

    String wsdlString = XMLUtil.xmlElementToString(this.odeWorkflowWSDL
        .xml());
    this.tridentWSDL = new WsdlDefinitions(
        XMLUtil.stringToXmlElement(wsdlString));
    new TridentTransformer().process(this.tridentWSDL);

    if (streaming) {
      StreamTransformer streamTransformer = new StreamTransformer();
View Full Code Here

  public static void main(String[] args) throws XBayaException,
      URISyntaxException, GSSException, IOException {
    String workflowAsString = getWorkflow();

    Workflow workflow = new Workflow(workflowAsString);
    WsdlDefinitions wsdl = workflow.getTridentWorkflowWSDL(
        XBayaConstants.DEFAULT_DSC_URL,
        XBayaConstants.DEFAULT_ODE_URL.toString());
    System.out.println("llllllllllllllllllllllllll");
    System.out.println(wsdl.xmlStringPretty());

    ODEClient client = new ODEClient();
    Pair<String, String>[] in = new Pair[3];

    List<WSComponentPort> inputs = client.getInputs(workflow);
View Full Code Here

        try {
            for (WSNode node : GraphUtil.getWSNodes(this.workflow.getGraph())) {
                WSComponent component = node.getComponent();
                QName portTypeQName = component.getPortTypeQName();
                WsdlDefinitions wsdl = component.getWSDL();

                File file = File.createTempFile(".xbaya-"
                        + portTypeQName.getLocalPart(),
                        XBayaConstants.WSDL_SUFFIX);
                this.tmpWSDLFiles.add(file);
                XMLUtil.saveXML(wsdl.xml(), file);

                String wsdlID = JythonScript.getWSDLID(node);
                String wsdlURL = file.toURL().toString();
                arguments.add("-" + wsdlID);
                arguments.add(wsdlURL);
View Full Code Here

   */
  private QName findMessage(GpelProcess gpelProcess, QName portType, String opName, boolean input, Map<String, WsdlDefinitions> wsdls) {
    Iterator<String> iterator = wsdls.keySet().iterator();
    while (iterator.hasNext()) {
      String key = (String) iterator.next();
      WsdlDefinitions wsdlDefinitions = wsdls.get(key);
      WsdlPortType pType = wsdlDefinitions.getPortType(portType.getLocalPart());
      WsdlPortTypeOperation operation = null;
      if(null != pType && null != (operation = pType.getOperation(opName))){
       
        if(input){
          WsdlPortTypeInput messageRef = operation.getInput();
          if(null != messageRef &&
              null != messageRef.getMessage()){
            WsdlMessage message = wsdlDefinitions.getMessage(messageRef.getMessage().getLocalPart());
            if(null != message){
              return new QName(wsdlDefinitions.getTargetNamespace(), message.getName(), key);
            }
          }
        }else{
          xsul5.wsdl.WsdlPortTypeOutput messageRef = operation.getOutput();
          if(null != messageRef &&
              null != messageRef.getMessage()){
            WsdlMessage message = wsdlDefinitions.getMessage(messageRef.getMessage().getLocalPart());
            if(null != message){
              return new QName(wsdlDefinitions.getTargetNamespace(), message.getName(), key);
            }
          }
        }
       
       
View Full Code Here

   */
  private void addImports(GpelProcess process, WsdlDefinitions workflowWSDL, Map<String, WsdlDefinitions> wsdls) {
    Iterator<String> iterator = wsdls.keySet().iterator();
    while(iterator.hasNext()){
      String id = iterator.next();
      WsdlDefinitions wsdl = wsdls.get(id);
      XmlElement importElement = process.xml().newElement(process.xml().getNamespace(), "import");
      importElement.setAttributeValue("importType", "http://schemas.xmlsoap.org/wsdl/");
      importElement.setAttributeValue("location", wsdl.xml().attributeValue("name")+".wsdl");
      importElement.setAttributeValue("namespace", wsdl.getTargetNamespace());
      process.xml().addChild(0, importElement);
     
    }
   
    XmlElement importElement = process.xml().newElement(process.xml().getNamespace(), "import");
View Full Code Here

TOP

Related Classes of xsul5.wsdl.WsdlDocumentation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.