Results 1 to 10 of 10

Thread: QtSoap and .NET urgently need help

  1. #1
    Join Date
    Aug 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QtSoap and .NET urgently need help

    Hi All,
    Please help or suggest on this issue.

    I convert QDomDocument to QString with following code.

    QString xmlRequest = doc.toString();

    The got the result as

    <TT>100</TT>
    <TR>001</TR>
    <TE>ACK</TE>

    Once convert from QString to QSaopMessage with following code

    QtSoapMessage request;
    request.setMethod("Post", "http://SomeURL.com/SUB/SUB1");
    request.addMethodArgument("SUB_Request", "", xmlRequest);

    The result will be like this

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
    <SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <Post xmlns="http://SomeURL.com/SUB/SUB1">
    <SUB_Request>
    &lt;TT>100&lt;/TT> // <- need "<" instead of "&lt;"
    &lt;TR>001&lt;/TR>
    &lt;TE>RECEIPT&lt;/TE>
    </Post>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    How can I get "<" instead of "&lt;" in body message.
    Please 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 and .NET urgently need help

    You have to add the items to the soap structure one by one. Otherwise soap library doesn't know it should preserve the tags and encodes them to xml entities.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QtSoap and .NET urgently need help

    Thanks a lot for your advises.

    As your reply that means my code as below
    not be able to use for soap message.
    Is correct ?. Then I have to use soap structure
    instead QDomDocument. Please advises.

    QDomDocument doc("");
    QDomElement sub01 = doc.createElement("Control xmlns=''");
    doc.appendChild(sub01);

    // TransactionType
    QDomElement tag01 = doc.createElement("TT");
    sub01.appendChild(tag01);
    QDomText _tag01 = doc.createTextNode("100");
    tag01.appendChild(_tag01);

    // TransactionReverse
    QDomElement tag02 = doc.createElement("TR");
    sub01.appendChild(tag02);
    QDomText _tag02 = doc.createTextNode("O01");
    tag02.appendChild(_tag02);

    // TransactionEvent
    QDomElement tag03 = doc.createElement("TE");
    sub01.appendChild(tag03);
    QDomText _tag03 = doc.createTextNode("ACK");
    tag03.appendChild(_tag03);

    QString xmlRequest = doc.toString(); //

    The got the result as

    <TT>100</TT>
    <TR>001</TR>
    <TE>ACK</TE>

  4. #4
    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 and .NET urgently need help

    You can use QDomDocument as long as you convert its contents to QtSoapStruct (or whatever that class was called).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Aug 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QtSoap and .NET urgently need help

    Thanks for your advise.

    I have tried to see Qt Document for converting QDomDocument to QtSoapStruct
    but unfortunately not found on related issue. Can you give me some sample or
    any suggestion on convert QDomDocument to QtSoapStruct.

    Thanks in advances for your help.

  6. #6
    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 and .NET urgently need help

    Where have you been looking for it? I can clearly see a method for parsing a dom document into QtSoapStruct in the docs...
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Aug 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QtSoap and .NET urgently need help

    As my code below, I already have QDomDocument then How can I convert to QtSoapStruct. Other one that I tried to create QtSoapStruct as sample in qtsoap document. When I display the value I did not see any value as insertion on each item.
    Please see below "Start QtSoapStruct"

    ------ Start QDomDocument and How to convert to QtSoapStruct--------
    Qt Code:
    1. QDomDocument doc("");
    2. QDomElement sub01 = doc.createElement("Control xmlns=''");
    3. doc.appendChild(sub01);
    4.  
    5. // TransactionType
    6. QDomElement tag01 = doc.createElement("TT");
    7. sub01.appendChild(tag01);
    8. QDomText _tag01 = doc.createTextNode("100");
    9. tag01.appendChild(_tag01);
    10.  
    11. // TransactionReverse
    12. QDomElement tag02 = doc.createElement("TR");
    13. sub01.appendChild(tag02);
    14. QDomText _tag02 = doc.createTextNode("O01");
    15. tag02.appendChild(_tag02);
    16.  
    17. // TransactionEvent
    18. QDomElement tag03 = doc.createElement("TE");
    19. sub01.appendChild(tag03);
    20. QDomText _tag03 = doc.createTextNode("ACK");
    21. tag03.appendChild(_tag03);
    22.  
    23. QString xmlRequest = doc.toString();
    To copy to clipboard, switch view to plain text mode 

    ----------End QDomDocument----------


    ------------Start QtSoapStruct. Did not display and value from insertion-----------
    Qt Code:
    1. QtSoapStruct myStruct(QtSoapQName("xxx"));
    2. myStruct.insert(new QtSoapSimpleType(QtSoapQName("item1"), 5));
    3. myStruct.toDomElement(Noo);
    4. myStruct.insert(new QtSoapSimpleType(QtSoapQName("item2"), "hello"));
    5. myStruct.toDomElement(Noo);
    6. myStruct.insert(new QtSoapSimpleType(QtSoapQName("item3"), true));
    7. myStruct.toDomElement(Noo);
    8.  
    9. QString xml = Noo.toString();
    10.  
    11. qDebug() << xml;
    To copy to clipboard, switch view to plain text mode 
    --------------End QtSoapStruct----------------
    Last edited by wysota; 30th October 2009 at 09:35. Reason: missing [code] tags

  8. #8
    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 and .NET urgently need help

    Hmm... Haven't you noticed QtSoapStruct::parse()?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Aug 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QtSoap and .NET urgently need help

    Thanks for your suggestion but nothing help.

  10. #10
    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 and .NET urgently need help

    Care to explain?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. qtsoap with .net webservice
    By drbergie in forum Qt Programming
    Replies: 11
    Last Post: 12th February 2009, 08:46
  2. Qt configure with msvc.net
    By jivanr in forum Installation and Deployment
    Replies: 1
    Last Post: 11th June 2007, 08:17
  3. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  4. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41
  5. Qt and .NET
    By Brandybuck in forum Qt Programming
    Replies: 6
    Last Post: 6th July 2006, 01:01

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.