Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > С/С++: Кроссплатформенное программирование, Qt/Gtk+/wxWidgets > [Qt] Soap клиент wsdl


Автор: ecspertiza 22.5.2009, 12:17
Есть такой вопрос как на Qt написать Soap клиент, который смог бы использовать wsdl файл на сервере?

скачал QtSoap но там ничего про это ненаписано или я просто ничего не понимаю, пока делаю так

Код

SoapServer::SoapServer(const QString &values, QObject *parent)
    : QObject(parent), http(this)
{

    connect(&http, SIGNAL(responseReady()),SLOT(getResponse()));


    QtSoapMessage request;

    request.setMethod("getValues", "http://192.168.1.71");
    request.addMethodArgument("symbol", "", values);

    qDebug() << request.toXmlString();

    http.setHost("http://192.168.1.71/",QHttp::ConnectionModeHttp);
    http.submitRequest(request, "server.wsdl");



    qDebug() << http.header.toString();

    qDebug("Looking up values of %s...", values.toLatin1().constData());
}

void SoapServer::getResponse()
{
    qDebug() << "response";
    const QtSoapMessage &message = http.getResponse();

    if (message.isFault())
    {
        qDebug() << message.toXmlString();
        qDebug("Error: %s", message.faultString().value().toString().toLatin1().constData());
    }
    else {
        const QtSoapType &response = message.returnValue();
        qDebug() << response["Result"].value().toString().toLatin1().constData();
    }
    qApp->quit();
}
 

Код

class SoapServer : public QObject
{
    Q_OBJECT

    public :
        SoapServer(const QString &values,QObject *parent = 0);

    private slots:
        void getResponse();

    private:
        QtSoapHttpTransport http;
};


на что софт мне отвечает что хост не найден, а он есть и аналогичный клиент написанный на php работает нормально. 

Автор: ecspertiza 26.5.2009, 14:23
Всем спасибо разобрался  smile 

Автор: ecspertiza 14.6.2009, 23:16
Так как мне на почту пришло письмо с просьбой описать как можно написать SOAP клиет на QT я решил написать
эту небольшую статью о том как это сделать и реальзовать. Если буду допускать ошибки(а это возможно) то надеюсь более грамотные 
форумчане меня поправят smile

Сразу скажу я буду работать вот с этими компанентами 
http://www.qtsoftware.com/products/appdev/add-on-products/catalog/4/Utilities/qtsoap/

Что нужно для работы с SOAP? Как минимум это сервер, клиент и wsdl файл. Что такое клиент и сервер я описывать небуду т.к. я думаю
это и так понятно, а вот про wsdl немного расскажу. Грубо говаря это файл в котором описаны ваши процудуры и их переменные а также где рассположен сервер.
При написании клиента на PHP мы можем указать путь к wsdl файлу и вызвать нужную нам процудуру, wsdl файл автоматически перенаправит запрос на сервер с нужными параметрами, QT так неумеет(покрайней мере у меня неполучилось). Подробнее о wsdl можно посмотреть тут http://raleigh.ru/XML/w3schools/wsdl/
ну или в www.google.ru

1. Написание wsdl.

Для нашего проекта wsdl файл будет выглядеть вот так
Код

<?xml version='1.0' encoding='UTF-8'?>

<definitions name="server" targetNamespace="urn:server" xmlns:typens="urn:server" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:typens0="http://192.168.1.3/server.php">
    
    <message name='getNameRequest'>
        <part name='symbol' type='xsd:string'/>
    </message>
    <message name='getNameResponse'>
        <part name='Result' type='xsd:string'/>
    </message> 

    <portType name="newsPortType">
        <operation name="getName">
                <input message='tns:getNameRequest'/>
        <output message='tns:getNameResponse'/>
        </operation>
    </portType>

    <binding name="newsBinding" type="typens:newsPortType">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="getName">
            <soap:operation soapAction="urn:newsAction"/>

            <input>
                <soap:body namespace="urn:server" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </input>

            <output>
                <soap:body namespace="urn:server" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </output>

        </operation>
    </binding>

    <service name="newsService">
        <port name="newsPort" binding="typens:newsBinding">
            <soap:address location="http://192.168.1.3/server.php"/>
        </port>
    </service>

</definitions>


Немного расскажу о чём тут написано smile

Код

<operation name="getName">
                <input message='tns:getNameRequest'/>
        <output message='tns:getNameResponse'/>
</operation>


Описывает нашу процедуру input и output указывает на входные и выходные параметры, они описаны вот тут

Код

<message name='getNameRequest'>
  <part name='symbol' type='xsd:string'/>
</message>
<message name='getNameResponse'>
  <part name='Result' type='xsd:string'/>
</message> 

вот в этом месте указанно рассположение сервера
Код

<service name="newsService">
        <port name="newsPort" binding="typens:newsBinding">
            <soap:address location="http://192.168.1.3/server.php"/>
        </port>
</service>

и ещё вот тут
Код

xmlns:typens0="http://192.168.1.3/server.php

просьба поменять на своё расположение сервера smile http:// указывать обязательно!!!

2. Написание сервера.

Сервер я решил писать на PHP так как на мой взгляд он отлично подходит для написания серверов(это ИМХО),
Код

<?php  
class ValueService {  
    

  function getName($symbol) 
  {  
     return "Hello $symbol"; 
  }
}  

//require_once("DB_Connect.php");

$server = new SoapServer("server.wsdl");  
$server->setClass("ValueService");  
$server->handle();  
?>

небольшое описание 
Код

class ValueService {  
    

  function getName($symbol) 
  {  
     return "Hello $symbol"; 
  }
}

создаём класс для работы, в нём будет наша процедура.
Код

$server = new SoapServer("server.wsdl");

создаём объект класса SoapServer в нём указываем путь к wsdl файлу.
Код

$server->setClass("ValueService");

говарим с каким классом работать.

3. Написание Клиента.

Вот и добрались, я выложу исходники на PHP на всякий случай вдруг комуто понадабятся их описывать небуду
Код

<?php  

$client = new SoapClient("http://192.168.1.3/server.wsdl",array(  
    "trace"      => 1,
    "exceptions" => 0));



  if (is_object($client) == true)
    echo "true";
  else
    echo "false";

  try {  
    echo "<pre>\n";  
    print($client->getName("qwerty"));
    print "\n";    
    print "Заголовок :\n".htmlspecialchars($client->__getLastRequestHeaders()) ."\n";
    print "Запрос :\n".htmlspecialchars($client->__getLastRequest()) ."\n"; 
    print "Заголовок:\n".htmlspecialchars($client->__getLastResponseHeaders())."\n";
    print "Ответ:\n".htmlspecialchars($client->__getLastResponse())."\n";
    echo "\n</pre>\n";  
  } catch (SoapFault $exception) 
  {  
    echo $exception; 
    echo "\n";
    print "Заголовок :\n".htmlspecialchars($client->__getLastRequestHeaders()) ."\n";
    print "Запрос :\n".htmlspecialchars($client->__getLastRequest()) ."\n"; 
    print "Заголовок:\n".htmlspecialchars($client->__getLastResponseHeaders())."\n";
    print "Ответ:\n".htmlspecialchars($client->__getLastResponse())."\n";
  } 

?>

а вот собственно наверное то до чего так долго читали, исходники на QT

main.cpp
Код

#include <QtCore/QCoreApplication>
#include <QDebug>

#include "soapclient.h"

#define USAGE2 QT_TRANSLATE_NOOP("SoapClient::main", "usage: %s <name>")

int main(int argc, char *argv[])
{
    if (argc < 2) {
        qDebug(USAGE2, argv[0]);
        qDebug(" ");

        return 1;
    }

    QCoreApplication a(argc, argv);

    SoapClient client(argv[1],0);

    return a.exec();
}


Здесь ничего сложного создаём объект SoapClient и передаём в него параметр

soapclient.h
Код

#ifndef SOAPCLIENT_H
#define SOAPCLIENT_H


#include <QtSoap/qtsoap.h>
#include <QDebug>


class SoapClient : public QObject
{
    Q_OBJECT

    public :
        SoapClient(const QString &name,QObject *parent = 0);

    private slots:
        void getResponse();

    private:
        QtSoapHttpTransport http;
};

#endif // SOAPSERVER_H


Описание класса SoapClient принимает строковый параметр.  

soapclient.cpp
Код

#include "soapclient.h"

SoapClient::SoapClient(const QString &name,QObject *parent)
    : QObject(parent), http(this)
{

    connect(&http,SIGNAL(responseReady()),this,SLOT(getResponse()));

    QtSoapMessage request;

        request.setMethod("getName", ""); // Вызываемая процедура
        request.addMethodArgument("symbol","",name); //Параметры

        qDebug() << request.toXmlString();

        http.setHost("192.168.1.3"); // Хост без http:// это важно
        http.setAction("urn:newsAction"); // SOAP action его можно посмотреть в wsdl файле
        http.submitRequest(request, "/server.php"); // путь к серверу

        qDebug() << "Locking up " << name;

}

void SoapClient::getResponse()
{
    qDebug() << "response";
    const QtSoapMessage &message = http.getResponse(); // принемаем сообщение

    if (message.isFault()) // если невалидно то ошибка
    {
        qDebug() << message.toXmlString();
        qDebug("Error: %s", message.faultString().value().toString().toLatin1().constData());
    }
    else
    {
        const QtSoapType &response = message.returnValue(); // т.к. сообщение приходит в виде xml его нужно поместить в специальный класс для работы с ним 
        
        qDebug() << message.toXmlString(); 
        qDebug() << response.value().toString().toLatin1(); // выводим результат 
    }

    qApp->quit();;
}


вот вобщемто и всё думаю с установкой компанентов и сборкой разобраться несложно smile

А также граждане программеры RTFM, и смотрите экзамплы и всё сразу станет понятным smile

P.S. Неругайте сильно за ошибки синтаксические и речевые, буду признателен если укажите на ошибки в теории, надеюсь каму нибудь эта статья поможет smile

Автор: aspirin2003 15.6.2009, 08:59
ecspertiza, спасибо Вам, статья просто замечательная!

Автор: abrek 27.3.2011, 01:26
На основе вашего кода сделал  клиента...
в ответ за запрос получаю:
Код

<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/">
<GetCardInfoResponse xmlns="AIST-CARDS-USER-SERVICE">
<GetCardInfoResult xmlns="AIST-CARDS-USER-SERVICE">
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<element xmlns="http://www.w3.org/2001/XMLSchema">
<complexType xmlns="http://www.w3.org/2001/XMLSchema">
<choice xmlns="http://www.w3.org/2001/XMLSchema">
<element xmlns="http://www.w3.org/2001/XMLSchema">
<complexType xmlns="http://www.w3.org/2001/XMLSchema">
<sequence xmlns="http://www.w3.org/2001/XMLSchema">
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
<element xmlns="http://www.w3.org/2001/XMLSchema">
<simpleType xmlns="http://www.w3.org/2001/XMLSchema">
<restriction xmlns="http://www.w3.org/2001/XMLSchema">
<maxLength xmlns="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></maxLength>
</restriction>
</simpleType>
</element>
</sequence>
</complexType>
</element>
</choice>
</complexType>
</element>
</schema>
<diffgram xmlns="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet>
<ACCOUNTING>
<REALM_ID xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">2</REALM_ID>
<CARD_NAME xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">Тут номер карты</CARD_NAME>
<USER_NAME xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">Тут имя</USER_NAME>
<USER_EMAIL xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">Тут почта</USER_EMAIL>
 ...
</ACCOUNTING>
</NewDataSet>
</diffgram>
</GetCardInfoResult>
</GetCardInfoResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


как из такой конструкции извлечь значения USER_EMAIL, USER_NAME и т.д. ?

Автор: Denjs 11.4.2011, 13:56
Можно я посмею немного попиариться - т.к. тема важная, и польза от пиара будет.

ссылка на Russian Qt Forum : http://www.prog.org.ru/index.php?topic=16542.msg110104 
Цитата

В данном топике попробую собрать актуальную информацию по вопросам связки C++/Qt и веб-сервисов.
Т.е. все что актуально на 2011, январь, 30. 2011, февраль, 17.


Там рассматриваются QtSOAPAxis2/CWSF StaffgSoapKdSoapFEAST.
Есть ссылки на сайты, примеры связки с Qt -  в топике и ссылки на примеры, сравнительные харакетристики, рассуждения и пр.

Т.к. считаю что у статьи должне быть только один источник - то потому даю только ссылку.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)