0

I want to serialize a Qt Image (QImage) in C++ gsoap web service. The web service part where i am confused looks like code below. I want to pass a QImage with other data via web service. i dont want to use xsd:base64Binary, instead i want to use QImage here, but i dont have any idea how. I have searching for last three days, but i could not find help on this topic. Please help me out.

<xsd:complexType name="PersonType">
    <xsd:sequence>
        <xsd:element name="id" type="xsd:string"/>
        <xsd:element name="FirstName" type="xsd:string"/>
        <xsd:element name="LastName" type="xsd:string"/>
        <xsd:element name="Gender" type="xsd:string"/>
        <xsd:element name="BirthDate" type="xsd:string"/>
        <xsd:element name="BirthPlace" type="xsd:string"/>
        <xsd:element name="SocialNumber" type="xsd:string"/>
        <xsd:element name="PersonImage" type="tns:ImageType"/>
    </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="ImageType">
    <xsd:sequence>
        **// What should i specify here in type? How QImage will work here?**
        <xsd:element name="return" type="xsd:base64Binary" 
        xmlns:xmime="http://www.w3.org/2005/05/xmlmime" 
        xmime:expectedContentTypes="image/jpeg"/>
    </xsd:sequence>
</xsd:complexType>
Irfan
  • 1

1 Answers1

0

You can not send an image through SOAP answer because of denied characters and formatting of SOAP. You need to convert to Base64 before send it. I know this procedure increase the size of transfered bytes in 33% but I don`t know another way to do this in a soap answer.

Another way of send this jpeg image, is if you send only URL from this image and make your gSoap server lead with this GET request. It´s a little bit more complitaced, therefore I do´nt see another way if you don`t want to send in Base64.

Celino
  • 325
  • 1
  • 9