Hi all,
I am using Revision: jbossws-3.0.1-native-2.0.4.GA and trying to get attachments to work. I have no problems running the XOP test case but when I try to write my own service I always have the same problem. When I deploy my WAR the ns1:expectedContentTypes is always "application/octet-stream" even though I specify @XmlMimeType("text/plain") in the code.
My end-point code is as follows:
package eas.attachment; import java.io.IOException; import javax.activation.DataHandler; import javax.jws.WebMethod; import javax.jws.WebService; import javax.xml.bind.annotation.XmlMimeType; import javax.xml.ws.BindingType; import javax.xml.ws.WebServiceException; @WebService(name = "EASEndpoint", serviceName = "EASEndpointService") @BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true") public class EASEndpointImpl implements EASEndpoint { @WebMethod @XmlMimeType("text/plain") public DataHandler fileUpload(@XmlMimeType("text/plain") DataHandler data) { try { System.out.println("Recv " + data.getContentType()); System.out.println("Content is " + data.getContent()); return new DataHandler("Server data", "text/plain"); } catch (IOException e) { throw new WebServiceException(e); } } }