httpServletRequest.addHeader("Content-Length", Integer.toString(bytes.length));
httpServletRequest.addHeader(HEADER_NAME, HEADER_VALUE);
httpServletRequest.setContent(bytes);
SaajSoapMessage message = (SaajSoapMessage) connection.receive(messageFactory);
Assert.assertNotNull("No message received", message);
StringResult result = new StringResult();
Transformer transformer = transformerFactory.newTransformer();
transformer.transform(message.getPayloadSource(), result);
assertXMLEqual("Invalid message", CONTENT, result.toString());
SOAPMessage saajMessage = message.getSaajMessage();
String[] headerValues = saajMessage.getMimeHeaders().getHeader(HEADER_NAME);
Assert.assertNotNull("Response has no header", headerValues);
assertEquals("Response has invalid header", 1, headerValues.length);
assertEquals("Response has invalid header values", HEADER_VALUE, headerValues[0]);