×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    6

    soap qt namespace problem

    i'm triing to send a request to a soap service from qt

    here is the code i have:
    Code:
    void DataConnector::checkLogin(QString username, QString password){
        QtSoapMessage request;
        request.setMethod("checkLogin","http://service/"));
        request.addMethodArgument("username","","john");
        request.addMethodArgument("password","","xxxx");
        http->setAction("");
        http->submitRequest(request, "/datacheckService");
    }
    this produces this xml soap-request:
    Code:
    <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/1999/XMLSchema">
        <SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
            <checkLogin xmlns="http://service/">
                <username xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">4444</username>
                <password xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">4444</password>
            </checkLogin>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    the problem is:
    the namespace of checklogin is also used for the elements username and password


    the correct request would be:
    Code:
    <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/1999/XMLSchema">
        <SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
            <checkLogin xmlns="http://service/">
                <username xmlns="" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">4444</username>
                <password xmlns="" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">4444</password>
            </checkLogin>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    how can i make sure qtsoap adds the xmlns="" to the elements username and password?

  2. #2
    Registered User
    Join Date
    Mar 2010
    Posts
    6

    Re: soap qt namespace problem

    i fixed this by getting the source for qtsoap and changing it in there
    but i'm now using phonegap and javascript
    a lot easier

Similar Threads

  1. Problem with soap xml http request [with code]
    By boq in forum Nokia Asha Web Apps
    Replies: 1
    Last Post: 2011-05-31, 11:13
  2. Problem with soap xml http request [with code]
    By boq in forum Nokia Asha Web Apps
    Replies: 0
    Last Post: 2011-05-28, 10:35
  3. problem in soap example
    By nehasaxena in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2011-05-17, 13:50
  4. Location namespace problem
    By Fillinger in forum [Archived] Qt Mobility Project
    Replies: 6
    Last Post: 2010-07-12, 15:06
  5. Python SOAP client problem
    By zolakt in forum Symbian
    Replies: 0
    Last Post: 2010-04-09, 11:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×