Hello Andreas, Thank you very much! This solved my problem.
Best regards, Arndt Arndt F. Bonitz Department Safety & Security AIT Austrian Institute of Technology GmbH 2444 Seibersdorf | Austria Tel.: +43(0) 50550-3169 arndt.bon...@ait.ac.at | http://www.ait.ac.at FN: 115980 i HG Wien | UID: ATU14703506 This email and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient, please notify the sender by return e-mail or by telephone and delete this message from your system and any printout thereof. Any unauthorized use, reproduction, or dissemination of this message is strictly prohibited. Please note that e-mails are susceptible to change. AIT Austrian Institute of Technology GmbH shall not be liable for the improper or incomplete transmission of the information contained in this communication, nor shall it be liable for any delay in its receipt. -----Ursprüngliche Nachricht----- Von: Andreas Veithen [mailto:andreas.veit...@gmail.com] Gesendet: Donnerstag, 17. November 2011 20:02 An: java-user@axis.apache.org Betreff: Re: Axis2 Service: No MTOM+XOP in response The response is actually not an MTOM message but a SwA message. Probably you have enabled both. In that case SwA takes precedence over MTOM because MTOM is simply an alternative serialization of an XML message while SwA is a different type of message. In addition, SwA doesn't allow the SOAP stack to automatically convert a base64Binary value to an attachment, and therefore the DataHandler is serialized as a base64Binary value. Avoid enabling SwA on that service and it should work. Andreas On Thu, Nov 17, 2011 at 16:47, Bonitz Arndt <arndt.bon...@ait.ac.at> wrote: > Dear all, > > > > I am experiencing the following problem with an Axis2 service: Upon a > service request, my service should return a SOAP message with an MTOM > attachment. I enabled XOP in the Axis2 configuaration. All messages are > returned as XOP+MTOM responses, but the attachment is encoded as Base64 > string the SOAPEnvelope. The problem occurs with Axis2 v1.4 and 1.6. > > > > I use the following code in my service to attach the attachment : > > > > byte[] covRaw = getCoverage(); > > final javax.activation.DataHandler dataHandler = new > javax.activation.DataHandler(new ByteArrayDataSource(covRaw, > "application/coverage")); > > final OMText textData = covElement.getOMFactory().createOMText(dataHandler, > true); > > covElement.addChild(textData); > > > > Example response, the Base64 encoded string is located in the wcs:Coverage > element. > > > > HTTP/1.1 200 OK > > Server: Apache-Coyote/1.1 > > Content-Type: multipart/related; > boundary="MIMEBoundary_4a88a88323dbbaaffa1ad8f2065158013b50b42eba59be4b"; > type="text/xml"; > start="<0.5a88a88323dbbaaffa1ad8f2065158013b50b42eba59b...@apache.org>" > > Transfer-Encoding: chunked > > Date: Thu, 17 Nov 2011 15:37:28 GMT > > > > --MIMEBoundary_4a88a88323dbbaaffa1ad8f2065158013b50b42eba59be4b > > Content-Type: text/xml; charset=UTF-8 > > Content-Transfer-Encoding: binary > > Content-ID: <0.5a88a88323dbbaaffa1ad8f2065158013b50b42eba59b...@apache.org> > > > > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> > > <soapenv:Body> > > <soapenv:Envelope> > > <soapenv:Body> > > <wcs:Coverage > xmlns:wcs="http://www.opengis.net/wcs/2.0">b50FyY5XveGeG1s5cG1LZWsdGVv1peGXdjcwpDs</wcs:Coverage> > > </soapenv:Body> > > </soapenv:Envelope> > > </soapenv:Body> > > </soapenv:Envelope> > > > > Any help would be greatly appreciated. > > > > Best regards, > > Arndt Bonitz --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org For additional commands, e-mail: java-user-h...@axis.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org For additional commands, e-mail: java-user-h...@axis.apache.org