0 Replies Latest reply on May 7, 2008 11:52 AM by pdrummond

    @XmlMimeType(

    pdrummond

      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);
       }
       }
      }
      


      The code is almost identical to the WrappedEndpoint in the sample code - if I am missing something, I can't see it!!! I can confirm that the wsdl for the WrappedEndpoint does include what you'd expect - ns1:expectedContentTypes="text/plain" so why doesn't mine?

      Can anyone help? I am now stepping through the JBossWS source code to determine the source of this problem and will report any findings...

      Thanks,
      Paul Drummond