Java code that sends the MTOM request

1
Hello everyone,  Currently, I've been working on custom MTOM java function.  I managed to create the MTOM XML request with binary/stream data where the attachments are placed, but I've been struggling with sending the XML request.  To be more clear, I'm getting the 500 error message that indicates the SOAP version was not defined.  <span class="vp-brp-lbl">Melding</span>The SOAP version has not yet been determined<br/> I can confirm this is not true because I manually added the namespace that defines a SoapVersion in the XML.  Has anyone experienced a similar problem?  Does anyone know if there is a different way to send a POST MTOM request from java other then the one described by the code below?  HttpClient client = new DefaultHttpClient();       HttpPost post = new HttpPost(EndPointURL);              ProtocolVersion protocolVersion = new ProtocolVersion("HTTP", 1, 1);       post.setProtocolVersion(protocolVersion);              post.addHeader("SOAPAction", SoapAction);       post.addHeader("Accept:", "text/xml, multipart/related");       post.addHeader("Content-Type", "text/xml; charset=UTF-8");                    post.setEntity(new StringEntity(MTOMRequest, "UTF-8"));              HttpResponse response = client.execute(post);              String result = EntityUtils.toString(response.getEntity());       *MTOMRequest - the custom construction of MTOM by another java class       *EndPointURL - the input URL For example, the Mendix Call Web Service option can send the request correctly, but because of another reason I need to create and send the MTOM from Java and that is not working at the moment.        Thank you,  Kind regards, Aleksandar Alempic
asked
0 answers