<%@include file="utils.jsp"%>
<html>
<head><title>Intranet biura podróży</title></head>
<body>
<h1>Intranet biura podróży</h1>
<%
URL msgRouter = new URL(request.getParameter("messagerouter"));
String message = request.getParameter("message");
DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder parser = factory.newDocumentBuilder();
Document document =
    parser.parse(new StringBufferInputStream(message),
                 "SOAP body");
Vector vector = new Vector();
vector.addElement(document.getDocumentElement());
Body body = new Body();
body.setBodyEntries(vector);
Envelope envelope = new Envelope();
envelope.setBody(body);
Message msg = new Message();
msg.send(msgRouter,
         "http://www.psol.com/2001/soapaction",
         envelope);
SOAPTransport transport = msg.getSOAPTransport();
SOAPContext context = transport.getResponseSOAPContext();
MimeBodyPart part = context.getRootPart();
%>
<textarea rows="25"
    cols="65"><%= part.getContent().toString() %></textarea>
</body>
</html>
