private void process_incoming_soap() {
        try {
            // Copy output stream to input stream to simulate
            // coordinated streams over a network connection.
            coordinate_streams();
            // Create the "received" SOAP message from the
            // input stream.
            SOAPMessage msg = create_soap_message(in);
            // Inspect the SOAP header for the keyword 'time_request'
            // and process the request if the keyword occurs.
            Name lookup_name = create_qname(msg);
            SOAPHeader header = msg.getSOAPHeader();
            Iterator it = header.getChildElements(lookup_name);
            Node next = (Node) it.next();
            String value = (next == null) ? "Error!" : next.getValue();
            // If SOAP message contains request for the time, create a
            // new SOAP message with the current time in the body.
            if (value.toLowerCase().contains("time_request")) {
                // Extract the body and add the current time as an element.
                String now = new Date().toString();
                SOAPBody body = msg.getSOAPBody();
                body.addBodyElement(lookup_name).addTextNode(now);
                msg.saveChanges();
                // Write to the output stream.
                msg.writeTo(out);
                trace("The received/processed SOAP message:", msg);
            }
        } catch (SOAPException e) {
            System.err.println(e);
        } catch (IOException e) {
            System.err.println(e);
        }
    }