From 76a144e4d0b9d5bc37c1b04b99b9f01ef886e8a7 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Thu, 25 Oct 2007 02:48:05 +0000 Subject: invoke custom action from a file (Chris Poblete) --- src/wsman.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/wsman.c b/src/wsman.c index 1ac5e01..f5cd61d 100644 --- a/src/wsman.c +++ b/src/wsman.c @@ -30,7 +30,6 @@ /** * @author Anas Nashif - * @author Eugene Yarmosh * @author Vadim Revyakin */ #ifdef HAVE_CONFIG_H @@ -51,7 +50,7 @@ #include #include #include -// #include "wsman-client-options.h" + #if __linux__ extern char *getpass (const char *__prompt); @@ -628,10 +627,13 @@ int main(int argc, char **argv) } break; case WSMAN_ACTION_CUSTOM: - + if (input) { + resource = wsmc_read_file(input, wsmc_get_encoding(cl), 0); + } doc = wsmc_action_invoke(cl, resource_uri, options, invoke_method, - NULL); + resource); + ws_xml_destroy_doc(resource); wsman_output(cl, doc); if (doc) { ws_xml_destroy_doc(doc); @@ -663,8 +665,7 @@ int main(int argc, char **argv) if (input) { printf("input file provided\n"); resource = wsmc_read_file(input, wsmc_get_encoding(cl), 0); - doc = - wsmc_action_put(cl, resource_uri, options, + doc = wsmc_action_put(cl, resource_uri, options, resource); ws_xml_destroy_doc(resource); } else { -- cgit