Hi, I'm a newbie with Webservices, and I have to write a simple one that provide an image to the client. I want to use MTOM, and I tried to use mtom sample in Axis 2.1.1 distribution.
I get the following exception when trying to retrieve the image: org.apache.axis2.AxisFault: javax.activation.DataHandler; nested exception is: java.lang.InstantiationException: javax.activation.DataHandler I think the server is working fine, because tcpmon trace looks good: >>>>>>>>> CLIENT SEND <<<<<<<<<<<< POST /axis2/services/MoleculeService HTTP/1.1 SOAPAction: "urn:anonOutInOp" User-Agent: Axis2 Host: localhost:8082 Transfer-Encoding: chunked Content-Type: text/xml; charset=UTF-8 17c <?xml version='1.0' encoding='UTF-8'?> <soapenv:Header /> <soapenv:Body> <arg0 xmlns=""> <cdCode>CD12345/55A</cdCode> <height>0</height> <outputFormat>gif</outputFormat> <width>0</width> </arg0> </getMoleculeImage> </soapenv:Body> </soapenv:Envelope> 0 >>>>>>>>> SERVER RESPONSE <<<<<<<<<<<<<<< HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_34835FF6273C9CB40C1173256264993; type="application/xop+xml"; start="<0.urn:uuid:[EMAIL PROTECTED]>"; start-info="text/xml";charset=UTF-8 Transfer-Encoding: chunked Date: Wed, 07 Mar 2007 08:31:04 GMT 2000 --MIMEBoundaryurn_uuid_34835FF6273C9CB40C1173256264993 content-type: application/xop+xml; charset=UTF-8; type="text/xml"; content-transfer-encoding: binary content-id: <0.urn:uuid:[EMAIL PROTECTED]> <?xml version='1.0' encoding='UTF-8'?> <soapenv:Header /> <soapenv:Body> <ns:return> <ns:attachmentResponse> test.gif'>http://ws.apache.org/axis2/mtomsample/">test.gif A LOT OF BINARY CONTENT </base64Binary> </binaryData> </ns:attachmentResponse> </ns:return> </ns:getMoleculeImageResponse> </soapenv:Body> </soapenv:Envelope> 0 >>>>>>>>>>>>>> HERE IS THE CODE OF MY CLIENT <<<<<<<<<<<<<<<<<< RPCServiceClient serviceClient = null; serviceClient = new RPCServiceClient(); Options options = serviceClient.getOptions(); EndpointReference targetEPR = new EndpointReference( "http://localhost:8082/axis2/services/MoleculeService"); options.setTo(targetEPR); QName opGetMoleculeImage = new QName( "http://webservice.rkp.galderma.com/xsd", "getMoleculeImage"); MoleculeImageRequest moleculeImageRequest = new MoleculeImageRequest(); moleculeImageRequest.setCdCode("CD12345/55A"); moleculeImageRequest.setOutputFormat("gif"); Object[] opGetMoleculeImageArgs = new Object[] {moleculeImageRequest}; Class[] returnTypes = new Class[] {MoleculeImageResponse.class}; Object[] response = null; response = serviceClient.invokeBlocking(opGetMoleculeImage, opGetMoleculeImageArgs, returnTypes); // >>>>>>>>>>>>>> EXCEPTION THROWN HERE <<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>> COMPLETE STACK TRACE <<<<<<<<<<<<<<<<<<<<<<<<<<<<< org.apache.axis2.AxisFault: javax.activation.DataHandler; nested exception is: java.lang.InstantiationException: javax.activation.DataHandler at org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:28) at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:269) at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:299) at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:299) at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:299) at org.apache.axis2.databinding.utils.BeanUtil.processObject(BeanUtil.java:557) at org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(BeanUtil.java:507) at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:446) at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:97) [...] Caused by: java.lang.InstantiationException: javax.activation.DataHandler at java.lang.Class.newInstance0(Class.java:335) at java.lang.Class.newInstance(Class.java:303) at org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:26) ... 27 more Could you please help me? Thanks Julien HENRY ___________________________________________________________________________ Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses http://fr.answers.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]