private synchronized Node getRootNode() { if (rootNode != null) return rootNode; try { byte content[] = getContent(); ByteArrayInputStream contentIn = new ByteArrayInputStream(content); Parser parser = SOAP.getXMLParser(); rootNode = parser.parse(contentIn); } catch (ParserException e) { Debug.warning(e); } return rootNode; }
public Node getBodyNode() { Node envNode = getEnvelopeNode(); if (envNode == null) return null; if (envNode.hasNodes() == false) return null; return envNode.getNode(0); }
public boolean isSOAPAction(String value) { String headerValue = getHeaderValue(SOAPACTION); if (headerValue == null) return false; if (headerValue.equals(value) == true) return true; String soapAction = getSOAPAction(); if (soapAction == null) return false; return soapAction.equals(value); }
public void print() { Debug.message(toString()); if (hasContent() == true) return; Node rootElem = getRootNode(); if (rootElem == null) return; Debug.message(rootElem.toString()); } }
public SOAPRequest(HTTPRequest httpReq) { set(httpReq); }
public void setContent(Node node) { // Thanks for Ralf G. R. Bergs <Ralf@Ber.gs>, Inma Marin Lopez <inma@dif.um.es>. String conStr = ""; conStr += SOAP.VERSION_HEADER; conStr += "\n"; conStr += node.toString(); setContent(conStr); }
public String getSOAPAction() { return getStringHeaderValue(SOAPACTION); }
public Node getEnvelopeNode() { return getRootNode(); }
public SOAPResponse postMessage(String host, int port) { HTTPResponse httpRes = post(host, port); SOAPResponse soapRes = new SOAPResponse(httpRes); byte content[] = soapRes.getContent(); if (content.length <= 0) return soapRes; try { ByteArrayInputStream byteIn = new ByteArrayInputStream(content); Parser xmlParser = SOAP.getXMLParser(); Node rootNode = xmlParser.parse(byteIn); soapRes.setEnvelopeNode(rootNode); } catch (Exception e) { Debug.warning(e); } return soapRes; }
public void print() { Debug.message(toString()); if (hasContent() == true) return; Node rootElem = getRootNode(); if (rootElem == null) return; Debug.message(rootElem.toString()); } }
public SOAPRequest(HTTPRequest httpReq) { set(httpReq); }
public void setContent(Node node) { // Thanks for Ralf G. R. Bergs <Ralf@Ber.gs>, Inma Marin Lopez <inma@dif.um.es>. String conStr = ""; conStr += SOAP.VERSION_HEADER; conStr += "\n"; conStr += node.toString(); setContent(conStr); }
public String getSOAPAction() { return getStringHeaderValue(SOAPACTION); }
public Node getEnvelopeNode() { return getRootNode(); }
public SOAPResponse postMessage(String host, int port) { HTTPResponse httpRes = post(host, port); SOAPResponse soapRes = new SOAPResponse(httpRes); byte content[] = soapRes.getContent(); if (content.length <= 0) return soapRes; try { ByteArrayInputStream byteIn = new ByteArrayInputStream(content); Parser xmlParser = SOAP.getXMLParser(); Node rootNode = xmlParser.parse(byteIn); soapRes.setEnvelopeNode(rootNode); } catch (Exception e) { Debug.warning(e); } return soapRes; }
public void print() { Debug.message(toString()); if (hasContent() == true) return; Node rootElem = getRootNode(); if (rootElem == null) return; Debug.message(rootElem.toString()); } }
public boolean isSOAPAction(String value) { String headerValue = getHeaderValue(SOAPACTION); if (headerValue == null) return false; if (headerValue.equals(value) == true) return true; String soapAction = getSOAPAction(); if (soapAction == null) return false; return soapAction.equals(value); }
public SOAPRequest(HTTPRequest httpReq) { set(httpReq); }
public Node getBodyNode() { Node envNode = getEnvelopeNode(); if (envNode == null) return null; if (envNode.hasNodes() == false) return null; return envNode.getNode(0); }
public void setContent(Node node) { // Thanks for Ralf G. R. Bergs <Ralf@Ber.gs>, Inma Marin Lopez <inma@dif.um.es>. String conStr = ""; conStr += SOAP.VERSION_HEADER; conStr += "\n"; conStr += node.toString(); setContent(conStr); }