C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CInternetSession Proxy problems

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Chris
Guest





PostPosted: Thu Jan 29, 2004 11:40 pm    Post subject: CInternetSession Proxy problems Reply with quote



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!
Back to top
Jack Klein
Guest





PostPosted: Fri Jan 30, 2004 2:55 am    Post subject: Re: CInternetSession Proxy problems Reply with quote



On 29 Jan 2004 15:40:56 -0800, [email]crjones (AT) dttrainer (DOT) com[/email] (Chris) wrote in
comp.lang.c++:

Quote:
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/~ajo/docs/FAQ-acllc.html

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.