Try this test code, set the breakpoint on the line "concurrency::streams::streambuf<uint8_t> rwbuf = concurrency::streams::file_buffer<uint8_t>::open(fileName).get();"
and debug it to see if the size of result vector is [size] = 0x0002ac7c
and debug it to see if the size of result vector is [size] = 0x0002ac7c
int _tmain(int argc, _TCHAR* argv [])
{
auto fileName = L"D:\\sample.xml";
// Pop up
web::http::uri_builder uribuilder(L"http://www.ga.gov.au/flood-study-search-gws/ows?service=wms&version=1.1.1&request=GetCapabilities");
http_client client(uribuilder.to_uri());
client.request(methods::GET).then([=](http_response response){
return response.extract_vector();
}).then([=](std::vector<uint8_t> result){
concurrency::streams::streambuf<uint8_t> rwbuf = concurrency::streams::file_buffer<uint8_t>::open(fileName).get();
rwbuf.putn(&result[0], result.size()).wait();
rwbuf.close();
}).wait();
return 0;
}
From my computer, I can save the xml file correctly.