Click to See Complete Forum and Search --> : Why 12032 error code return?


aluzi
August 16th, 2006, 12:25 AM
tool:visual c++ 6.0 sp6

I use HTTPSendRequestEx to send a POST request to http server

and than use InternetWriteFile write data to http server

finally I use HTTPEndRequest to end the request

but HTTPEndRequest return me an error code:12032, it means "retry"!

so I use "goto" statement goto HTTPSendRequestEx call to redo the action

and this time HttpEndRequest success!

Why I must resend? Why 12032 will return?

MikeAThon
August 16th, 2006, 10:31 AM
Does the server need an authentication (user name and password), such that the first call to HTTPSendRequest is returning an HTTP status code of 401?

If so, then HttpSendRequestEx will not resubmit a request on its own after receiving the "401 Access Denied" status code from the server. Therefore, HttpEndRequest will fail with an ERROR_INTERNET_FORCE_RETRY error. This error message from HttpEndRequest indicates that the application must go back to HttpSendRequestEx and send all the buffers with InternetWriteFile again.

On the other hand, if the user name and password are known before sending the request (that is, they don't have to be dynamically entered by the user), then user name and password can be supplied directly to the InternetConnect API.

See "How to use HttpSendRequestEx with password-protected URLs" at http://support.microsoft.com/default.aspx?scid=kb;en-us;194700

Mike

Anyhoo
November 29th, 2006, 09:22 AM
I am using a VC++ DLL to upload files from a client to a server using WinInet API calls, using apparently the same procedure as the original poster of this thread. Occasionally and mysteriously I will get Error code 12032 on HttpEndRequest. I have researched this error code and the standard explanations and "fixes" for it do not apply to my situation. I am using anonymous access on the web site, so the user name and password do not have to be passed to IIS. I have code in place that will attempt to re-upload any file that has an error up to ten times before failing. Even with this in place, I sometimes still getting the error 12032, meaning it failed ten times in a row. Note that this code usually works, but sometimes it fails and I want to know why it is failing.

I received this error this morning, and I found that only rebooting would make it work. Restarting IIS did not help. I would like to know why I had to reboot to make this work. I want to understand what is happening on a low level. Can someone explain this to me?

A few more details:

I am using Windows XP SP2/IIS 5.
In this case, the client and server were on the same PC.

If I have not provided enough detail about the problem, ask me whatever you like.

MikeAThon
November 30th, 2006, 10:30 PM
I'm sorry, but the little I know about WinInet I found out by searching. I do not have any prctical experience with the API, since I prefer the basic winsock API instead, even though I need to build my own HTTP requests.

Mike