473,668 Members | 2,350 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

storing contents of XML file into CString for WinInet functionality

1 New Member
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.SendR equest 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:
-----------------------------------------------------------------

CInternetSessio n session("My Session");
CHttpConnection * pServer = NULL;
CHttpFile* pFile = NULL;
CString strServerName = "stbupdatetg.st reamingmxd.de";
CString strServerFile = "Update.asp x";
CString strHeaders;
CString xml_content_str ing;

INTERNET_PORT nport = SECURE_INTERNET _PORT;

try
{
pServer = session.GetHttp Connection(strS erverName, INTERNET_FLAG_S ECURE, nport);
pFile = pServer->OpenRequest(CH ttpConnection:: HTTP_VERB_POST, strServerFile, NULL, 1, NULL, NULL, INTERNET_FLAG_S ECURE);



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



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

pFile->SendRequest(NU LL, 0, (LPVOID)(LPCTST R)xml_content_s tring, dwRewLen);

}

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

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

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

Similar topics

2
2900
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, but this is where I'm encountering resistance, as all the bool functions are compiling with the error: local function definitions are illegal. I've never used using namespace std before and was wondering if you had created a header file in...
0
2257
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 happening. The library is the winInet.dll. In the code sample there is a variety of function calls from this dll. Is there a resource for describing these functions, and parameters of such a dll. One function i wish to use is
2
8238
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
2284
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. Regards Neil
9
7905
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
1730
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.) in one master document. I'm not exactly sure which is the most efficient method of going about this. Should I: a. Use a container file like a CAB file and read/write separate textfiles to it? b. Save all "documents" in a collection and serialize...
1
5764
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> bool remove_and_create_if_exists( const std::string& filename
2
8336
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 for all the things I want to persist just for storing in the user settings file (because that would allow other apps to access / change data they shouldn't be able to). I understand how to browse to the object in VS2005 to add an entry to the...
7
2490
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 required by it are rather large, and most of them have email accounts with filesize limits. What I want to do is upload the files they'll need to my webpage and then have the program itself check to see if the files are present in the directories (I...
0
8459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8374
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8890
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8653
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7398
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.