File: srm_testping.c

package info (click to toggle)
dpm-postgres 1.7.4.7-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 13,788 kB
  • ctags: 10,782
  • sloc: ansic: 146,136; sh: 13,362; perl: 11,142; python: 5,529; cpp: 5,113; sql: 1,790; makefile: 955; fortran: 113
file content (35 lines) | stat: -rw-r--r-- 684 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdio.h>
#include "srmv1H.h"
#include "ISRM.nsmap"
#ifdef GFAL_SECURE
#include "cgsi_plugin.h"
#endif
main(argc, argv)
int argc;
char **argv;
{
	int flags;
	struct ns5__pingResponse out;
	struct soap soap;

	if (argc != 2) {
		fprintf (stderr, "usage: %s srm_endpoint\n", argv[0]);
		exit (1);
	}

	soap_init (&soap);
#ifdef GFAL_SECURE
	flags = CGSI_OPT_DISABLE_NAME_CHECK;
	soap_register_plugin_arg (&soap, client_cgsi_plugin, &flags);
#endif

	if (soap_call_ns5__ping (&soap, argv[1], "ping", &out)) {
		soap_print_fault (&soap, stderr);
		exit (1);
	}
	if (out._Result)
		printf ("SRM server is alive\n");
	else
		printf ("SRM server is not responding\n");
	exit (0);
}