Implemented response parsing.
							parent
							
								
									90c8110bd2
								
							
						
					
					
						commit
						1c4976cb0b
					
				@ -0,0 +1,99 @@
 | 
				
			|||||||
 | 
					#include "eetresult.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EetResult::EetResult(QObject *parent) : QObject(parent)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    m_status = RESPONSE_OK;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EetResult::ResponseStatus EetResult::status() const
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return m_status;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void EetResult::setStatus(const EetResult::ResponseStatus &status)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    m_status = status;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QString EetResult::fik() const
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return m_fik;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void EetResult::setFik(const QString &fik)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    m_fik = fik;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EetMessageList EetResult::warnings() const
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return m_warnings;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void EetResult::setWarnings(const EetMessageList &warnings)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    m_warnings = warnings;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EetMessageList EetResult::errors() const
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return m_errors;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void EetResult::setErrors(const EetMessageList &errors)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    m_errors = errors;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QUuid EetResult::uuid() const
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return m_uuid;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void EetResult::setUuid(const QUuid &uuid)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    m_uuid = uuid;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QDateTime EetResult::reciveDate() const
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return m_reciveDate;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void EetResult::setReciveDate(const QDateTime &reciveDate)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    m_reciveDate = reciveDate;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EetMessage::EetMessage(QObject *parent)
 | 
				
			||||||
 | 
					    :QObject(parent)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    m_code = 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EetMessage::EetMessage(int code, const QString &message, QObject *parent)
 | 
				
			||||||
 | 
					    :QObject(parent)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    m_code = code;
 | 
				
			||||||
 | 
					    m_message = message;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int EetMessage::code() const
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return m_code;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void EetMessage::setCode(int code)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    m_code = code;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QString EetMessage::message() const
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return m_message;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void EetMessage::setMessage(const QString &message)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    m_message = message;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,72 @@
 | 
				
			|||||||
 | 
					#ifndef EETRESULT_H
 | 
				
			||||||
 | 
					#define EETRESULT_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <QObject>
 | 
				
			||||||
 | 
					#include <QUuid>
 | 
				
			||||||
 | 
					#include <QString>
 | 
				
			||||||
 | 
					#include <QList>
 | 
				
			||||||
 | 
					#include <QDateTime>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class EetMessage : public QObject
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    Q_OBJECT
 | 
				
			||||||
 | 
					public:
 | 
				
			||||||
 | 
					    explicit EetMessage(QObject *parent = 0);
 | 
				
			||||||
 | 
					    EetMessage(int code, const QString &message, QObject *parent = 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    int code() const;
 | 
				
			||||||
 | 
					    void setCode(int code);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    QString message() const;
 | 
				
			||||||
 | 
					    void setMessage(const QString &message);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					private:
 | 
				
			||||||
 | 
					    int m_code;
 | 
				
			||||||
 | 
					    QString m_message;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef QList<EetMessage*> EetMessageList;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class EetResult : public QObject
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    Q_OBJECT
 | 
				
			||||||
 | 
					public:
 | 
				
			||||||
 | 
					    enum ResponseStatus
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        RESPONSE_OK = 0,
 | 
				
			||||||
 | 
					        DATA_ERROR,
 | 
				
			||||||
 | 
					        SERVER_ERROR,
 | 
				
			||||||
 | 
					        SSL_ERROR,
 | 
				
			||||||
 | 
					        TIMEDOUT
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    explicit EetResult(QObject *parent = 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ResponseStatus status() const;
 | 
				
			||||||
 | 
					    void setStatus(const ResponseStatus &status);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    QString fik() const;
 | 
				
			||||||
 | 
					    void setFik(const QString &fik);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    EetMessageList warnings() const;
 | 
				
			||||||
 | 
					    void setWarnings(const EetMessageList &warnings);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    EetMessageList errors() const;
 | 
				
			||||||
 | 
					    void setErrors(const EetMessageList &errors);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    QUuid uuid() const;
 | 
				
			||||||
 | 
					    void setUuid(const QUuid &uuid);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    QDateTime reciveDate() const;
 | 
				
			||||||
 | 
					    void setReciveDate(const QDateTime &reciveDate);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					private:
 | 
				
			||||||
 | 
					    ResponseStatus m_status;
 | 
				
			||||||
 | 
					    QUuid m_uuid;
 | 
				
			||||||
 | 
					    QDateTime m_reciveDate;
 | 
				
			||||||
 | 
					    QString m_fik;
 | 
				
			||||||
 | 
					    EetMessageList m_warnings;
 | 
				
			||||||
 | 
					    EetMessageList m_errors;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif // EETRESULT_H
 | 
				
			||||||
@ -1,10 +1,10 @@
 | 
				
			|||||||
<soap:Body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="TheBody" xml:id="TheBody">
 | 
					<soap:Body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="TheBody" xml:id="TheBody">
 | 
				
			||||||
    <eet:Trzba xmlns:eet="http://fs.mfcr.cz/eet/schema/v3">
 | 
					<eet:Trzba xmlns:eet="http://fs.mfcr.cz/eet/schema/v3">
 | 
				
			||||||
      <eet:Hlavicka @{dat_odesl} @{overeni} @{prvni_zaslani} @{uuid_zpravy}></eet:Hlavicka>
 | 
					<eet:Hlavicka @{dat_odesl} @{overeni} @{prvni_zaslani} @{uuid_zpravy}></eet:Hlavicka>
 | 
				
			||||||
      <eet:Data @{celk_trzba} @{cerp_zuct} @{cest_sluz} @{dan1} @{dan2} @{dan3} @{dat_trzby} @{dic_popl} @{dic_poverujiciho} @{id_pokl} @{id_provoz} @{porad_cis} @{pouzit_zboz1} @{pouzit_zboz2} @{pouzit_zboz3} @{rezim} @{urceno_cerp_zuct} @{zakl_dan1} @{zakl_dan2} @{zakl_dan3} @{zakl_nepodl_dph}></eet:Data>
 | 
					<eet:Data @{celk_trzba} @{cerp_zuct} @{cest_sluz} @{dan1} @{dan2} @{dan3} @{dat_trzby} @{dic_popl} @{dic_poverujiciho} @{id_pokl} @{id_provoz} @{porad_cis} @{pouzit_zboz1} @{pouzit_zboz2} @{pouzit_zboz3} @{rezim} @{urceno_cerp_zuct} @{zakl_dan1} @{zakl_dan2} @{zakl_dan3} @{zakl_nepodl_dph}></eet:Data>
 | 
				
			||||||
      <eet:KontrolniKody>
 | 
					<eet:KontrolniKody>
 | 
				
			||||||
        <eet:pkp cipher="RSA2048" digest="SHA256" encoding="base64">${pkp}</eet:pkp>
 | 
					<eet:pkp cipher="RSA2048" digest="SHA256" encoding="base64">${pkp}</eet:pkp>
 | 
				
			||||||
        <eet:bkp digest="SHA1" encoding="base16">${bkp}</eet:bkp>
 | 
					<eet:bkp digest="SHA1" encoding="base16">${bkp}</eet:bkp>
 | 
				
			||||||
      </eet:KontrolniKody>
 | 
					</eet:KontrolniKody>
 | 
				
			||||||
    </eet:Trzba>
 | 
					</eet:Trzba>
 | 
				
			||||||
  </soap:Body>
 | 
					</soap:Body>
 | 
				
			||||||
@ -1,13 +1,13 @@
 | 
				
			|||||||
<ds:SignedInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 | 
					<ds:SignedInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 | 
				
			||||||
          <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
 | 
					<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
 | 
				
			||||||
            <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="soap"></ec:InclusiveNamespaces>
 | 
					<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="soap"></ec:InclusiveNamespaces>
 | 
				
			||||||
          </ds:CanonicalizationMethod>
 | 
					</ds:CanonicalizationMethod>
 | 
				
			||||||
          <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></ds:SignatureMethod>
 | 
					<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></ds:SignatureMethod>
 | 
				
			||||||
          <ds:Reference URI="#TheBody">
 | 
					<ds:Reference URI="#TheBody">
 | 
				
			||||||
            <ds:Transforms>
 | 
					<ds:Transforms>
 | 
				
			||||||
              <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:Transform>
 | 
					<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:Transform>
 | 
				
			||||||
            </ds:Transforms>
 | 
					</ds:Transforms>
 | 
				
			||||||
            <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></ds:DigestMethod>
 | 
					<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></ds:DigestMethod>
 | 
				
			||||||
            <ds:DigestValue>${digest}</ds:DigestValue>
 | 
					<ds:DigestValue>${digest}</ds:DigestValue>
 | 
				
			||||||
          </ds:Reference>
 | 
					</ds:Reference>
 | 
				
			||||||
        </ds:SignedInfo>
 | 
					</ds:SignedInfo>
 | 
				
			||||||
					Loading…
					
					
				
		Reference in New Issue