Package xsul5.wsdl

Examples of xsul5.wsdl.WsdlPortType


          while(keys.hasNext()){
            String key = keys.next();
            WsdlDefinitions wsdl = wsdls.get(key);
            WsdlPortType portType = wsdl.getPortType(portTypeName);
            if( null != portType){
              WsdlPortTypeOperation wsdlOperation = portType.getOperation(operation);
              WsdlMessagePart part  = wsdl.getMessage(wsdlOperation.getInput().getMessage().getLocalPart()).parts().iterator().next();
              XmlElement childElement = container.addElement(part.getElement().getLocalPart());
              Iterator<GpelAssignCopy> copyItr = assign.copyOperations().iterator();
              while(copyItr.hasNext()){
                GpelAssignCopy copyItm = copyItr.next();
                childElement.addElement(getElementName(copyItm.getTo().getQuery()));
                if(messagePartName == null){
                  messagePartName = copyItm.getTo().xml().attributeValue(PART_STR);
                }
              }
              break;
            }
          }
        }else {
          //reply
         
         
            WsdlPortType portType = workflowWSDL.getPortType(portTypeName);
            if( null != portType){
              WsdlPortTypeOperation wsdlOperation = portType.getOperation(operation);
              WsdlMessagePart part  = workflowWSDL.getMessage(wsdlOperation.getOutput().getMessage().getLocalPart()).parts().iterator().next();
              XmlElement childElement = container.addElement(part.getElement().getLocalPart());
              Iterator<GpelAssignCopy> copyItr = assign.copyOperations().iterator();
              while(copyItr.hasNext()){
                GpelAssignCopy copyItm = copyItr.next();
                childElement.addElement(getElementName(copyItm.getTo().getQuery()));
View Full Code Here


    String oldNSPrefix = null;
    boolean introduceNewNS = false;
    String operationName = node.getOperationName();
    WsdlMessage newInputMessage = null;
    Iterable<WsdlPortType> servicePortTypes = serviceWSDL.portTypes();
    WsdlPortTypeOperation serviceOperation = null;
    WsdlPortType servicePortType = null;
    for (WsdlPortType wsdlPortType : servicePortTypes) {
     
      serviceOperation = wsdlPortType.getOperation(operationName);
      if(serviceOperation != null){
        QName inputMessageName = serviceOperation.getInput().getMessage();
        WsdlMessagePart part = WSDLUtil.getfirst(serviceWSDL.getMessage(inputMessageName.getLocalPart()).parts());
       
        nsPrefix = part.getElement().getPrefix();
        oldNSPrefix = nsPrefix;
        introduceNewNS = false;
        while( null != wsdl.xml().lookupNamespaceByPrefix(nsPrefix)){
          //this namespace is already there so keep adding control at the end and check for
          //its existance
          nsPrefix += "_control";
          introduceNewNS = true;
        }
       
        wsdl.xml().declareNamespace(BUILDER.newNamespace(nsPrefix, serviceTns));
       
       
        WsdlMessage inputMessage = serviceWSDL.getMessage(inputMessageName.getLocalPart());
        newInputMessage = wsdl.addMessage(inputMessageName.getLocalPart());
        Iterable<WsdlMessagePart> parts = inputMessage.parts();
        for (WsdlMessagePart wsdlMessagePart : parts) {
          XmlElement newPart = null;
          if(introduceNewNS){
            XmlElement clone = wsdlMessagePart.xml().clone();
            String xmlAsString = BUILDER.serializeToString(clone).replaceAll(oldNSPrefix+":", nsPrefix+":");
            newPart= BUILDER.parseFragmentFromString(xmlAsString);
          }else{
            newPart = wsdlMessagePart.xml().clone();
          }
          newInputMessage.xml().addElement(newPart);
        }
        //add lead header part to the new input messag because this message is copied from the service wsdl.
       
        XmlElement newLeadHeaderPart = newInputMessage.xml().addElement(newInputMessage.xml().getNamespace(), "part");
        newLeadHeaderPart.setAttributeValue("name", "leadHeader");
        newLeadHeaderPart.setAttributeValue("element", "lc:context");
       
        WsdlMessage newOutputMessage = null;
        if(null != serviceOperation.getOutput()){
          QName outputMessageName = serviceOperation.getOutput().getMessage();
          WsdlMessage outputMessage = serviceWSDL.getMessage(outputMessageName.getLocalPart());
          newOutputMessage = wsdl.addMessage(outputMessageName.getLocalPart());
          Iterable<WsdlMessagePart> parts2 = outputMessage.parts();
          for (WsdlMessagePart wsdlMessagePart : parts2) {
            XmlElement newPart = null;
            if(introduceNewNS){
              XmlElement clone = wsdlMessagePart.xml().clone();
              String xmlAsString = BUILDER.serializeToString(clone).replaceAll(oldNSPrefix+":", nsPrefix+":");
              newPart = BUILDER.parseFragmentFromString(xmlAsString);
            }else{
              newPart = wsdlMessagePart.xml().clone();
            }
            newOutputMessage.xml().addElement(newPart);
          }
        }
       
       
       
       
        if(introduceNewNS){
          List<XmlNamespace> namespacesPresentInSchema = WSDLUtil.getNamespaces(serviceSchema);
          WSDLUtil.print(serviceSchema);
          for (XmlNamespace shouldBeDefinedNamespaces : namespacesPresentInSchema) {
            if(shouldBeDefinedNamespaces.getPrefix() != null &&
                null == wsdl.xml().lookupNamespaceByPrefix(shouldBeDefinedNamespaces.getPrefix())){
              wsdl.xml().declareNamespace(shouldBeDefinedNamespaces);
            }
           
          }
          XmlElement clone = serviceSchema.clone();
          String xmlAsString = BUILDER.serializeToString(clone).replaceAll(oldNSPrefix+":", nsPrefix+":");
          XmlElement newSchema= BUILDER.parseFragmentFromString(xmlAsString);
          types.addChild(newSchema);
         
          XmlElement crosscutImport = BUILDER.newFragment(newSchema.getNamespace(), "import");
          crosscutImport.setAttributeValue("namespace", "http://lead.extreme.indiana.edu/namespaces/2006/lead-crosscut-parameters/");
          crosscutImport.setAttributeValue("schemaLocation", "lead-crosscut-parameters.xsd");
          newSchema.addChild(0, crosscutImport);
        }else{
          types.addChild(serviceSchema.clone());
        }
        //adding new operation for the receive
        Iterator<WsdlPortType> portTypes = wsdl.portTypes().iterator();
        if(portTypes.hasNext()){
          WsdlPortType newOperationPortType = portTypes.next();
          WsdlPortTypeOperation newOp = newOperationPortType.addOperation(node.getOperationName());
          XmlNamespace wsaNS = BUILDER.newNamespace("http://www.w3.org/2006/05/addressing/wsdl");
         
          newOp.setInput(newInputMessage.getName(),newInputMessage);
          String inputAction = serviceOperation.getInput().xml().attributeValue(wsaNS, "Action");
          newInputMessage.xml().setAttributeValue(wsaNS, "Action", inputAction);
                   
          if(newOutputMessage != null){
            newOp.setOutput(newOutputMessage.getName(), newOutputMessage);
            String outputAction = serviceOperation.getOutput().xml().attributeValue(wsaNS, "Action");
            newOutputMessage.xml().setAttributeValue(wsaNS, "Action", outputAction);
          }
        }
        servicePortType = wsdlPortType;
View Full Code Here

      while (iterator.hasNext()) {
        WsdlPortType portType = iterator.next();
        Iterator<WsdlPortTypeOperation> operations = portType
            .operations().iterator();
        while (operations.hasNext()) {
          WsdlPortTypeOperation operation = operations.next();
          WsdlMessagePart leadHeaderPart = new WsdlMessagePart(
              LEAD_HEADER);
          leadHeaderPart.setName(LEAD_HEADER);
          // we hand set this element to xml because when you use the
          // API it doent add the namespace correctly
          leadHeaderPart.xml().setAttributeValue(ELEMENT,
              LC_CONTEXT);

          wsdl.getMessage(
              operation.getInput().getMessage().getLocalPart())
              .addPart(leadHeaderPart);
        }
      }

      Iterator<WsdlBinding> bindingItr = wsdl.bindings().iterator();
View Full Code Here

  private QName findInputMessaQname(
      WsdlBindingOperation wsdlBindingOperation, WsdlDefinitions wsdl) {
    String operationName = wsdlBindingOperation.getName();
    WsdlPortType portType = wsdl.getPortType(wsdlBindingOperation
        .getBinding().getPortType().getLocalPart());
    WsdlPortTypeOperation operation = portType.getOperation(operationName);
    QName message = operation.getInput().getMessage();
    return message;
  }
View Full Code Here

        if (input != null) {
            WsdlMessage inputMessage = input.lookupMessage();
            this.inputs = parseMessage(inputMessage, true);
        }

        WsdlPortTypeOutput output = operation.getOutput();
        // No output is possible.
        if (output != null) {
            WsdlMessage outputMessage = output.lookupMessage();
            this.outputs = parseMessage(outputMessage, false);
        }
    }
View Full Code Here

  public void setOdeLocation(String ODEEprEndingWithPort,
      String workflowName, WsdlDefinitions wsdl) {
    Iterator<WsdlService> serviceItr = wsdl.services().iterator();
    if (serviceItr.hasNext()) {
      WsdlService service = serviceItr.next();
      Iterator<WsdlPort> portItr = service.ports().iterator();
      if (portItr.hasNext()) {
        WsdlPort port = portItr.next();
        org.xmlpull.infoset.XmlElement address = port.xml().element(
            "address");
        if (address != null) {
View Full Code Here

        }

        GpelAssign assign = new GpelAssign(this.bpelNS, copies);
        sequence.addActivity(assign);

        PartnerLinkRole partnerRoll = this.workflowWSDL
                .getPartnerRoll(portTypeQName);
        if (partnerRoll == null) {
            String partnerLinkTypeName = id + PARTNER_LINK_TYPE_SUFFIX;
            String partnerRollName = id + PARTNER_ROLE_SUFFIX;
            partnerRoll = this.workflowWSDL.addPartnerLinkTypeAndRoll(
                    partnerLinkTypeName, partnerRollName, portTypeQName);
        }
        PartnerLinkType partnerLinkType = partnerRoll.getPartnerLinkType();

        // partnerLink
        String partnerLinkName = createPartnerLinkName(id);
        XmlNamespace partnerLinkTypeNS = this.targetNamespace;
        this.process.addPartnerLink(partnerLinkName, partnerLinkTypeNS,
                partnerLinkType.getName(), null, partnerRoll.getName());

        // Invoke
        GpelInvoke invoke = new GpelInvoke(this.bpelNS, partnerLinkName, namespace,
                portTypeQName.getLocalPart(), operation);
        invoke.setName(INVOKE_NAME_PREFIX + id);
View Full Code Here

    public PartnerLinkRole addPartnerLinkTypeAndRoll(
            String partnerLinkTypeName, String partnerRollName,
            QName servicePortTypeQName) {
        PartnerLinkType partnerLinkType = new PartnerLinkType(
                partnerLinkTypeName);
        PartnerLinkRole partnerRoll = new PartnerLinkRole(partnerRollName,
                servicePortTypeQName);
        partnerLinkType.addRole(partnerRoll);

        declareNamespaceIfNecessary("p",
                servicePortTypeQName.getNamespaceURI(), true);
View Full Code Here

            String partnerLinkTypeName = id + PARTNER_LINK_TYPE_SUFFIX;
            String partnerRollName = id + PARTNER_ROLE_SUFFIX;
            partnerRoll = this.workflowWSDL.addPartnerLinkTypeAndRoll(
                    partnerLinkTypeName, partnerRollName, portTypeQName);
        }
        PartnerLinkType partnerLinkType = partnerRoll.getPartnerLinkType();

        // partnerLink
        String partnerLinkName = createPartnerLinkName(id);
        XmlNamespace partnerLinkTypeNS = this.targetNamespace;
        this.process.addPartnerLink(partnerLinkName, partnerLinkTypeNS,
                partnerLinkType.getName(), null, partnerRoll.getName());

        // Invoke
        GpelInvoke invoke = new GpelInvoke(this.bpelNS, partnerLinkName, namespace,
                portTypeQName.getLocalPart(), operation);
        invoke.setName(INVOKE_NAME_PREFIX + id);
View Full Code Here

     * @return PartnerLinkRole
     */
    public PartnerLinkRole addPartnerLinkTypeAndRoll(
            String partnerLinkTypeName, String partnerRollName,
            QName servicePortTypeQName) {
        PartnerLinkType partnerLinkType = new PartnerLinkType(
                partnerLinkTypeName);
        PartnerLinkRole partnerRoll = new PartnerLinkRole(partnerRollName,
                servicePortTypeQName);
        partnerLinkType.addRole(partnerRoll);

        declareNamespaceIfNecessary("p",
                servicePortTypeQName.getNamespaceURI(), true);
        this.definitions.xml().addElement(partnerLinkType.xml());

        this.partnerLinkRoleMap.put(servicePortTypeQName, partnerRoll);
        return partnerRoll;
    }
View Full Code Here

TOP

Related Classes of xsul5.wsdl.WsdlPortType

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.