XOP testCase
bk8133 May 11, 2007 6:01 AMGreetings!
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