Package org.w3c.dom

Examples of org.w3c.dom.Document


    try
    {
      filePath = path;
      ArrayList objectsCV = new ArrayList();
      Document qbXML = getDocumentFromString(xml);
      String nameQBXML = getQBXMLName(qbXML);
      Node node = qbXML.getElementsByTagName(nameQBXML).item(0);

      Document configForQBXML = getDocumentFromString(getDocumentFromString(FILE_CONFIG).getElementsByTagName(nameQBXML).item(0).toString());

      listVOAndModuleName = new HashMap();
      NodeList listQB = qbXML.getElementsByTagName(getValueOfNodeByTagName(configForQBXML, TAG_SEPARATOR) + "Ret");
      Node config = configForQBXML.getFirstChild();

      String moduleName = getValueOfNodeByTagName(config, TAG_MODULE_NAME);
      String className = getValueOfNodeByTagName(config, TAG_VONAME);

      Object cvObj = null;
View Full Code Here


    Object objectCV = null;
    String tagName = "";

    try
    {
      Document configForQBXML;
      NamedNodeMap attr;

      Class classCV[] = new Class[1];
      Class argumentType[] = new Class[1];
View Full Code Here

    String tagName = "";

    try
    {

      Document configForQBXML;

      Object ret = null;
      Method method = null;
      String value = "";
      Class classCV[] = new Class[1];
View Full Code Here

      } else
      {
        configName = FILE_CONFIG_MOD;
      }

      Document configForQBXML = getDocumentFromString(getDocumentFromString(configName).getElementsByTagName(nameQBXML).item(0).toString());

      String tag = getValueOfNodeByTagName(configForQBXML.getFirstChild(), TAG_SEPARATOR);

      int length = objectsCV.size();
      int requestID = 0;

      String xmlMod = "";
      String xmlAdd = "";
      String tempXML = "";

      Node config = configForQBXML.getFirstChild();

      for (int i = 0; i < length; i++)
      {
        tempXML = getQBXMLFromVO(objectsCV.get(i), config, hm);
View Full Code Here

   * @return Document
   */
  public Document getDocumentFromString(String xml)
  {

    Document returnDocument = null;
    try
    {

      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      factory.setNamespaceAware(true);
View Full Code Here

  {
    ItemLines itemLines = new ItemLines();

    int length = list.getLength();

    Document document = null;

    for (int j = 0; j < length; j++)
    {
      document = getDocumentFromString(list.item(j).toString());

      ItemElement ie = new ItemElement();

      int itemId = 0;

      String sku = "";
      String externalID = "";
      String cvID = "";
      if (document.getElementsByTagName("ItemRef").getLength() != 0)
      {
        sku = getValueOfNodeByTagName(document.getElementsByTagName("ItemRef").item(0), "FullName");
        externalID = getValueOfNodeByTagName(document.getElementsByTagName("ItemRef").item(0), "ListID");
        cvID = getIDFromEXID("Item", externalID);

        if (!cvID.equals(""))
          itemId = Integer.parseInt(cvID);
      }
      if (cvID.equals("0") || cvID.equals(""))
        continue;
      IntMember ItemId = new IntMember("ItemId", itemId, 'D', "", 'T', false, 20);

      StringMember SKU = new StringMember("SKU", sku, 'D', "", 'T', false);

      String desc = "";
      if (document.getElementsByTagName("Desc").getLength() != 0)
      {
        desc = getValueOfNodeByTagName(document.getFirstChild(), "Desc");
      }

      StringMember Description = new StringMember("Description", desc, 'D', "", 'T', false);

      String qty = "0";

      if (document.getElementsByTagName("Quantity").getLength() != 0)
      {
        qty = getValueOfNodeByTagName(document.getFirstChild(), "Quantity");

      }

      FloatMember Quantity = new FloatMember("Quantity", new Float(qty), 'D', "0", 'T', false, 20);

      String priceEach = "0";
      if (document.getElementsByTagName("Rate").getLength() != 0)
      {
        priceEach = getValueOfNodeByTagName(document.getFirstChild(), "Rate");
      }

      FloatMember PriceEach = new FloatMember("PriceEach", new Float(priceEach), 'D', "", 'T', false, 20);

      String priceExt = "0";

      if (document.getElementsByTagName("PriceExtended").getLength() != 0)
      {
        priceExt = getValueOfNodeByTagName(document.getFirstChild(), "PriceExtended");
      }

      FloatMember PriceExtended = new FloatMember("PriceExtended", new Float(priceExt), 'D', "", 'T', false, 20);
      FloatMember UnitTax = new FloatMember("UnitTax", new Float("1"), 'D', "", 'T', false, 20);
      FloatMember unitTaxrate = new FloatMember("UnitTax", new Float("1"), 'D', "", 'T', false, 20);
View Full Code Here

        return wsdl;
    }

    /* Not thread safe. Calling method must ensure all calls to this method are synchronized. */
    private byte[] adaptWsdl(HttpServletRequest req, String locationBase) throws IOException, WsException {
        Document doc;
        try {
            // read the schema to DOM representation
            DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
            fact.setNamespaceAware(true);
            DocumentBuilder bldr = fact.newDocumentBuilder();
            doc = bldr.parse(m_wsdlProvider.getWSDL(req));
            Element schema = doc.getDocumentElement();
            NodeList services = schema.getElementsByTagNameNS(WSDLSOAP_NAMESPACE, "address");
            for (int i = 0; i < services.getLength(); i++) {
                Node node = services.item(i).getAttributes().getNamedItem("location");
                if (node != null) {
                    String location = node.getTextContent();
View Full Code Here

                  // Create ODE response
                  Message odeResponse = mex.createMessage(mex.getOperation().getOutput().getMessage().getQName());
                  if(soapResponseMessage.getSOAPBody().hasFault())
                  {
                    // fault handling
                    Document odeMsg = DOMUtils.newDocument();
                    Element odeMsgEl = odeMsg.createElementNS(null, "message");
                    odeMsg.appendChild(odeMsgEl);
                   
                    Fault fault = messageAdapter.parseSoapFault(odeMsgEl, soapResponseMessage, mex.getOperation());

                    handleFault(mex, fault, soapResponseMessage.getSOAPBody().getFault(), odeMsgEl);
                   
                  }
                  else
                  {
                    messageAdapter.parseSoapResponse(new ODEMessageAdapter(odeResponse),
                            soapResponseMessage,mex.getOperation());
                    mex.reply(odeResponse);
                  }

                  if(log.isDebugEnabled())
                    log.debug( "ODE inbound message: \n" +DOMWriter.printNode(odeResponse.getMessage(), true) );
                 
              } catch(javax.xml.ws.soap.SOAPFaultException fe) {
               
                    // fault handling
                    Document odeMsg = DOMUtils.newDocument();
                    Element odeMsgEl = odeMsg.createElementNS(null, "message");
                    odeMsg.appendChild(odeMsgEl);
                   
                  if (log.isDebugEnabled()) {
                    log.debug("Riftsaw soap fault: \n" + DOMWriter.printNode(fe.getFault(), true));
                  }
                 
View Full Code Here

  {
    super(endpointId, location, deploymentName, archiveLocation);
  }

  public Document toXML() {
    Document ret=null;

    try {
      ret = javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();

      org.w3c.dom.Element elem=ret.createElementNS(Namespaces.SOAP_NS, "address");
      elem.setAttribute("location", getServiceUrl().toExternalForm());
      elem.setAttribute("endpointId", getEndpointId());
      elem.setAttribute("deploymentName", getDeploymentName());

      ret.appendChild(elem);
    } catch(Exception e) {
      e.printStackTrace();
    }

    return(ret);
View Full Code Here

    try {


      DocumentBuilder builder =
          DocumentBuilderFactory.newInstance().newDocumentBuilder();
      Document doc = builder.parse(in);
      Element root = doc.getDocumentElement();

      normalize(root);

      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      Writer writer = new PrintWriter(bout);
View Full Code Here

TOP

Related Classes of org.w3c.dom.Document

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.