mirror of
https://gitlab.com/spaceti-app/integrations/common/server-sdk.git
synced 2026-07-12 13:00:40 +02:00
disabled soap test ( service unavailable )
* renamed files in script based on their names
This commit is contained in:
parent
fdfe31e064
commit
aff09b92da
@ -18,9 +18,11 @@ public:
|
|||||||
private:
|
private:
|
||||||
Q_SLOT void construct();
|
Q_SLOT void construct();
|
||||||
|
|
||||||
Q_SLOT void public_soap_xml();
|
/*Q_SLOT*/ void geocode_soap();
|
||||||
|
|
||||||
Q_SLOT void public_soap_test();
|
/*Q_SLOT*/ void public_soap_xml();
|
||||||
|
|
||||||
|
/*Q_SLOT*/ void public_soap_test();
|
||||||
Q_SLOT void public_soap_test_data();
|
Q_SLOT void public_soap_test_data();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -42,10 +44,58 @@ void SoapTest::construct()
|
|||||||
//QCOMPARE(Utils::sourceData("test/cmd/LatLonListSubgrid-response.xml").count(), 1298);
|
//QCOMPARE(Utils::sourceData("test/cmd/LatLonListSubgrid-response.xml").count(), 1298);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SoapTest::geocode_soap()
|
||||||
|
{
|
||||||
|
const QString soapAction = "https://geoservices.tamu.edu/GeocodeAddressNonParsed";
|
||||||
|
const QString host = "https://geoservices.tamu.edu";
|
||||||
|
const QString endpoint = "/Services/Geocode/WebService/GeocoderService_V04_01.asmx";
|
||||||
|
const QString url = host + endpoint;
|
||||||
|
|
||||||
|
QString xml = QString(R"(<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
|
||||||
|
<soap12:Body>
|
||||||
|
<GeocodeAddressNonParsed xmlns="https://geoservices.tamu.edu/">
|
||||||
|
<streetAddress>string</streetAddress>
|
||||||
|
<city>string</city>
|
||||||
|
<state>string</state>
|
||||||
|
<zip>string</zip>
|
||||||
|
<apiKey>string</apiKey>
|
||||||
|
<version>double</version>
|
||||||
|
<shouldCalculateCensus>boolean</shouldCalculateCensus>
|
||||||
|
<censusYear>Unknown or NineteenNinety or TwoThousand or TwoThousandTen or AllAvailable</censusYear>
|
||||||
|
<shouldReturnReferenceGeometry>boolean</shouldReturnReferenceGeometry>
|
||||||
|
<shouldNotStoreTransactionDetails>boolean</shouldNotStoreTransactionDetails>
|
||||||
|
</GeocodeAddressNonParsed>
|
||||||
|
</soap12:Body>
|
||||||
|
</soap12:Envelope>)");
|
||||||
|
|
||||||
|
QByteArray xmlRequest = xml.toUtf8();
|
||||||
|
|
||||||
|
// SOAP download
|
||||||
|
RequestManager soap;
|
||||||
|
auto response = std::make_shared<SoapRequest>(soapAction, url, xmlRequest);
|
||||||
|
QCOMPARE(response.use_count(), 1L );
|
||||||
|
soap.processRequest(response);
|
||||||
|
QVERIFY(soap.mRequestMap.count() == 1);
|
||||||
|
QSignalSpy spyFinished(&soap, &RequestManager::downloadFinished);
|
||||||
|
|
||||||
|
QVERIFY(spyFinished.wait());
|
||||||
|
//QCOMPARE(response.use_count(), 2L ); // this context + Soap
|
||||||
|
spyFinished.clear();
|
||||||
|
QCOMPARE(response.use_count(), 1L ); // this context + Soap
|
||||||
|
|
||||||
|
// Response
|
||||||
|
QByteArray xmlResponse = Test::sourceData("soap/bankapi-response.xml");
|
||||||
|
QVERIFY( ! xmlResponse.isEmpty());
|
||||||
|
|
||||||
|
QCOMPARE(response.use_count(), 1L ); // this context + Soap
|
||||||
|
QCOMPARE(response->responseData(), xmlResponse);
|
||||||
|
}
|
||||||
|
|
||||||
void SoapTest::public_soap_xml()
|
void SoapTest::public_soap_xml()
|
||||||
{
|
{
|
||||||
QString soapAction = "blz:getBank";
|
QString soapAction = "blz:getBank";
|
||||||
QString endpoint = "http://www.thomas-bayer.com/axis2/services/BLZService";
|
QString url = "http://www.thomas-bayer.com/axis2/services/BLZService";
|
||||||
QString xml = QString("<soapenv:Envelope "
|
QString xml = QString("<soapenv:Envelope "
|
||||||
"xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" "
|
"xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" "
|
||||||
"xmlns:blz=\"http://thomas-bayer.com/blz/\">"
|
"xmlns:blz=\"http://thomas-bayer.com/blz/\">"
|
||||||
@ -61,7 +111,7 @@ void SoapTest::public_soap_xml()
|
|||||||
|
|
||||||
// SOAP download
|
// SOAP download
|
||||||
RequestManager soap;
|
RequestManager soap;
|
||||||
auto response = std::make_shared<SoapRequest>(soapAction, endpoint, xmlRequest);
|
auto response = std::make_shared<SoapRequest>(soapAction, url, xmlRequest);
|
||||||
QCOMPARE(response.use_count(), 1L );
|
QCOMPARE(response.use_count(), 1L );
|
||||||
soap.processRequest(response);
|
soap.processRequest(response);
|
||||||
QVERIFY(soap.mRequestMap.count() == 1);
|
QVERIFY(soap.mRequestMap.count() == 1);
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ns1:getBankResponse xmlns:ns1="http://thomas-bayer.com/blz/"><ns1:details><ns1:bezeichnung>BHF-BANK</ns1:bezeichnung><ns1:bic>BHFBDEFF100</ns1:bic><ns1:ort>Berlin</ns1:ort><ns1:plz>10117</ns1:plz></ns1:details></ns1:getBankResponse></soapenv:Body></soapenv:Envelope>
|
|
||||||
@ -4,11 +4,11 @@
|
|||||||
|
|
||||||
ACTION_YOU_WANT_TO_CALL="blz:getBank"
|
ACTION_YOU_WANT_TO_CALL="blz:getBank"
|
||||||
|
|
||||||
XMLFILENAME=test03-1.2.xml
|
XMLFILENAME=bankapi-1.2.xml
|
||||||
|
|
||||||
URL_OF_THE_SOAP_WEB_SERVICE_ENDPOINT="http://www.thomas-bayer.com/axis2/services/BLZService"
|
URL_OF_THE_SOAP_WEB_SERVICE_ENDPOINT="http://www.thomas-bayer.com/axis2/services/BLZService"
|
||||||
|
|
||||||
curl -X POST $URL_OF_THE_SOAP_WEB_SERVICE_ENDPOINT \
|
curl -X POST $URL_OF_THE_SOAP_WEB_SERVICE_ENDPOINT \
|
||||||
-H 'Content-Type: application/soap+xml;action=$ACTION_YOU_WANT_TO_CALL' \
|
-H 'Content-Type: application/soap+xml;action=$ACTION_YOU_WANT_TO_CALL' \
|
||||||
-H 'SOAPAction: $ACTION_YOU_WANT_TO_CALL' \
|
-H 'SOAPAction: $ACTION_YOU_WANT_TO_CALL' \
|
||||||
--data @$XMLFILENAME > test03-1.2-response.xml
|
--data @$XMLFILENAME > bankapi-1.2-response.xml
|
||||||
|
|||||||
@ -4,11 +4,11 @@
|
|||||||
|
|
||||||
ACTION_YOU_WANT_TO_CALL="blz:getBank"
|
ACTION_YOU_WANT_TO_CALL="blz:getBank"
|
||||||
|
|
||||||
XMLFILENAME=test03.xml
|
XMLFILENAME=bankapi.xml
|
||||||
|
|
||||||
URL_OF_THE_SOAP_WEB_SERVICE_ENDPOINT="http://www.thomas-bayer.com/axis2/services/BLZService"
|
URL_OF_THE_SOAP_WEB_SERVICE_ENDPOINT="http://www.thomas-bayer.com/axis2/services/BLZService"
|
||||||
|
|
||||||
curl -X POST $URL_OF_THE_SOAP_WEB_SERVICE_ENDPOINT \
|
curl -X POST $URL_OF_THE_SOAP_WEB_SERVICE_ENDPOINT \
|
||||||
-H 'Content-Type: text/xml' \
|
-H 'Content-Type: text/xml' \
|
||||||
-H 'SOAPAction: $ACTION_YOU_WANT_TO_CALL' \
|
-H 'SOAPAction: $ACTION_YOU_WANT_TO_CALL' \
|
||||||
--data @$XMLFILENAME > test03-response.xml
|
--data @$XMLFILENAME > bankapi-response.xml
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user