Поиск:

Ответ в темуСоздание новой темы Создание опроса
> [Qt] Soap клиент wsdl 
V
    Опции темы
ecspertiza
Дата 22.5.2009, 12:17 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 763
Регистрация: 3.11.2008
Где: г.Смоленск

Репутация: 4
Всего: 5



Есть такой вопрос как на 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 работает нормально. 


--------------------
С уважением,
мастер конфетного цеха!

онлайн компилер
залип
PM MAIL   Вверх
ecspertiza
Дата 26.5.2009, 14:23 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 763
Регистрация: 3.11.2008
Где: г.Смоленск

Репутация: 4
Всего: 5



Всем спасибо разобрался  smile 


--------------------
С уважением,
мастер конфетного цеха!

онлайн компилер
залип
PM MAIL   Вверх
ecspertiza
Дата 14.6.2009, 23:16 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 763
Регистрация: 3.11.2008
Где: г.Смоленск

Репутация: 4
Всего: 5



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

Сразу скажу я буду работать вот с этими компанентами 
http://www.qtsoftware.com/products/appdev/...ilities/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


--------------------
С уважением,
мастер конфетного цеха!

онлайн компилер
залип
PM MAIL   Вверх
aspirin2003
Дата 15.6.2009, 08:59 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Шустрый
*


Профиль
Группа: Участник
Сообщений: 111
Регистрация: 18.3.2007
Где: Саратов

Репутация: нет
Всего: нет



ecspertiza, спасибо Вам, статья просто замечательная!
PM MAIL   Вверх
abrek
Дата 27.3.2011, 01:26 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 1
Регистрация: 7.7.2009

Репутация: нет
Всего: нет



На основе вашего кода сделал  клиента...
в ответ за запрос получаю:
Код

<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 и т.д. ?

Это сообщение отредактировал(а) abrek - 29.3.2011, 09:11
PM MAIL   Вверх
Denjs
  Дата 11.4.2011, 13:56 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 35
Регистрация: 3.3.2008

Репутация: нет
Всего: нет



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

ссылка на Russian Qt Forum : WSDL, SOAP, Web-Services + Qt (обзор, обсуждение, сбор ссылок) 
Цитата

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


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

Т.к. считаю что у статьи должне быть только один источник - то потому даю только ссылку.
PM MAIL   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Правила форума "С/С++: Кроссплатформенное программирование, QT/Gtk+/wxWidgets"
JackYF
Любитель
  • В заголовке темы в квадратных скобках обозначьте используемую вами библиотеку, например: [QT],[GTK],[wx].
  • Если вопрос актуален только для некоторой версии библиотеки, либо, если вы пользуетесь не самой последней версией, укажите это. Например: [QT4], [GTK2].
  • Все начинающие изучать Qt - не забудьте зайти сюда.
  • Проставьте несколько ключевых слов темы, чтобы её можно было легче найти.
  • В вопросе укажите полную версию версию библиотеки, а также все дополнительные используемые программные пакеты.
  • Не забывайте пользоваться кнопкой "Код".
  • Телепатов на форуме нет! Задавайте чёткий, конкретный и полный вопрос. Указывайте полностью ошибки компилятора и компоновщика.
  • Новое сообщение должно иметь прямое отношение к тематике этого раздела. Флуд, флейм, оффтопик запрещены.
  • Категорически запрещается обсуждение вареза, "кряков", взлома программ и т.д.

Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, JackYF, Любитель.

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | С/С++: Кроссплатформенное программирование, Qt/Gtk+/wxWidgets | Следующая тема »


 




[ Время генерации скрипта: 0.0815 ]   [ Использовано запросов: 21 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.