public TeeInputStream(ConnectorConfig config, byte[] bytes) { this.config = config; config.getTraceStream().println("------------ Response start ----------"); if (config.isPrettyPrintXml()) { prettyPrint(bytes); } else { config.getTraceStream().print(new String(bytes)); } config.getTraceStream().println(); config.getTraceStream().println("------------ Response end ----------"); }
private void sendRequest(OutputStream out, XMLizable request, QName requestElement) throws IOException { XmlOutputStream xout = new XmlOutputStream(out, config.isPrettyPrintXml()); xout.startDocument(); xout.setPrefix("env", Constants.SOAP_ENVELOPE_NS); xout.setPrefix("xsd", Constants.SCHEMA_NS); xout.setPrefix("xsi", Constants.SCHEMA_INSTANCE_NS); xout.writeStartTag(Constants.SOAP_ENVELOPE_NS, "Envelope"); if (headers.size() > 0) { writeHeaders(xout); } writeBody(xout, requestElement, request); xout.writeEndTag(Constants.SOAP_ENVELOPE_NS, "Envelope"); xout.endDocument(); xout.close(); }