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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to