--- check_http.c.old 2004-12-01 15:57:08.000000000 +0100 +++ check_http.c 2004-12-06 11:56:11.000000000 +0100 @@ -112,6 +112,7 @@ char *http_method; char *http_post_data; char buffer[MAX_INPUT_BUFFER]; +int do_soap = FALSE; int process_arguments (int, char **); static char *base64 (const char *bin, size_t len); @@ -210,6 +211,7 @@ {"min", required_argument, 0, 'm'}, {"use-ipv4", no_argument, 0, '4'}, {"use-ipv6", no_argument, 0, '6'}, + {"soap", no_argument, 0, 'W'}, {0, 0, 0, 0} }; @@ -230,7 +232,7 @@ } while (1) { - c = getopt_long (argc, argv, "Vvh46t:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", longopts, &option); + c = getopt_long (argc, argv, "Vvh46tW:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", longopts, &option); if (c == -1 || c == EOF) break; @@ -384,6 +386,9 @@ case 'm': /* min_page_length */ min_page_len = atoi (optarg); break; + case 'W': /* use SOAP mode */ + do_soap = TRUE; + break; } } @@ -519,9 +524,16 @@ /* either send http POST data */ if (http_post_data) { - asprintf (&buf, "%sContent-Type: application/x-www-form-urlencoded\r\n", buf); - asprintf (&buf, "%sContent-Length: %i\r\n\r\n", buf, strlen (http_post_data)); - asprintf (&buf, "%s%s%s", buf, http_post_data, CRLF); + if (do_soap) { + asprintf (&buf, "%sSOAPAction:\r\n", buf); + asprintf (&buf, "%sContent-Type: text/xml; charset=utf-8\r\n", buf); + asprintf (&buf, "%sContent-Length: %i\r\n\r\n", buf, strlen (http_post_data)); + asprintf (&buf, "%s%s%s", buf, http_post_data, CRLF); + } else { + asprintf (&buf, "%sContent-Type: application/x-www-form-urlencoded\r\n", buf); + asprintf (&buf, "%sContent-Length: %i\r\n\r\n", buf, strlen (http_post_data)); + asprintf (&buf, "%s%s%s", buf, http_post_data, CRLF); + } } else { /* or just a newline so the server knows we're done with the request */ @@ -1214,6 +1226,6 @@ [-w ] [-c ] [-t ] [-L]\n\ [-a auth] [-f ] [-e ]\n\ [-s string] [-l] [-r | -R ]\n\ - [-P string] [-m min_pg_size] [-4|-6]\n"), progname); + [-P string] [-m min_pg_size] [-4|-6] [-W]\n"), progname); printf (_(UT_HLP_VRS), progname, progname); }