Package org.xmlpull.v1.builder

Examples of org.xmlpull.v1.builder.XmlElement


                QName type = ((WSIFMessageElement) this.inputMessage).getPartType(name);
                if (LEADTypes.isArrayType(type)) {
                    // split string into items using " " as separator
                    Pattern pattern = Pattern.compile("[,\\s]+");
                    String[] result = pattern.split((String) value);
                    XmlElement arrayEl = XmlConstants.BUILDER.newFragment(name);
                    for (int i = 0; i < result.length; i++) {
                        logger.debug("split=" + result[i]);
                        arrayEl.addElement("value").addChild(result[i]);
                    }
                    this.inputMessage.setObjectPart(name, arrayEl);
                    value = null; // no need to set string value below
                }
View Full Code Here


     * @return The ServiceNotificationSender
     */
    public static ServiceNotificationSender invoked(XmlElement inputElement) {
        try {

            XmlElement soapBody = (XmlElement) inputElement.getParent();
            XmlElement soapEnvelope = (XmlElement) soapBody.getParent();
            SoapUtil soapFragrance = SoapUtil.selectSoapFragrance(soapEnvelope,
                    new SoapUtil[] { Soap11Util.getInstance(),
                            Soap12Util.getInstance() });
            XmlElement soapHeader = soapEnvelope.element(null,
                    XmlConstants.S_HEADER);
            XmlElement leadHeader = soapHeader.element(LeadContextHeader.NS,
                    LeadContextHeader.TYPE.getLocalPart());
            logger.finest("leadHeader: "
                    + XMLUtil.xmlElementToString(leadHeader));
            if (leadHeader == null) {
                return null;
View Full Code Here

    /**
     * @param inputElement
     */
    private void serviceInvoked(XmlElement inputElement) {
        XmlElement soapBody = (XmlElement) inputElement.getParent();
        XmlElement soapEnvelope = (XmlElement) soapBody.getParent();
        XmlElement soapHeader = soapEnvelope.element(null,
                XmlConstants.S_HEADER);
        XmlObject headerObject = XBeansUtil.xmlElementToXmlObject(soapHeader);
        XmlObject bodyObject = XBeansUtil.xmlElementToXmlObject(soapBody);
        this.invocationContext = this.notifier.serviceInvoked(this.receiver,
                this.initiator, headerObject, bodyObject, INVOKED_MESSAGE);
View Full Code Here

     */
    public void sendingResult(XmlElement outputElement) {
        try {
            XmlDocument document = this.soapFragrance
                    .wrapBodyContent(outputElement);
            XmlElement soapEnvelope = document.getDocumentElement();
            XmlElement soapHeader = soapEnvelope.element(null,
                    XmlConstants.S_HEADER);
            XmlElement soapBody = soapEnvelope.element(null,
                    XmlConstants.S_BODY);
            XmlObject headerObject = null;
            if (soapHeader != null) {
                headerObject = XBeansUtil.xmlElementToXmlObject(soapHeader);
            }
View Full Code Here

    public void setInput(String name, Object value) throws XBayaException {
        try {
            if (value instanceof XmlElement) {
                // If the value is a complex type, change the name of the
                // element to the correct one.
                XmlElement valueElement = (XmlElement) value;
                valueElement.setName(name);
            } else if (value instanceof String) {
                // Simple case.
            } else {
                // convert int, doule to string.
                value = "" + value;
View Full Code Here

        try {
            // This code doesn't work when the output is a complex type.
            // Object output = this.outputMessage.getObjectPart(name);
            // return output;

            XmlElement outputElement = (XmlElement) this.outputMessage;
            XmlElement valueElement = outputElement.element(null, name);
            Iterator childIt = valueElement.children();
            int numberOfChildren = 0;
            while (childIt.hasNext()) {
                childIt.next();
                numberOfChildren++;
            }
            if (numberOfChildren == 1) {
                Object child = valueElement.children().next();
                if (child instanceof String) {
                    // Value is a simple type. Return the string.
                    String value = (String) child;
                    return value;
                }
View Full Code Here

   * @see edu.indiana.extreme.xbaya.workflow.WorkflowInvoker#setup()
   */
  public void setup() throws XBayaException {
     String wsdlLoc = null;
          if (this.gfacURL == null) {
              XmlElement factoryServicesElement = this.abstractDefinitions
                      .element(null, "factoryServices");
              if (factoryServicesElement != null) {
                  XmlElement factoryService = factoryServicesElement.element(
                          null, "factoryService");
                  if (factoryService != null) {
                      String location = factoryService.getAttributeValue(null,
                              "location");
                      String portType = factoryService.getAttributeValue(null,
                              "portType");
                      logger.finest("location: " + location);
                      logger.finest("portType: " + portType);
                      wsdlLoc = WSDLUtil.appendWSDLQuary(location);
                  }
View Full Code Here

  public void setInput(String name, Object value) throws XBayaException {
    try {
      if (value instanceof XmlElement ) {
        // If the value is a complex type, change the name of the
        // element to the correct one.
        XmlElement valueElement = (XmlElement) value;
        valueElement.setName(name);
//        value = XmlConstants.BUILDER.serializeToString(valueElement);
      } else if(value instanceof org.xmlpull.infoset.XmlElement){
        org.xmlpull.infoset.XmlElement valueElement = (org.xmlpull.infoset.XmlElement) value;
        valueElement.setName(name);
        value = WSDLUtil.xmlElement5ToXmlElementv1(valueElement);
      }else if (value instanceof String) {
     
        // Simple case.
      } else {
View Full Code Here

                .create("http://host/2005/11/09/workflowinstace"));
        leadContext.setNodeId("decoder1");
        leadContext.setTimeStep("5");
        leadContext.setServiceInstanceId(URI.create("decoder-instance-10"));

        XmlElement element3 = XMLUtil.xmlElement5ToXmlElement3(definitions
                .xml());
        xsul.wsdl.WsdlDefinitions definitions3 = new xsul.wsdl.WsdlDefinitions(
                element3);

        WSIFClient wclient = WSIFRuntime.getDefault().newClientFor(
                definitions3, "TestCMD_Example1SoapPort");
        StickySoapHeaderHandler handler = new StickySoapHeaderHandler(
                "use-lead-header", leadContext);

        wclient.addHandler(handler);
        wclient.useAsyncMessaging(correlator);
        wclient.setAsyncResponseTimeoutInMs(33000L);

        WSIFPort port = wclient.getPort();
        WSIFOperation operation = port.createOperation("Run");
        WSIFMessage inputMessage = operation.createInputMessage();
        WSIFMessage outputMessage = operation.createOutputMessage();
        WSIFMessage faultMessage = operation.createFaultMessage();

        // inputMessage.setObjectPart("InputParam1", "Hello");
        inputMessage.setObjectPart("InputParam1", "100");

        logger.info("inputMessage: "
                + XsulUtil.safeXmlToString((XmlElement) inputMessage));
        boolean success = operation.executeRequestResponseOperation(
                inputMessage, outputMessage, faultMessage);

        XmlElement result;
        if (success) {
            result = (XmlElement) outputMessage;
        } else {
            result = (XmlElement) faultMessage;
        }
View Full Code Here

    try {
      // This code doesn't work when the output is a complex type.
      // Object output = this.outputMessage.getObjectPart(name);
      // return output;

      XmlElement outputElement = (XmlElement) this.outputMessage;
      XmlElement valueElement = outputElement.element(null, name);
      Iterator childIt = valueElement.children();
      int numberOfChildren = 0;
      while (childIt.hasNext()) {
        childIt.next();
        numberOfChildren++;
      }
      if (numberOfChildren == 1) {
        Object child = valueElement.children().next();
        if (child instanceof String) {
          // Value is a simple type. Return the string.
          String value = (String) child;
          return value;
        }
View Full Code Here

TOP

Related Classes of org.xmlpull.v1.builder.XmlElement

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.