Results 1 to 18 of 18

Thread: qtsoap

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2007
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default qtsoap

    qtsoap for sending image data can any body help?????

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qtsoap

    Could you elaborate? There is a soap client available as part of Qt Solutions for commercial use.

  3. #3
    Join Date
    Mar 2006
    Posts
    140
    Thanks
    8
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qtsoap

    Hi,

    It would help if you could let use know in detail what you're trying to do / thinking so we can best answer your questions.

    Here's my take on soap style communcation in Qt:
    I did a job recently where I wrote an image uploader for a document imaging backend.
    The developer of the backend developed his own Java web service transport format which was very similar to SOAP in concept (Why he never used in the first place is beyond me...sheesh).
    To send the images I'd request that a 'Batch' be created, then the server returned a receipt which was an xml document (Batch Receipt), then I'd upload the images to his server with a standard QHttp request and I'd receive back an Image Receipt xml document which would state the name assigned to the file by the server. So I'd end up with a list of uploaded filenames.
    Then I'd add these names as elements to the first Batch Receipt xml document I received then send that back to the server in 'Commit' mode.

    I can't say what was going on in the server because I didn't write it.
    But you could use this sort of technique or even Base 64 encode the image files into the xml document and send it all as one request. It really depends on your situation.
    I haven't used the QtSoap library so I can't comment on how to use it.

    Just remember that the SOAP stuff is just a way of getting the data across and you can do it in one step or many. The reason we uploaded images one at a time was due to the image quality. We were scanning up to A0 maps at 400 - 600 dpi so the files were massive. Also, an single batch could have hundreds of images. Sending any more than one at a time wasn't feasible, but in your case it might be okay to base 64 encode your images straight into an element in the xml document.

    If you need to actually use SOAP (which is probably the best way to go) then you'll need QtSoap if you have a commercial licence to Qt, or you could have a look into how http://qsoapman.sourceforge.net/ works.


    I hope this helps,

    Steve York

  4. #4
    Join Date
    Feb 2007
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qtsoap

    hai

    thanks for responding so fast, well i did go through the qt soap, the problem i am facing is

    how to send base64binary , int, float type values the QtSoapMessage class has an

    addMethodArgument function which i take is what is used to send arguments to the function

    with the execption of one all takes string type values. while the other one takes a QtSoapType * . The QTSoapType class does not provide any way to pass value of the variable or he variable name . The webservice i plan to use have methods that take int, float

    as well as base64 encoded image. can you please tell me how to use

    addMethodArgument function or something else that can be used to pass base64 encoded
    binary jpeg as well as other datatypes. my main concern is how to send the value .


    for eg i have a function that takes a string , base64binary encoded jpeg image and double

    how should i populate the QSoapMessage object with values i mean which all functions

    can be used.

    thanks in advance

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qtsoap

    Quote Originally Posted by anoop View Post
    how to send base64binary , int, float type values the QtSoapMessage class has an

    addMethodArgument function which i take is what is used to send arguments to the function

    with the execption of one all takes string type values. while the other one takes a QtSoapType * . The QTSoapType class does not provide any way to pass value of the variable or he variable name .
    You have to construct it using QtSoapSimpleType and its parse() method from an xml node.

    As for integers, you can use addMethodArgument directly, there are overloads provided for bool and int types.

  6. #6
    Join Date
    Feb 2007
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Red face How to ? Sending and Receiving Binary Data in an Array Through QT SOAP

    Hello all Fellow QT programmers

    Can any one tell me in the Scenario where i am supposed to send an image file encoded to Base64 and send as Binary data to SOAP web service using QT SOAP Libraries

    How will I send Binary data in an Array and get the Response from the Web Service VIA QT

    The Web service Where the QT SOAP has to send the image is located here

    http://xrl.us/urur

    Please do tell me how will i pass the Binary Data here in this Case the image to the Web Service Via QT SOAP Libraries

    Thanks in Advance

    Yours Friendly QT programmer

    Roger
    Last edited by MaxProgrammer; 13th February 2007 at 13:07. Reason: updated contents

  7. #7
    Join Date
    Feb 2007
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qtsoap

    How to addmethodargument function to pass base64 binary encoded JPG Image to a Webservice using SOAP ?

    addmethodargument function allows to pass primitive methods like Int Bool and String how ever it allows only QtSoapType for passing other types QtSoapType class or its derivatives QtSoapType symbol type does not provide any method to pass value alothough it allows to set the type like Base64 Binary

    Pls tell me how will i actually pass value to this particular class when the type is Base64 Binary

    Thanks in Advance

  8. #8
    Join Date
    Feb 2007
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qtsoap

    where to give the Value of the Array ie the Encoded Base64 binary JPG image to the the Web Service Via SOAP

    QtSoapArray ( const QtSoapQName & name, QtSoapType::Type type = Other, int size0 = -1, int size1 = -1, int size2 = -1, int size3 = -1, int size4 = -1 )

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qtsoap

    This is a quote from:
    http://doc.trolltech.com/solutions/4...tsoaptype.html

    SOAP supports the types described in XML Schema Part 2: Datatypes listed at http://www.w3.org/TR/xmlschema-2/. The following values are represented using QtSoapSimpleType, except where noted.
    QtSoapType::Base64Binary is among them.

    And you can construct it through:

    bool QtSoapSimpleType:arse ( QDomNode node ) [virtual]

    Inspects node and constructs the QtSoapSimpleType content if node qualifies as a SOAP simple type. Returns true if it does; otherwise returns false.

    Reimplemented from QtSoapType.
    Just look at the xml schema from the url in the docs to see how should a particular type be created.

  10. The following user says thank you to wysota for this useful post:

    anoop (14th February 2007)

  11. #10
    Join Date
    Feb 2007
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qtsoap

    hai

    can you give me a code snippet or else tell me how to proceed, i mean how to use the parse function to get the base64encoded passed as an argument to the webservice
    method

    thanks in addvance

  12. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qtsoap

    No, I can't give you a code snippet as I don't have access to QtSoap, so I won't be able to test it.
    Just construct a QDomElement with data formatted as the xml document says and pass it to QSoapSimpleType::parse(). Remember that first you have to encode the data with base64 (if you don't know what that is, ask Google).

    Edit:
    Most probably it'll just be
    xml Code:
    1. <base64Binary>base64 encoded data goes here</base64Binary>
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 14th February 2007 at 11:41.

  13. #12
    Join Date
    Feb 2007
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qtsoap

    How Will i add
    Base64Binary ::= ((B64S B64S B64S B64S)*
    ((B64S B64S B64S B64) |
    (B64S B64S B16S '=') |
    (B64S B04S '=' #x20? '=')))?

    add Base64 encoded image into a QDomNode element

  14. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qtsoap

    Quote Originally Posted by anoop View Post
    How Will i add
    Base64Binary ::= ((B64S B64S B64S B64S)*
    ((B64S B64S B64S B64) |
    (B64S B64S B16S '=') |
    (B64S B04S '=' #x20? '=')))?
    This is just a grammar, you don't need it, just get a base64 encoder or write one yourself, it's trivial.

    add Base64 encoded image into a QDomNode element
    Qt Code:
    1. QBuffer buf;
    2. QImage img; // contains your image
    3. img.save(&buffer, "JPEG");
    4. QString encodedstring = base64(buffer.data().constData());
    5. QDomElement elem = doc.createElement("base64Binary");
    6. elem.setAttribute("name", "somename");
    7. elem.appendChild(doc.createTextNode(encodedstring));
    8. QSoapSimpleType arg;
    9. arg.parse(elem); // this should get you a valid QSoapSimpleType object
    To copy to clipboard, switch view to plain text mode 

  15. The following user says thank you to wysota for this useful post:

    anoop (14th February 2007)

  16. #14
    Join Date
    Feb 2007
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qtsoap

    How Will i add Base64 encoded image into a QDomNode element

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.