Package xsul5.wsdl

Examples of xsul5.wsdl.WsdlDefinitions


      gpelProcess = workflow.getOdeProcess(dscURI, configuration
          .getODEURL());
      processString = gpelProcess.xmlStringPretty();

      BufferedImage image = workflow.getImage();
      WsdlDefinitions workflowWSDL = workflow.getOdeWorkflowWSDL(dscURI,
          configuration.getODEURL());

      // do some error checking here
      if (workflowName == null || "".equals(workflowName)) {
        throw new IllegalStateException("No workflow name given");
      }

      DeploymentInformationDocument document = DeploymentInformationDocument.Factory
          .newInstance();
      DeploymentInformationDocument.DeploymentInformation deploymentInformation = DeploymentInformationDocument.DeploymentInformation.Factory
          .newInstance();
      DeploymentDocumentsType documentsType = DeploymentDocumentsType.Factory
          .newInstance();

      // setting the process name
      deploymentInformation.setProcessName(StringUtil
          .convertToJavaIdentifier(workflowName));

      // setting workflow template id
      if (templateId != null) {
        deploymentInformation.setTemplateId(templateId.toString());
      }

      // setting process GPEL

      XmlObject gpelProcessXmlObject = XBeansUtil
          .xmlElementToXmlObject(processString);
      documentsType.setBPEL(gpelProcessXmlObject);

      // setting deployment descriptors
      documentsType.setDeploymentDescriptor(XmlObject.Factory
          .parse(XmlConstants.BUILDER
              .serializeToStringPretty(workflow
                  .getODEDeploymentDescriptor(dscURI,
                      configuration.getODEURL()))));

      XMLFile processWSDL = XMLFile.Factory.newInstance();
      processWSDL.setFileName(workflowWSDL.xml().attributeValue("name")
          + ".wsdl");
      processWSDL.setContent(XBeansUtil
          .xmlElementToXmlObject(workflowWSDL.xmlStringPretty()));
      documentsType.setProcessWSDL(processWSDL);

      XMLFile serviceWSDL;
      Map<String, WsdlDefinitions> wsdlMap = workflow.getOdeServiceWSDLs(
          dscURI, configuration.getODEURL());
      XMLFile[] serviceWSDLs = new XMLFile[wsdlMap.size() + 3];
      int index = 0;
      for (String id : wsdlMap.keySet()) {
        WsdlDefinitions wsdl = wsdlMap.get(id);
        serviceWSDL = XMLFile.Factory.newInstance();
        serviceWSDL.setFileName(wsdl.xml().attributeValue("name")
            + ".wsdl");
        serviceWSDL.setContent(XBeansUtil.xmlElementToXmlObject(wsdl
            .xmlStringPretty()));
        serviceWSDLs[index++] = serviceWSDL;
      }
     
      //add the xsds
View Full Code Here


   * @throws WsdlException
   */
  public static void main(String[] args) throws WsdlException, URISyntaxException {

    StreamClient streamTestClient = new StreamClient();
    WsdlDefinitions wsdl = WsdlResolver.getInstance().loadWsdl(new URI("http://pagodatree.cs.indiana.edu:17080/ode/processes/Control_Stream_Echo?wsdl"));
    streamTestClient.invoke("Run", wsdl, "Control_Stream_Echo", "9e15d8ae-0f36-4c2e-ae8a-930557cdcdd2");
  }
View Full Code Here

        result = (XmlElement) faultMessage;
      }
      System.out.println("Received message:\n"
          + XMLUtil.xmlElementToString(result));

      wsdlDefinitions = new WsdlDefinitions(XMLUtil
          .xmlElementToString(result));

      // this is tricky here. This method requires us to return a
      // GcInstance and will call
      // start method with GcInstance as the argument to get
View Full Code Here

            }
           
            //now go through the WSDLS and find the one with the proper port type
            Set<String> keys = wsdls.keySet();
            for (String key : keys) {
              WsdlDefinitions wsdl = wsdls.get(key);
              WsdlPortType portType = wsdl.getPortType(portTypeQname.getLocalPart());
              if(null != portType && portType.getQName().equals(portTypeQname)){
                // this is the right porttype so extract the service and you will be done
                Iterator<WsdlService> svcIterator = wsdl.services().iterator();
                String nsPrefix = null;
                if(svcIterator.hasNext()){
                  WsdlService plService = svcIterator.next();
                  if(null == newNamespaceMap.get(wsdl.getTargetNamespace())){
                    nsPrefix = "p"+newNamespaceMap.size();
                    newNamespaceMap.put(wsdl.getTargetNamespace(), nsPrefix);
                  }else{
                    nsPrefix = newNamespaceMap.get(wsdl.getTargetNamespace());
                  }
                 
                  String portName = null;
                  Iterator<WsdlPort> portItr = plService.ports().iterator();
                  if(portItr.hasNext()){
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

*/
public class WSDLCleaner {
 
 
  public static void cleanWSDL(WsdlDefinitions definition){
    WsdlDefinitions wsdl = definition;
    Iterable<WsdlBinding> bindings = wsdl.bindings();
    ArrayList<WsdlBinding> removedBindings = new ArrayList<WsdlBinding>();
    for (WsdlBinding wsdlBinding : bindings) {
      XmlElement innerBinding = wsdlBinding.xml().element("binding");
      if( null != innerBinding &&
          !"http://schemas.xmlsoap.org/wsdl/soap/".equals(innerBinding.getNamespace().getName())){
       
        removedBindings .add(wsdlBinding);
      }
    }
    //to mitigate the Concurrent modifications this is done separately
    for (WsdlBinding wsdlBinding : removedBindings) {
      wsdl.xml().removeElement(wsdlBinding.xml());
    }
   
    ArrayList<WsdlPort> removePorts = new ArrayList<WsdlPort>();
    Iterable<WsdlService> services = wsdl.services();
    for (WsdlService wsdlService : services) {
      Iterable<WsdlPort> ports = wsdlService.ports();
      for (WsdlPort wsdlPort : ports) {
        for (WsdlBinding removedBinding : removedBindings) {
          if(removedBinding.getName().equals(wsdlPort.getBinding().getLocalPart())){
            removePorts.add(wsdlPort);
            break;
          }
        }
      }
      for (WsdlPort wsdlPort : removePorts) {
        wsdlService.xml().removeElement(wsdlPort.xml());
      }
      removePorts.clear();
    }
   
   
    //remove attributeFormDefault and elementFormDefault
    Iterable<XmlElement> schemas = wsdl.getTypes().elements(null, "schema");
    for (XmlElement schema : schemas) {
      XmlAttribute attributeFormDefault = schema.attribute("attributeFormDefault");
      schema.removeAttribute(attributeFormDefault);
     
      XmlAttribute elementFormDefault = schema.attribute("elementFormDefault");
View Full Code Here

        NodeImpl c = graph.getNode("c");
        NodeImpl d = graph.getNode("d");
        NodeImpl adder = graph.getNode(adder1ID);
        NodeImpl adder2 = graph.getNode(adder2ID);

        WsdlDefinitions workflowWSDL = workflow.getWorkflowWSDL();
        DSCUtil.convertToCWSDL(workflowWSDL, URI.create("http://example.com"));
        HashMap<String, String> inputMap = new HashMap<String, String>();
        inputMap.put("a", "2");
        inputMap.put("b", "3");
        inputMap.put("c", "4");
        inputMap.put("d", "5");
        sendNotification(workflowWSDL, null,
            WSDLUtil.getFirstOperation(workflowWSDL).getName(), inputMap, null, notifier);

        WsdlDefinitions adderWSDL = WsdlResolver.getInstance().loadWsdl(
                new File(XBayaPathConstants.WSDL_DIRECTORY + File.separator
                        + Adder.WSDL_PATH).toURI());

        HashMap<String, String> inputMap1 = new HashMap<String, String>();
        inputMap1.put("x", "2");
View Full Code Here

   */
  public void invoke(Workflow workflow, List<WSComponentPort> inputs, GSSCredential credentials,
      URI dscUrl, String odeEprEndingWithPort,
      LeadContextHeader leadContext) {
    try {
      WsdlDefinitions wsdl = workflow.getOdeInvokableWSDL(dscUrl,
          odeEprEndingWithPort);
      for (WSComponentPort componentPort : inputs) {
        if (null == componentPort.getValue()) {
          if (null != componentPort.getDefaultValue()) {
            componentPort.setValue(componentPort.getDefaultValue());
View Full Code Here

     * For debugging
     *
     * @param args
     */
    public static void main(String[] args) {
        WsdlDefinitions awsdl = WsdlResolver.getInstance().loadWsdl(
                DSCUtil.class, "wsdls/math/adder-awsdl.xml");
        WsdlDefinitions cwsdl = convertToCWSDL(awsdl, URI
                .create("http://localhost"));
        System.out.println(cwsdl.xmlStringPretty());
    }
View Full Code Here

        Map<String, WsdlDefinitions> WSDLMap = new HashMap<String, WsdlDefinitions>();
        Graph graph = workflow.getGraph();
        for (WSNode node : GraphUtil.getWSNodes(graph)) {
            String partnerLinkName = BPELScript.createPartnerLinkName(node
                    .getID());
            WsdlDefinitions wsdl = node.getComponent().getWSDL();
            if (WSDLUtil.isAWSDL(wsdl)) {
                wsdl = convertToCWSDL(WSDLUtil.deepClone(wsdl), dscURL);
            }
            WSDLMap.put(partnerLinkName, wsdl);
        }
View Full Code Here

TOP

Related Classes of xsul5.wsdl.WsdlDefinitions

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.