473,506 Members | 17,176 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CInternetSession Proxy problems

Hello,

I have a program that uses the CInternetSession and CHttpConnection
mfc classes to register the program...it works for the majority of our
customers, but a few have received errors, all of whom are going
through proxy servers. Specifically, we have encountered a 400 error,
a 500 error, and a 12152 error. On the 500, we have noticed that part
of the url is appended to the sendstring twice, but have no idea why.
Is there anyone out there who has experience with proxies that could
shed some light on these errors? I believe that they could be fixed by
editing the proxy settings, but we deal with many school districts as
our customers and do not have access to the proxies. It would be best
if we could harden our code so that these problems are resolved.
here is a sample of the code we use:

CInternetSession* session;
CHttpConnection* pHttpconnection;
CHttpFile* pFile;

session=new CInternetSession();
try
{
pHttpconnection = session->GetHttpConnection((LPCTSTR)m_sURL);
}
catch(CInternetException *pCause)
{
dwRet=pCause->m_dwError;
errorMsg.Format(_T("Could not get connection to Web Server. Check your
high speed or dial up connection. Error: #%u."), dwRet );
MessageBox((LPCTSTR)errorMsg,_T("Registration Problem"));
session->Close();
delete session;
return(FALSE);
}

try
{
pFile = pHttpconnection->OpenRequest(_T("GET"
),sSendString,NULL,1,NULL,NULL,INTERNET_FLAG_KEEP_
CONNECTION);
}
catch(CInternetException *pCause)
{
dwRet=pCause->m_dwError;
errorMsg.Format(_T("Could not open request to Web Server. Try again
later. Error: #%u."), dwRet );
MessageBox((LPCTSTR)errorMsg,_T("Registration Problem"));
session->Close();
delete session;
pFile->Close();
delete pFile ;
return(FALSE);
}

dwRet = HTTP_STATUS_OK;
try
{
pFile->SendRequest();
}
catch(CInternetException *pCause)
{
dwRet=pCause->m_dwError;
errorMsg.Format(_T("Could not get send request to Web Server. Check
your high speed or dial up connection. Error: #%u."), dwRet );
MessageBox((LPCTSTR)errorMsg,_T("Registration Problem"));
pHttpconnection->Close();
delete pHttpconnection;
session->Close();
delete session;
pFile->Close();
delete pFile ;
return(FALSE);
}
pFile->QueryInfoStatusCode(dwRet);
an example of m_sURL: "webservice.ourdomain.com"
and of the sendstring:
"/webservicefolder/default.asmx/ProcessReq?clientXMLString=<*data*>"
Thank you very much for any help!
Jul 22 '05 #1
1 6714
On 29 Jan 2004 15:40:56 -0800, cr*****@dttrainer.com (Chris) wrote in
comp.lang.c++:
Hello,

I have a program that uses the CInternetSession and CHttpConnection
mfc classes to register the program...it works for the majority of our


[snip]

Then you need to ask in a group that supports MFC, perhaps one in one
of the news:microsoft.public.* family. We discuss the C++ language
here, not Microsoft or any other non-standard extensions, so this is
not a language question. C++ itself does not have MFC,
CInternetSession, or the other things you asked about.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
17634
by: Fuzzyman | last post by:
In a nutshell - the question I'm asking is, how do I make a socket conenction go via a proxy server ? All our internet traffic has to go through a proxy-server at location 'dav-serv:8080' and I...
6
7902
by: harry | last post by:
Hi, I have a program that runs on multiple client pc's. Occasionally one or more of those pc's use VPN to connect to another corporate network. When using VPN they need to set proxy server in...
6
1715
by: John Sheppard | last post by:
Hello there, I am unsure as to where to ask for help about this, so I thought I might try here. Our website works correctly for 99.9% of customers, however we have one set of customers who...
3
9118
by: Codex Twin | last post by:
Hello apologies if this is the wrong newsgroup to be sending this to. Basically, I have an ASP.NET application that I am trying to force to use a proxy server settings. This can be done by...
1
3126
by: Barry | last post by:
Hi Does anyone know which is the equivalent class in C# for the MFC class "CInternetSession". TIA Barry
2
10676
by: chris | last post by:
Hi, I am trying to upload files on FTP and used the code below: Dim request As FtpWebRequest request = WebRequest.Create("ftp://ftp...../test.txt") request.Method =...
1
2081
by: baronadav | last post by:
Greetings, My application suppose to identify one web site for a pool of about 100 different websites. i.e at any given time it is connected to only one website (say google.com), however it...
2
1459
by: Andrew Jackson | last post by:
Hi all... My app is a .net2 winforms app written in c# using visual studio 2005. I have added a web reference to (what I consider) a fairly large web service. When I try to use the web service...
5
1583
by: Simon | last post by:
I have problem with namespaces. I have a program that consumes the web service and has for instance names space nsProgram. In this program I have defined several classes that I use for storing and...
0
7103
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...
0
7307
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,...
0
7370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7478
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...
0
4701
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...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
409
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...

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.