attachmentSizeThreshold = (parameter == null)
? ""
: parameter.getValue().toString();
}
MIMEHelper mimeHelper = new MIMEHelper(inStream, contentTypeString,
fileCacheForAttachments, attachmentRepoDir,
attachmentSizeThreshold);
String charSetEncoding =
getCharSetEncoding(mimeHelper.getSOAPPartContentType());
XMLStreamReader streamReader;
if ((charSetEncoding == null) || "null".equalsIgnoreCase(charSetEncoding)) {
charSetEncoding = MessageContext.UTF_8;
}
try {
streamReader = XMLInputFactory.newInstance().createXMLStreamReader(
getReader(mimeHelper.getSOAPPartInputStream(), charSetEncoding));
} catch (IOException e) {
throw new XMLStreamException(e);
}
msgContext.setProperty(MessageContext.CHARACTER_SET_ENCODING, charSetEncoding);
/*
* put a reference to Attachments in to the message context
*/
msgContext.setProperty(MTOMConstants.ATTACHMENTS, mimeHelper);
if (mimeHelper.getAttachmentSpecType().equals(MTOMConstants.MTOM_TYPE)) {
/*
* Creates the MTOM specific MTOMStAXSOAPModelBuilder
*/
builder = new MTOMStAXSOAPModelBuilder(streamReader, mimeHelper, null);
} else if (mimeHelper.getAttachmentSpecType().equals(MTOMConstants.SWA_TYPE)) {
builder = new StAXSOAPModelBuilder(streamReader,
SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
}
return builder;