You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Karl Schwarz (JIRA)" <ax...@ws.apache.org> on 2005/04/26 14:49:38 UTC

[jira] Created: (AXIS-1951) Serialization of gif image

Serialization of gif image
--------------------------

         Key: AXIS-1951
         URL: http://issues.apache.org/jira/browse/AXIS-1951
     Project: Axis
        Type: Bug
  Components: Serialization/Deserialization, SAAJ  
    Versions: 1.2RC3    
 Environment: Linux RH Enterprise 4
Java version 1.4.2_07
    Reporter: Karl Schwarz


I've got a service defined that is transferring an java.awt.Image using SOAP with attachments.

Here is the WSDL:

<wsdl:definitions name="ImageryService"
targetNamespace="http://examples.com/ImageService"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:types="http://examples.com/ImageService/types"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://examples.com/ImageService">
<wsdl:types>

<!-- types namespace for this service -->
<xsd:schema targetNamespace="http://examples.com/ImageService/types"
xmlns:types="http://examples.com/ImageService/types">

<!-- Wrapper elements to provide unique signatures for the operations -->
<xsd:element name="addImage">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="types:ImageInfo"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="replaceImage">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="types:ImageInfo"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getImage">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="types:ImageInfo"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ImageInfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="id" type="xsd:int"/>
<xsd:element name="lat" type="xsd:double"/>
<xsd:element name="lon" type="xsd:double"/>
<xsd:element name="time" type="xsd:dateTime"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- Status return for the operations. -->
<xsd:element name="status" type="xsd:string" />
</xsd:schema>
</wsdl:types>



<!-- Input for the operations. -->
<wsdl:message name="addImageRequest">
<!-- first part is the SOAP body -->
<wsdl:part name="body" element="types:addImage"/>
<!-- second part is the attachment -->
<wsdl:part name="image" type="xsd:base64Binary"/>
</wsdl:message>
<wsdl:message name="addImageResponse">
<wsdl:part name="body" element="types:status"/>
</wsdl:message>

<wsdl:message name="getImageRequest">
<!-- first part is the SOAP body -->
<wsdl:part name="body" element="types:getImage"/>
</wsdl:message>
<wsdl:message name="getImageResponse">
<wsdl:part name="status" element="types:status"/>
<!-- second part is the attachment -->
<wsdl:part name="image" type="xsd:base64Binary"/>
</wsdl:message>


<wsdl:message name="replaceImageRequest">
<wsdl:part name="body" element="types:replaceImage"/>
<wsdl:part name="newImage" type="xsd:base64Binary"/>
</wsdl:message>
<wsdl:message name="replaceImageResponse">
<wsdl:part name="status" element="types:status"/>
</wsdl:message>
<wsdl:portType name="ImageryServicePortType">
<wsdl:operation name="addImage">
<wsdl:input message="tns:addImageRequest"/>
<wsdl:output message="tns:addImageResponse"/>
</wsdl:operation>
<wsdl:operation name="getImage">
<wsdl:input message="tns:getImageRequest"/>
<wsdl:output message="tns:getImageResponse"/>
</wsdl:operation>
<wsdl:operation name="replaceImage">
<wsdl:input message="tns:replaceImageRequest"/>
<wsdl:output message="tns:replaceImageResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ImageryServiceBinding" type="tns:ImageryServicePortType">
<soap:binding style="wrapped" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="addImage">
<soap:operation soapAction="addImage"/>
<wsdl:input>
<mime:multipartRelated>
<mime:part>
<soap:body parts="body" use="literal"/>
</mime:part>
<mime:part>
<mime:content part="image" type="image/gif"/>
</mime:part>
</mime:multipartRelated>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getImage">
<soap:operation soapAction="getImage"/>
<wsdl:input> 
<soap:body parts="body" use="literal"/>
</wsdl:input>
<wsdl:output>
<mime:multipartRelated>
<mime:part>
<soap:body parts="status" use="literal"/>
</mime:part>
<mime:part>
<mime:content part="image" type="image/gif"/>
</mime:part>
</mime:multipartRelated>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="replaceImage">
<soap:operation soapAction="replaceImage"/>
<wsdl:input>
<mime:multipartRelated>
<mime:part>
<soap:body parts="body" use="literal"/>
</mime:part>
<mime:part>
<mime:content part="newImage" type="image/gif"/>
</mime:part>
</mime:multipartRelated>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ImageryService">
<wsdl:port name="ImageryService" binding="tns:ImageryServiceBinding">
<soap:address location="http://192.168.1.1:8080/axis/services/ImageryService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

It worked fine when the Image was of type image/jpeg (the wsdl defined the type as image/jpeg), but now that I am trying to send a gif image, I see that the client is still setting the Content-Type in the mime attachment to image/jpeg.

>From what I can see from stepping through the org.apache.axis.encoding.ser.ImageDataHandlerSerialize.serialize() method, when the Data Handler is created the content type for the ImageDataSource() object is not specified and so it defaults to image/jpeg.

Have I missed something that will allow support for gif (or other content-types)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-1951) Serialization of gif image

Posted by "Jayachandra Sekhara Rao Sunkara (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-1951?page=comments#action_12322657 ] 

Jayachandra Sekhara Rao Sunkara commented on AXIS-1951:
-------------------------------------------------------

Hi Karl,
As asked by Ashu, post some information for us to replicate and work on the issue viz. simple test client. This should be pretty much tackle-able issue. And before anything, once make sure if the problem really persists in the latest release.

Awaiting response!
Thanks
Jaya

> Serialization of gif image
> --------------------------
>
>          Key: AXIS-1951
>          URL: http://issues.apache.org/jira/browse/AXIS-1951
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization, SAAJ
>     Versions: 1.2RC3
>  Environment: Linux RH Enterprise 4
> Java version 1.4.2_07
>     Reporter: Karl Schwarz

>
> I've got a service defined that is transferring an java.awt.Image using SOAP with attachments.
> Here is the WSDL:
> <wsdl:definitions name="ImageryService"
> targetNamespace="http://examples.com/ImageService"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:types="http://examples.com/ImageService/types"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:tns="http://examples.com/ImageService">
> <wsdl:types>
> <!-- types namespace for this service -->
> <xsd:schema targetNamespace="http://examples.com/ImageService/types"
> xmlns:types="http://examples.com/ImageService/types">
> <!-- Wrapper elements to provide unique signatures for the operations -->
> <xsd:element name="addImage">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element ref="types:ImageInfo"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="replaceImage">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element ref="types:ImageInfo"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="getImage">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element ref="types:ImageInfo"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="ImageInfo">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="name" type="xsd:string"/>
> <xsd:element name="id" type="xsd:int"/>
> <xsd:element name="lat" type="xsd:double"/>
> <xsd:element name="lon" type="xsd:double"/>
> <xsd:element name="time" type="xsd:dateTime"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <!-- Status return for the operations. -->
> <xsd:element name="status" type="xsd:string" />
> </xsd:schema>
> </wsdl:types>
> <!-- Input for the operations. -->
> <wsdl:message name="addImageRequest">
> <!-- first part is the SOAP body -->
> <wsdl:part name="body" element="types:addImage"/>
> <!-- second part is the attachment -->
> <wsdl:part name="image" type="xsd:base64Binary"/>
> </wsdl:message>
> <wsdl:message name="addImageResponse">
> <wsdl:part name="body" element="types:status"/>
> </wsdl:message>
> <wsdl:message name="getImageRequest">
> <!-- first part is the SOAP body -->
> <wsdl:part name="body" element="types:getImage"/>
> </wsdl:message>
> <wsdl:message name="getImageResponse">
> <wsdl:part name="status" element="types:status"/>
> <!-- second part is the attachment -->
> <wsdl:part name="image" type="xsd:base64Binary"/>
> </wsdl:message>
> <wsdl:message name="replaceImageRequest">
> <wsdl:part name="body" element="types:replaceImage"/>
> <wsdl:part name="newImage" type="xsd:base64Binary"/>
> </wsdl:message>
> <wsdl:message name="replaceImageResponse">
> <wsdl:part name="status" element="types:status"/>
> </wsdl:message>
> <wsdl:portType name="ImageryServicePortType">
> <wsdl:operation name="addImage">
> <wsdl:input message="tns:addImageRequest"/>
> <wsdl:output message="tns:addImageResponse"/>
> </wsdl:operation>
> <wsdl:operation name="getImage">
> <wsdl:input message="tns:getImageRequest"/>
> <wsdl:output message="tns:getImageResponse"/>
> </wsdl:operation>
> <wsdl:operation name="replaceImage">
> <wsdl:input message="tns:replaceImageRequest"/>
> <wsdl:output message="tns:replaceImageResponse"/>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="ImageryServiceBinding" type="tns:ImageryServicePortType">
> <soap:binding style="wrapped" transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="addImage">
> <soap:operation soapAction="addImage"/>
> <wsdl:input>
> <mime:multipartRelated>
> <mime:part>
> <soap:body parts="body" use="literal"/>
> </mime:part>
> <mime:part>
> <mime:content part="image" type="image/gif"/>
> </mime:part>
> </mime:multipartRelated>
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="getImage">
> <soap:operation soapAction="getImage"/>
> <wsdl:input> 
> <soap:body parts="body" use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <mime:multipartRelated>
> <mime:part>
> <soap:body parts="status" use="literal"/>
> </mime:part>
> <mime:part>
> <mime:content part="image" type="image/gif"/>
> </mime:part>
> </mime:multipartRelated>
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="replaceImage">
> <soap:operation soapAction="replaceImage"/>
> <wsdl:input>
> <mime:multipartRelated>
> <mime:part>
> <soap:body parts="body" use="literal"/>
> </mime:part>
> <mime:part>
> <mime:content part="newImage" type="image/gif"/>
> </mime:part>
> </mime:multipartRelated>
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="ImageryService">
> <wsdl:port name="ImageryService" binding="tns:ImageryServiceBinding">
> <soap:address location="http://192.168.1.1:8080/axis/services/ImageryService"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
> It worked fine when the Image was of type image/jpeg (the wsdl defined the type as image/jpeg), but now that I am trying to send a gif image, I see that the client is still setting the Content-Type in the mime attachment to image/jpeg.
> From what I can see from stepping through the org.apache.axis.encoding.ser.ImageDataHandlerSerialize.serialize() method, when the Data Handler is created the content type for the ImageDataSource() object is not specified and so it defaults to image/jpeg.
> Have I missed something that will allow support for gif (or other content-types)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXIS-1951) Serialization of gif image

Posted by "Ashutosh Shahi (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1951?page=comments#action_65499 ]
     
Ashutosh Shahi commented on AXIS-1951:
--------------------------------------

Karl, 
Can u post a simple test client that u used? I would like to look into this issue.
Ashutosh

> Serialization of gif image
> --------------------------
>
>          Key: AXIS-1951
>          URL: http://issues.apache.org/jira/browse/AXIS-1951
>      Project: Axis
>         Type: Bug
>   Components: SAAJ, Serialization/Deserialization
>     Versions: 1.2RC3
>  Environment: Linux RH Enterprise 4
> Java version 1.4.2_07
>     Reporter: Karl Schwarz

>
> I've got a service defined that is transferring an java.awt.Image using SOAP with attachments.
> Here is the WSDL:
> <wsdl:definitions name="ImageryService"
> targetNamespace="http://examples.com/ImageService"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:types="http://examples.com/ImageService/types"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:tns="http://examples.com/ImageService">
> <wsdl:types>
> <!-- types namespace for this service -->
> <xsd:schema targetNamespace="http://examples.com/ImageService/types"
> xmlns:types="http://examples.com/ImageService/types">
> <!-- Wrapper elements to provide unique signatures for the operations -->
> <xsd:element name="addImage">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element ref="types:ImageInfo"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="replaceImage">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element ref="types:ImageInfo"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="getImage">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element ref="types:ImageInfo"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="ImageInfo">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="name" type="xsd:string"/>
> <xsd:element name="id" type="xsd:int"/>
> <xsd:element name="lat" type="xsd:double"/>
> <xsd:element name="lon" type="xsd:double"/>
> <xsd:element name="time" type="xsd:dateTime"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <!-- Status return for the operations. -->
> <xsd:element name="status" type="xsd:string" />
> </xsd:schema>
> </wsdl:types>
> <!-- Input for the operations. -->
> <wsdl:message name="addImageRequest">
> <!-- first part is the SOAP body -->
> <wsdl:part name="body" element="types:addImage"/>
> <!-- second part is the attachment -->
> <wsdl:part name="image" type="xsd:base64Binary"/>
> </wsdl:message>
> <wsdl:message name="addImageResponse">
> <wsdl:part name="body" element="types:status"/>
> </wsdl:message>
> <wsdl:message name="getImageRequest">
> <!-- first part is the SOAP body -->
> <wsdl:part name="body" element="types:getImage"/>
> </wsdl:message>
> <wsdl:message name="getImageResponse">
> <wsdl:part name="status" element="types:status"/>
> <!-- second part is the attachment -->
> <wsdl:part name="image" type="xsd:base64Binary"/>
> </wsdl:message>
> <wsdl:message name="replaceImageRequest">
> <wsdl:part name="body" element="types:replaceImage"/>
> <wsdl:part name="newImage" type="xsd:base64Binary"/>
> </wsdl:message>
> <wsdl:message name="replaceImageResponse">
> <wsdl:part name="status" element="types:status"/>
> </wsdl:message>
> <wsdl:portType name="ImageryServicePortType">
> <wsdl:operation name="addImage">
> <wsdl:input message="tns:addImageRequest"/>
> <wsdl:output message="tns:addImageResponse"/>
> </wsdl:operation>
> <wsdl:operation name="getImage">
> <wsdl:input message="tns:getImageRequest"/>
> <wsdl:output message="tns:getImageResponse"/>
> </wsdl:operation>
> <wsdl:operation name="replaceImage">
> <wsdl:input message="tns:replaceImageRequest"/>
> <wsdl:output message="tns:replaceImageResponse"/>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="ImageryServiceBinding" type="tns:ImageryServicePortType">
> <soap:binding style="wrapped" transport="http://schemas.xmlsoap.org/soap/http"/>
> <wsdl:operation name="addImage">
> <soap:operation soapAction="addImage"/>
> <wsdl:input>
> <mime:multipartRelated>
> <mime:part>
> <soap:body parts="body" use="literal"/>
> </mime:part>
> <mime:part>
> <mime:content part="image" type="image/gif"/>
> </mime:part>
> </mime:multipartRelated>
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="getImage">
> <soap:operation soapAction="getImage"/>
> <wsdl:input> 
> <soap:body parts="body" use="literal"/>
> </wsdl:input>
> <wsdl:output>
> <mime:multipartRelated>
> <mime:part>
> <soap:body parts="status" use="literal"/>
> </mime:part>
> <mime:part>
> <mime:content part="image" type="image/gif"/>
> </mime:part>
> </mime:multipartRelated>
> </wsdl:output>
> </wsdl:operation>
> <wsdl:operation name="replaceImage">
> <soap:operation soapAction="replaceImage"/>
> <wsdl:input>
> <mime:multipartRelated>
> <mime:part>
> <soap:body parts="body" use="literal"/>
> </mime:part>
> <mime:part>
> <mime:content part="newImage" type="image/gif"/>
> </mime:part>
> </mime:multipartRelated>
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="ImageryService">
> <wsdl:port name="ImageryService" binding="tns:ImageryServiceBinding">
> <soap:address location="http://192.168.1.1:8080/axis/services/ImageryService"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
> It worked fine when the Image was of type image/jpeg (the wsdl defined the type as image/jpeg), but now that I am trying to send a gif image, I see that the client is still setting the Content-Type in the mime attachment to image/jpeg.
> From what I can see from stepping through the org.apache.axis.encoding.ser.ImageDataHandlerSerialize.serialize() method, when the Data Handler is created the content type for the ImageDataSource() object is not specified and so it defaults to image/jpeg.
> Have I missed something that will allow support for gif (or other content-types)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira