byte[] byteArray = new byte[]{13, 56, 65, 32, 12, 12, 7, -3, -2, -1,
98};
protected void setUp() throws Exception {
super.setUp();
SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
ByteArrayOutputStream outStream;
String boundary;
OMOutputFormat omOutput = new OMOutputFormat();
boundary = omOutput.getMimeBoundary();
String contentType = org.apache.ws.commons.om.impl.MIMEOutputUtils
.getContentTypeForMime(boundary, omOutput.getRootContentId(),
omOutput.getCharSetEncoding(),SOAP12Constants.SOAP_12_CONTENT_TYPE);
DataHandler dataHandler;
dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
OMText textData = factory.createText(dataHandler, true);
assertNotNull(textData.getContentID());
DataHandler dataHandler2 = new DataHandler(
"Apache Software Foundation", "text/plain");
OMText text = factory.createText(dataHandler2, true);
assertNotNull(text.getContentID());
outStream = new ByteArrayOutputStream();
outStream.write(("Content-Type: " + contentType).getBytes());
outStream.write(new byte[]{13,10});
outStream.write(new byte[]{13,10});