3 Replies Latest reply on May 16, 2007 7:06 AM by Heiko Braun

    XOP testCase

    Boštjan Kukovec Newbie

      Greetings!

      I'm trying to produce a webservice according to the XOP testcase in examples. I implemented endpoint interface and implementing bean.

      
      package si.zejn.agentpro.core.ws;
      
      import javax.jws.WebService;
      import javax.jws.soap.SOAPBinding;
      import javax.xml.ws.BindingType;
      
      @WebService(targetNamespace = "http://ws.core.agentpro.zejn.si/")
      @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
      @BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
      public interface MTOMEndpoint
      {
       public DHResponse getSlikaByID();
      
      
      
      }
      
      
      @WebService(name = "MTOMEndpoint", serviceName = "MTOMService", endpointInterface = "si.zejn.agentpro.core.ws.MTOMEndpoint")
      public class WServiceAP_Pictures {
      
      
       @Resource
       WebServiceContext wsCtx;
      
      
       public DHResponse getSlikaByID() {
      
      
       FileDataSource fds=new FileDataSource("c:/pics/slika.jpg");
       DataHandler dh=new DataHandler(fds);
       return new DHResponse(dh);
       }
      
      
      
      }
      


      But when invoking the service i get "IllegalAnnotationsException".

      Any ideas? Eternally greatful.. :)

      PS. which way is more intuitive and better to use MTOM/XOP or SwA. I'm trying to provide interfaces for a Delphi Client

      11:49:56,984 ERROR [AbstractServiceEndpointServlet] Error processing web service request
      javax.xml.ws.WebServiceException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
      javax.activation.DataHandler does not have a no-arg default constructor.
       this problem is related to the following location:
       at javax.activation.DataHandler
       at public javax.activation.DataHandler si.zejn.agentpro.core.ws.DHResponse.getDataHandler()
       at si.zejn.agentpro.core.ws.DHResponse
      
       at org.jboss.ws.core.jaxws.JAXBSerializer.handleMarshallException(JAXBSerializer.java:109)
       at org.jboss.ws.core.jaxws.JAXBSerializer.serialize(JAXBSerializer.java:89)
       at org.jboss.ws.core.jaxrpc.binding.SerializerSupport.serialize(SerializerSupport.java:61)
       at


        • 1. Re: XOP testCase
          Catherine Pires da Silva Newbie

          the problem is due to jax-b jars not up to date. Replace the jaxb-impl and jab-api jars by recent ones.
          I'm using Jboss1.2.0.SP1; I replaced the jars under Jboss AS by the jars I found under E:\jbossws-samples-1.2.0.SP1\jbossws-samples-1.2.0.SP1\thirdparty.
          ant retrieves them from net. see build.xml
          CPires

          • 2. Re: XOP testCase
            Catherine Pires da Silva Newbie

            sorry I answered too quickly; first install the samples and run them and check for jars used. after you may find an answer.without using the samples time is lost with problems difficult to understand.
            tu run the samples for Jboss1.2.0.SP1 you have a post "how to run the jbossws samples" mon 2 april 2007.

            you also need to work with the generated classes from wsdl with wsconsume.
            the class I use is a generated class where i set application/octet-stream:
            @javax.xml.bind.annotation.XmlType
            public class Message {


            private DataHandler dataHandler;


            public Message() {
            }

            public Message(DataHandler dataHandler) {
            this.dataHandler = dataHandler;
            }

            @XmlMimeType("application/octet-stream")
            public DataHandler getDataHandler() {
            return dataHandler;
            }

            public void setDataHandler(DataHandler dataHandler) {
            this.dataHandler = dataHandler;
            }
            }

            • 3. Re: XOP testCase
              Heiko Braun Master

              The response is not being MTOM optimized. What does the

              DHResponse
              class look like?

              public DHResponse getSlikaByID() {...}