Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting Error 12007 from API Function " httpSendRequest "

328 views
Skip to first unread message

Mishi Abolghasem

unread,
Sep 23, 2003, 10:21:36 PM9/23/03
to
I'm trying to use this sequence of VB-API calls to post to a web-page.

When I do HttpSendRequest , it returns Err.LastDllError=12007(Server name
could not be resolved)

Digital certificate is provided by server admin on my machine.

Here is the code I'm using:

hOpen = InternetOpen("httpGetFile",
INTERNET_OPEN_TYPE_PRECONFIG,vbNullString, vbNullString, 0)
hConnect = InternetConnect(hOpen, sUrl, INTERNET_DEFAULT_HTTPS_PORT,
sUID,sPWD, INTERNET_SERVICE_HTTP, 0, 0)
hRequest = HttpOpenRequest(hConnect, "post", sURL1, "HTTP/1.0",vbNullString,
vbNullString, INTERNET_FLAG_SECURE, 0)
bRes = HttpSendRequest(hRequest, vbNullString, 0, "mystirng", 0)

I don't provide the Digital certificate for the server through the API
function. I don't know how to.
Does anybody know if the problem is with specifying Digital Certificate? If
yes How can I get Digital Certi. info from my machine and passing it to the
server?

Help Please.
thanks
Mishi


Paulo

unread,
Oct 1, 2003, 7:18:47 PM10/1/03
to
Mishi,

I don't know if this gonna help you but if the problem was
the certificate, the HttpOpenRequest call or even the
InternetConnect API calls must return an error too, don't
you agree?

I've just noticed that if you are making the call:


bRes = HttpSendRequest(hRequest, vbNullString,
0, "mystirng", 0)

, but the last argument must be the length for the string.
So it should be bRes = HttpSendRequest(hRequest,
vbNullString, 0, "mystirng", 8) or bRes = HttpSendRequest
(hRequest, vbNullString, 0, "mystirng", Len("mystirng")).

Like i told you i don't know if this will help, but the
API world is a strange one and one error is not ever what
it seems to be.

Let me know if this helped you. Today i'm gonna try to do
the same.

Hugs,
Paulo

0 new messages