I'm using gSoap for fetch the server's TimeZone from exchange server, My client code is:
#include "soapExchangeServiceBindingProxy.h"
#include "ExchangeServiceBinding.nsmap"
int main()
{
ExchangeServiceBindingProxy service;
service.soap_endpoint = "https://outlook.office365.com/ews/exchange.asmx";
ns1__GetServerTimeZonesType request;
__ns1__GetServerTimeZonesResponse response;
const std::string s("Eastern Standard Time");
request.Ids = (ns2__NonEmptyArrayOfTimeZoneIdType *)&s;
if(service.GetServerTimeZones(&request , response) == SOAP_OK){
std::cout << "Success Response: "<< response.ns1__GetServerTimeZonesResponse << std::endl;
}
else
service.soap_stream_fault(std::cerr);
service.destroy(); // delete data and release memory
return 0;
}
This code compiled successfully but when i tried to run it, it give Segmentation fault, I'm newbie in C++ and gSoap also so i don't know exactly what am i doing wrong here?
If you need more code for this, i'll surly provide it to you, please let me know for this. Any help appreciated. thank you.