URL wsdlUrl = getClass().getResource(testWsdlFileName);
assertNotNull(wsdlUrl);
createConfiguration(wsdlUrl, serviceName, portName);
ServerTransport server = createServerTransport(wsdlUrl, serviceName,
portName, address);
setupCallbackObject(useAutomaticWorkQueue);
server.activate(callback);
TestJMSClientTransport client = createClientTransport(wsdlUrl, serviceName, portName, address);
OutputStreamMessageContext octx =
client.createOutputStreamContext(new GenericMessageContext());
setRequestContextHeader(octx);
client.finalPrepareOutputStreamContext(octx);
byte outBytes[] = "Hello World!!!".getBytes();
octx.getOutputStream().write(outBytes);
// make sure that the inner context that we used to create has the same values that we inserted
checkContextHeader(client.getContext(), JMSConstants.JMS_CLIENT_REQUEST_HEADERS);
InputStreamMessageContext ictx = client.invoke(octx);
byte bytes[] = new byte[10000];
int len = ictx.getInputStream().read(bytes);
assertTrue("Did not read anything " + len, len > 0);
assertEquals(new String(outBytes), new String(bytes, 0, len));
checkResponseContextHeader(ictx);
server.shutdown();
client.shutdown();
}