This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Microsoft XML > February 2005 > ServerXMLHTTP and runtime error codes
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
ServerXMLHTTP and runtime error codes
|
|
| Stephen Malbon 2005-02-22, 6:42 pm |
| I'm using a ServerXMLHTTP object to post data to a remote server, this from
a COM object used by both VB applications and other COM objects that are
used from ASP pages. I'm using the open() method set to operate
asynchronously so that it returns immediately and I can use the
WaitForResponse method to attempt to get a response, using a timeout value
read from an INI file. This all works fine when everyting is OK. However, my
COM objects are running on a network behind a firewall (and switches and
routers) and the URLs to which I post data are hosted on remote servers
which are also behind firewalls etc. hence there's the possibility that the
URL will sometimes be unreachable. In this case I get a runtime error thrown
by the WaitForResponse method (and not the Open or Send methods somewhat to
my surprise). My VB error handler catches these and I can see that the
errors have meaningful textual descriptions ("unable to establish connection
with server", for instance) but ideally I'd like to know the numerical
values of the error codes for "failed to resolve address", "failed to send
data" etc. are so that my code my decide definitively what went wrong. Where
can I find what these values are?
SteveM
| |
| Jerry West 2005-02-22, 6:42 pm |
| Do you mean these codes?
Public Enum SERVER_ERROR_CODES
HTTP_STATUS_OK = 200
HTTP_STATUS_CREATED = 201
HTTP_STATUS_ACCEPTED = 202
HTTP_STATUS_PARTIAL = 203
HTTP_STATUS_NO_CONTENT = 204
HTTP_STATUS_RESET_CONTENT = 205
HTTP_STATUS_PARTIAL_CONTENT = 206
HTTP_STATUS_AMBIGUOUS = 300
HTTP_STATUS_MOVED = 301
HTTP_STATUS_REDIRECT = 302
HTTP_STATUS_REDIRECT_METHOD = 303
HTTP_STATUS_NOT_MODIFIED = 304
HTTP_STATUS_USE_PROXY = 305
HTTP_STATUS_REDIRECT_KEEP_VERB = 307
HTTP_STATUS_BAD_REQUEST = 400
HTTP_STATUS_DENIED = 401
HTTP_STATUS_PAYMENT_REQ = 402
HTTP_STATUS_FORBIDDEN = 403
HTTP_STATUS_NOT_FOUND = 404
HTTP_STATUS_BAD_METHOD = 405
HTTP_STATUS_NONE_ACCEPTABLE = 406
HTTP_STATUS_PROXY_AUTH_REQ = 407
HTTP_STATUS_REQUEST_TIMEOUT = 408
HTTP_STATUS_CONFLICT = 409
HTTP_STATUS_GONE = 410
HTTP_STATUS_LENGTH_REQUIRED = 411
HTTP_STATUS_PRECOND_FAILED = 412
HTTP_STATUS_REQUEST_TOO_LARGE = 413
HTTP_STATUS_URI_TOO_LONG = 414
HTTP_STATUS_UNSUPPORTED_MEDIA = 415
HTTP_STATUS_SERVER_ERROR = 500
HTTP_STATUS_NOT_SUPPORTED = 501
HTTP_STATUS_BAD_GATEWAY = 502
HTTP_STATUS_SERVICE_UNAVAIL = 503
HTTP_STATUS_GATEWAY_TIMEOUT = 504
HTTP_STATUS_VERSION_NOT_SUP = 505
End Enum
JW
"Stephen Malbon" <smalbon@hotmail.com> wrote in message
news:eOSdkbNGFHA.3504@TK2MSFTNGP12.phx.gbl...
> I'm using a ServerXMLHTTP object to post data to a remote server, this
> from
> a COM object used by both VB applications and other COM objects that are
> used from ASP pages. I'm using the open() method set to operate
> asynchronously so that it returns immediately and I can use the
> WaitForResponse method to attempt to get a response, using a timeout value
> read from an INI file. This all works fine when everyting is OK. However,
> my
> COM objects are running on a network behind a firewall (and switches and
> routers) and the URLs to which I post data are hosted on remote servers
> which are also behind firewalls etc. hence there's the possibility that
> the
> URL will sometimes be unreachable. In this case I get a runtime error
> thrown
> by the WaitForResponse method (and not the Open or Send methods somewhat
> to
> my surprise). My VB error handler catches these and I can see that the
> errors have meaningful textual descriptions ("unable to establish
> connection
> with server", for instance) but ideally I'd like to know the numerical
> values of the error codes for "failed to resolve address", "failed to send
> data" etc. are so that my code my decide definitively what went wrong.
> Where
> can I find what these values are?
>
> SteveM
>
>
| |
| Stephen Malbon 2005-02-23, 7:18 am |
| Jerry West" <jw@comcast.net> wrote in message
news:111mqghoqf075df@news.supernews.com...
> Do you mean these codes?
>
> Public Enum SERVER_ERROR_CODES
<SNIP>
No.
I mean the runtime error numbers reported by the VB6 Error object, in the
".Number" property of the "Err" object. I'm pretty sure these correspond to
the HRESULT values you would get from the same method when calling it from a
VC++ application. These are usually 32-bit values with the top bit set i.e.
values of 8xxxxxxx in hexadecimal which VB always reports as being large
negative decimal values since it doesn't have an unsigned long data type.
SteveM
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|