axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <jb...@in.gr>
Subject ΠΡ: Cannot send an image/jpeg
Date Thu, 17 May 2007 20:52:51 GMT
Hi,

	I am trying to send an image/jpeg attachment using AXIS2 on the client side.
My wsdl looks like this for the data type picture
<xs:complexType name="picture">
	<xs:sequence>
		<xs:element minOccurs="0" name="imageData" ns3:expectedContentTypes="image/jpeg" type="xs:base64Binary"/>
	</xs:sequence>
</xs:complexType>

When I compile the wsdl using wsdl2java I get back a class (Picture) which holds the imageData
in a DataHandler.
On the client side my code is:

String endpoint = "http://127.0.0.1:8081/AttachmentHandlerBeanService/AttachmentHandlerBean";
AttachmentHandlerServiceStub stub = new AttachmentHandlerServiceStub(endpoint);
.................................................
Picture pic = new Picture();
File file = new File("e:\\test.jpeg");        
BufferedImage image = ImageIO.read(file);        
DataHandler imgDH = new DataHandler(image, "image/jpeg");
pic.setImageData(imgDH);
GetLicencingInfo5 licencingInfo5 = new GetLicencingInfo5();
licencingInfo5.setGetLicencingInfo5(pic);
stub.getLicencingInfo5(licencingInfo5)

When I call the remote method, tcpmon shows that 
<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Body>
         <ns1:getLicencingInfo5 xmlns:ns1="http://127.0.0.1/">
            <imageData></imageData>
         </ns1:getLicencingInfo5>
      </soapenv:Body>
   </soapenv:Envelope>

The DataHandler at the client side holds the data (using ImageIO.write() on the DataHandler
content gives me the image back). For some reason AXIS2 does not send it out.

Thanks in advance for your help
dimtiris

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message