// Nasty Hack to workaraound bug with lowercasing contenttype by some serwers what cause problems with finding message parts.
// There should be better fix for this.
String ct = request.getContentType().replaceAll("--=_part_","--=_Part_");
Attachments atts = new StreamedAttachments(context,request.getInputStream(), ct);
String encoding = getEncoding(atts.getSoapContentType());
XMLStreamReader reader =
STAXUtils.createXMLStreamReader(atts.getSoapMessage().getDataHandler().getInputStream(),
encoding,
context);
InMessage message = new InMessage(reader, request.getRequestURI());
message.setProperty(SoapConstants.SOAP_ACTION, soapAction);
message.setAttachments(atts);