Examples of IhcExecption


Examples of org.openhab.binding.ihc.ws.IhcExecption

      throws IhcExecption {
    InputStream is;
    try {
      is = new ByteArrayInputStream(xml.getBytes("UTF8"));
    } catch (UnsupportedEncodingException e) {
      throw new IhcExecption(e);
    }
   
    XPath xpath = XPathFactory.newInstance().newXPath();
    InputSource inputSource = new InputSource(is);

    xpath.setNamespaceContext(new NamespaceContext() {
      public String getNamespaceURI(String prefix) {
        if (prefix == null)
          throw new NullPointerException("Null prefix");
        else if ("SOAP-ENV".equals(prefix))
          return "http://schemas.xmlsoap.org/soap/envelope/";
        else if ("ns1".equals(prefix))
          return "utcs";
        else if ("ns2".equals(prefix))
          return "utcs.values";
        return null;
      }

      public String getPrefix(String uri) {
        return null;
      }

      @SuppressWarnings("rawtypes")
      public Iterator getPrefixes(String uri) {
        throw new UnsupportedOperationException();
      }
    });

    try {
      return (String) xpath.evaluate(xpathExpression, inputSource, XPathConstants.STRING);
    } catch (XPathExpressionException e) {
      throw new IhcExecption(e);
    }
  }
View Full Code Here

Examples of org.openhab.binding.ihc.ws.IhcExecption

        "/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:getState1/ns1:state");
    } else if (data.contains("waitForControllerStateChange3")) {
      state = parseValue(data,
        "/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:waitForControllerStateChange3/ns1:state");
    } else {
      throw new IhcExecption("Encoding error, unsupported data");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.