Xemuth Messages: 93 Registered: August 2018 Location: France
Hello Everyone !
Nowaday I tried to send a "Soap Request" via the Object HttpRequest
and looking for the result coming from execute Methode.
I have tried this kind of code :
using namespace Upp;
auto test = new HttpRequest("http://www.holidaywebservice.com//HolidayService_v2/HolidayService2.asmx?wsdl");
test->Post("<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:hs='http://www.holidaywebservice.com/HolidayService_v2/'><soapenv:Body><hs:GetHolidaysForMonth><hs:year>2018</hs:year><hs:countryCode>UnitedStates</hs:countryCode><hs:month>11</hs:month></hs:GetHolidaysForMonth></soapenv:Body></soapenv:Envelope>");
reponse = test->Execute();
But it crash with the message : "heap leaks detected" and the exitcode 0.
The heap leaks detected seems related to the LOG/"reponse"
so I tried without them and the result is now a crash with the exitcode : 3224225477
Oblivion Messages: 563 Registered: August 2007 Location: Turkey
Because you've created an HttpRequest on the heap and you forgot to delete it at the end.
This is the VERY reason you should avoid using new/delete.
Try to allocate resources on the stack, or use containers (e.g. One<> for single instance, Array<> for mulitple instances.)