473,320 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

storing contents of XML file into CString for WinInet functionality

Hello,

I have been placed on a new project involving development for Windows CE using Visual C++. I have to send an XML file via a SSL connection to a server followed by receiving a corresponding response XML file from the server. I was trying to use the WinInet MFC classes provided with Visual C++ 2005.

The problem is, I have an XML file that I need to send via the post method in the Request to the server. However, I am new to this and not sure how to first store the contents of the XML file into a CString object as the CHttpFile.SendRequest method accepts a pointer to a string as an input for the data to send to the server.

Here's the code that I am trying to use:
-----------------------------------------------------------------

CInternetSession session("My Session");
CHttpConnection* pServer = NULL;
CHttpFile* pFile = NULL;
CString strServerName = "stbupdatetg.streamingmxd.de";
CString strServerFile = "Update.aspx";
CString strHeaders;
CString xml_content_string;

INTERNET_PORT nport = SECURE_INTERNET_PORT;

try
{
pServer = session.GetHttpConnection(strServerName, INTERNET_FLAG_SECURE, nport);
pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST, strServerFile, NULL, 1, NULL, NULL, INTERNET_FLAG_SECURE);



// ********** Here is where I need to parse the xml file into and store it's contents into the xml_content_string!! BUT HOW????**********



DWORD dwRewLen = xml_content_string.GetLength();
strHeaders.Format(_T("Content-Type: text/xml; charset=utf-8\nContent-Length:%d"),
dwRewLen);

pFile->SendRequest(NULL, 0, (LPVOID)(LPCTSTR)xml_content_string, dwRewLen);

}

The name of the XML file is "SampleUpdateRequest.xml" and it's size is only 1Kb.

I would appreciate any help!!!!
Oct 19 '06 #1
0 2515

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: muser | last post by:
Karl this is albeit your program, in the program that you wrote for me I learned quite alot, i didn't realise I could return NULL for instance or even use functions without first declaring them,...
0
by: Gerry Abbott | last post by:
Hi All, Im trying to get som ftp functionality into my application, and have some code I sourced from this NG. I'm trying to tailor it for my needs, but need a better understanding of whats...
2
by: netuser | last post by:
Where can I find examples how to use WinInet in C#? I saw some in Wisual Basic, but none in C#. Thanks.
8
by: Neil Rowe | last post by:
Hi all I am writing an App at the moment and I need to be able to download & Upload xml files from an ftp server. Does anyone know how this can be done without using a third party component. ...
9
by: John Howard | last post by:
How can I read a text file that is on a UNIX server in VB.Net? Please keep it simple. Thanks, John
2
by: Chris Murphy via DotNetMonster.com | last post by:
Hey all, just wondering if anyone can point me in the right direction. I'm developing a solution that allows a user to store multiple text-based content (like code snippets, notes, documents etc.)...
1
by: ma740988 | last post by:
Trying to some of my reading on file manipulation (ifstream/ofstream/fstream) into action. So now consider. # include <iostream> # include <fstream> # include <cstring> # include <sstream> ...
2
by: Paul Hadfield | last post by:
Hi, I'm not having a lot of luck googling for this one, I want to be able to store a custom class in the user settings (DotNet2.0, win app). I don't wish to create public get / set properities...
7
by: Steve | last post by:
Hello, I am a beginner/intermediate c++ coder. I have a program that I am writing and would like to be able to distribute to some of my friends. The problem with this is that the data files...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.