Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > CInternetSession Proxy problems

Reply
Thread Tools

CInternetSession Proxy problems

 
 
Chris
Guest
Posts: n/a
 
      01-29-2004
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!
 
Reply With Quote
 
 
 
 
Jack Klein
Guest
Posts: n/a
 
      01-30-2004
On 29 Jan 2004 15:40:56 -0800, http://www.velocityreviews.com/forums/(E-Mail Removed) (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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Facebook Proxy | MySpace Proxy 35085675@qq.com Java 0 08-14-2007 06:35 AM
Closing many CInternetSession objects baronadav@yahoo.com C++ 1 06-20-2006 12:08 AM
Inbound Proxy and Outbound Proxy chellappa VOIP 0 04-07-2006 10:58 AM
Press Release: Scalable SIP Proxy and RTP Media Proxy for NAT traversal sales@lanscapecorp.com VOIP 1 01-23-2006 06:32 PM
Help to set up tomcat 4.1.27 behind socks proxy to access database outside the proxy vidy5300 Java 0 06-07-2004 02:23 PM



Advertisments