/* echo.c just returns the original string with complemented case */ #include "soapH.h" #include "echo.nsmap" #include #include #include #ifdef MOD_GSOAP #include #else #include #endif #ifdef MOD_GSOAP IMPLEMENT_GSOAP_SERVER() #else int main (int argc, char **argv) { struct soap soap; CGIplus_InitVMS (argc, argv); soap_init1 (&soap, SOAP_IO_BUFFER); while (CGIplus_Accept() >= 0) { soap_serve(&soap); soap_end(&soap); } exit (0); } #endif /* MOD_GSOAP */ int ns__echo(struct soap *soap, char *original, int expand, char **reflection) { static int UsageCount = 0; static pid_t pid = 0; int size; char *cptr, *sptr; if (!pid) pid = getpid(); if (expand < 1) expand = 1; size = strlen(original) * expand; if (original == NULL || !*original) *reflection = "[ping!]"; else { *reflection = sptr = (char*)soap_malloc (soap, size+64); sprintf (sptr, "%08.08X %u %d \"", pid, ++UsageCount, size); while (*sptr) sptr++; while (expand--) { for (cptr = original; *cptr; cptr++) if (isalpha(*cptr)) if (islower(*cptr)) *sptr++ = toupper(*cptr); else *sptr++ = tolower(*cptr); else *sptr++ = *cptr; } *sptr++ = '\"'; *sptr = '\0'; } return (SOAP_OK); }