summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/create_resource.c9
-rw-r--r--examples/serialize.c6
-rw-r--r--examples/win32_service.c13
-rw-r--r--src/wsman.c29
-rw-r--r--tests/cunit/enumeration.c14
-rw-r--r--tests/cunit/identify.c2
-rwxr-xr-xtests/cunit/invoke.c10
-rw-r--r--tests/cunit/pull.c8
-rw-r--r--tests/cunit/transfer_get.c2
-rwxr-xr-xtests/cunit/transfer_put.c6
-rw-r--r--tests/interop/interop.c2
11 files changed, 50 insertions, 51 deletions
diff --git a/examples/create_resource.c b/examples/create_resource.c
index 043faee..41aa6a2 100644
--- a/examples/create_resource.c
+++ b/examples/create_resource.c
@@ -159,11 +159,10 @@ int main(int argc, char** argv)
d->Handles.count = count;
d->Handles.data = array;
- doc = ws_transfer_create_serialized(cl, RESOURCE_URI, d,
- EXL_ExamplePolicy_TypeInfo, options);
-
- if (doc)
- ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(doc));
+ doc = ws_transfer_create_serialized(cl, RESOURCE_URI, options, d,
+ EXL_ExamplePolicy_TypeInfo);
+ if (doc)
+ ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(doc));
if (uri) {
u_uri_free(uri);
diff --git a/examples/serialize.c b/examples/serialize.c
index 901918c..1ee327a 100644
--- a/examples/serialize.c
+++ b/examples/serialize.c
@@ -930,10 +930,10 @@ char *data = "<dummy><qq>This is qq body</qq><pp>This is pp</pp></dummy>";
actionOptions options;
initialize_action_options(&options);
- WsXmlDocH request = wsman_client_create_request(cl, WSMAN_ACTION_TRANSFER_CREATE,
- NULL,
+ WsXmlDocH request = wsman_client_create_request(cl,
"http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem",
- options, NULL);
+ options,
+ WSMAN_ACTION_TRANSFER_CREATE, NULL, NULL);
WsXmlDocH d = wsman_client_read_memory(cl, data, strlen(data), NULL, 0);
ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(d));
// WsXmlNodeH n = ws_xml_get_doc_root(d);
diff --git a/examples/win32_service.c b/examples/win32_service.c
index 681d350..791b1c5 100644
--- a/examples/win32_service.c
+++ b/examples/win32_service.c
@@ -165,11 +165,10 @@ static int list_services(WsManClient *cl, WsXmlDocH doc, void *data)
CIM_Servie *service = ws_deserialize(wsman_client_get_context(cl),
node,
CIM_Servie_TypeInfo, CLASSNAME,
- RESOURCE_URI, RESOURCE_URI,
+ RESOURCE_URI, NULL,
0, 0);
print_info(service);
}
-
}
}
@@ -245,15 +244,15 @@ int main(int argc, char** argv)
} else if (start && argv[1]) {
if (dump) wsman_set_action_option(&options,FLAG_DUMP_REQUEST );
wsman_client_add_selector(&options, "Name", argv[1]);
- doc = wsman_invoke(cl, RESOURCE_URI,
- "StartService", NULL, options);
+ doc = wsman_invoke(cl, RESOURCE_URI, options,
+ "StartService", NULL);
ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(doc));
ws_xml_destroy_doc(doc);
} else if (stop && argv[1]) {
if (dump) wsman_set_action_option(&options,FLAG_DUMP_REQUEST );
wsman_client_add_selector(&options, "Name", argv[1]);
- doc = wsman_invoke(cl, RESOURCE_URI,
- "StopService", NULL, options);
+ doc = wsman_invoke(cl, RESOURCE_URI, options,
+ "StopService", NULL);
ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(doc));
ws_xml_destroy_doc(doc);
} else if ( argv[1] ) {
@@ -267,7 +266,7 @@ int main(int argc, char** argv)
CIM_Servie *service = ws_deserialize(wsman_client_get_context(cl),
node,
CIM_Servie_TypeInfo, CLASSNAME,
- RESOURCE_URI, RESOURCE_URI,
+ RESOURCE_URI, NULL,
0, 0);
desc = 1;
status = 1;
diff --git a/src/wsman.c b/src/wsman.c
index dfebe58..4fddbd8 100644
--- a/src/wsman.c
+++ b/src/wsman.c
@@ -207,7 +207,8 @@ main(int argc, char **argv)
case WSMAN_ACTION_CUSTOM:
options.properties = wsman_options_get_properties();
- doc = wsman_invoke(cl, resource_uri, wsman_options_get_invoke_method(), NULL, options);
+ doc = wsman_invoke(cl, resource_uri, options,
+ wsman_options_get_invoke_method(), NULL);
if (doc) {
wsman_output(doc);
ws_xml_destroy_doc(doc);
@@ -224,7 +225,7 @@ main(int argc, char **argv)
if (wsman_options_get_input_file()) {
resource = wsman_client_read_file(cl,
wsman_options_get_input_file(), "UTF-8", 0);
- doc = ws_transfer_create(cl, resource_uri, resource, options);
+ doc = ws_transfer_create(cl, resource_uri, options, resource);
ws_xml_destroy_doc(resource);
if (doc) {
wsman_output(doc);
@@ -239,7 +240,7 @@ main(int argc, char **argv)
printf("input file provided\n");
resource = wsman_client_read_file(cl,
wsman_options_get_input_file(), "UTF-8", 0);
- doc = ws_transfer_put(cl, resource_uri, resource, options);
+ doc = ws_transfer_put(cl, resource_uri, options, resource);
ws_xml_destroy_doc(resource);
} else {
doc = ws_transfer_get_and_put(cl, resource_uri, options);
@@ -257,14 +258,14 @@ main(int argc, char **argv)
}
break;
case WSMAN_ACTION_PULL:
- doc = wsenum_pull(cl, resource_uri, wsman_options_get_enum_context(), options);
+ doc = wsenum_pull(cl, resource_uri, options, wsman_options_get_enum_context());
if (doc) {
wsman_output(doc);
ws_xml_destroy_doc(doc);
}
break;
case WSMAN_ACTION_RELEASE:
- doc = wsenum_release(cl, resource_uri, wsman_options_get_enum_context(), options);
+ doc = wsenum_release(cl, resource_uri, options, wsman_options_get_enum_context());
if (doc) {
wsman_output(doc);
ws_xml_destroy_doc(doc);
@@ -300,9 +301,9 @@ main(int argc, char **argv)
enum_response = wsenum_enumerate(cl,
resource_uri, options);
if (enum_response) {
- if (wsman_get_client_response_code(cl) == 200 ||
- wsman_get_client_response_code(cl) == 400 ||
- wsman_get_client_response_code(cl) == 500) {
+ if (wsman_client_get_response_code(cl) == 200 ||
+ wsman_client_get_response_code(cl) == 400 ||
+ wsman_client_get_response_code(cl) == 500) {
wsman_output(enum_response);
} else {
break;
@@ -316,11 +317,11 @@ main(int argc, char **argv)
if (!wsman_options_get_step_request()) {
while (enumContext != NULL && enumContext[0] != 0) {
- doc = wsenum_pull(cl, resource_uri, enumContext, options);
+ doc = wsenum_pull(cl, resource_uri, options, enumContext);
- if (wsman_get_client_response_code(cl) != 200 &&
- wsman_get_client_response_code(cl) != 400 &&
- wsman_get_client_response_code(cl) != 500) {
+ if (wsman_client_get_response_code(cl) != 200 &&
+ wsman_client_get_response_code(cl) != 400 &&
+ wsman_client_get_response_code(cl) != 500) {
break;
}
wsman_output(doc);
@@ -336,9 +337,9 @@ main(int argc, char **argv)
retVal = 1;
}
- if (wsman_get_client_response_code(cl) != 200) {
+ if (wsman_client_get_response_code(cl) != 200) {
fprintf(stderr, "Connection failed. response code = %ld\n",
- wsman_get_client_response_code(cl));
+ wsman_client_get_response_code(cl));
if (wsman_client_get_fault_string(cl)) {
fprintf(stderr, "%s\n", wsman_client_get_fault_string(cl));
}
diff --git a/tests/cunit/enumeration.c b/tests/cunit/enumeration.c
index 9874f11..828b740 100644
--- a/tests/cunit/enumeration.c
+++ b/tests/cunit/enumeration.c
@@ -279,11 +279,11 @@ static void enumeration_test() {
WsXmlDocH enum_response = wsenum_enumerate(cl,
(char *)tests[i].resource_uri, options);
- CU_ASSERT_TRUE(wsman_get_client_response_code(cl) == tests[i].final_status);
- if (wsman_get_client_response_code(cl) != tests[i].final_status) {
+ CU_ASSERT_TRUE(wsman_client_get_response_code(cl) == tests[i].final_status);
+ if (wsman_client_get_response_code(cl) != tests[i].final_status) {
if (verbose) {
printf("\nExpected = %ld\nReturned = %ld ",
- tests[i].final_status, wsman_get_client_response_code(cl));
+ tests[i].final_status, wsman_client_get_response_code(cl));
}
goto RETURN;
}
@@ -293,7 +293,7 @@ static void enumeration_test() {
} else {
goto RETURN;
}
- check_response_header(enum_response, wsman_get_client_response_code(cl),
+ check_response_header(enum_response, wsman_client_get_response_code(cl),
ENUM_ACTION_ENUMERATERESPONSE);
//if (i==11) ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(enum_response));
@@ -306,9 +306,9 @@ RETURN:
u_free(selectors);
if (enumContext) {
wsenum_release(cl,
- (char *)tests[i].resource_uri,
- enumContext,
- options);
+ (char *)tests[i].resource_uri,
+ options,
+ enumContext);
}
if (enum_response) {
ws_xml_destroy_doc(enum_response);
diff --git a/tests/cunit/identify.c b/tests/cunit/identify.c
index dcaaf59..39501f0 100644
--- a/tests/cunit/identify.c
+++ b/tests/cunit/identify.c
@@ -103,7 +103,7 @@ identify_test() {
initialize_action_options(&options);
response = wsman_identify(cl, options);
- CU_ASSERT_TRUE(wsman_get_client_response_code(cl) == tests[i].final_status);
+ CU_ASSERT_TRUE(wsman_client_get_response_code(cl) == tests[i].final_status);
CU_ASSERT_PTR_NOT_NULL(response);
if (response == NULL) {
diff --git a/tests/cunit/invoke.c b/tests/cunit/invoke.c
index 6732c44..69dac09 100755
--- a/tests/cunit/invoke.c
+++ b/tests/cunit/invoke.c
@@ -208,17 +208,17 @@ static void invoke_test() {
}
options.flags = invoke_tests[i].flags;
- doc = wsman_invoke(cl, (char *)invoke_tests[i].resource_uri,
- (char *)invoke_tests[i].method, options);
+ doc = wsman_invoke(cl, (char *)invoke_tests[i].resource_uri, options,
+ (char *)invoke_tests[i].method, NULL);
//ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(doc));
- CU_ASSERT_TRUE(wsman_get_client_response_code(cl) ==
+ CU_ASSERT_TRUE(wsman_client_get_response_code(cl) ==
invoke_tests[i].final_status);
- if (wsman_get_client_response_code(cl) !=
+ if (wsman_client_get_response_code(cl) !=
invoke_tests[i].final_status) {
if (verbose) {
printf("\nExpected = %ld\nReturned = %ld ",
invoke_tests[i].final_status,
- wsman_get_client_response_code(cl));
+ wsman_client_get_response_code(cl));
}
goto RETURN;
}
diff --git a/tests/cunit/pull.c b/tests/cunit/pull.c
index 98e242e..0144cdd 100644
--- a/tests/cunit/pull.c
+++ b/tests/cunit/pull.c
@@ -170,13 +170,13 @@ static void pull_test() {
options.max_elements = pull_tests[i].max_elements;
WsXmlDocH enum_response = wsenum_enumerate(cl,
(char *)pull_tests[i].resource_uri, options);
- CU_ASSERT_TRUE(wsman_get_client_response_code(cl) ==
+ CU_ASSERT_TRUE(wsman_client_get_response_code(cl) ==
pull_tests[i].final_status);
- if (wsman_get_client_response_code(cl) != pull_tests[i].final_status) {
+ if (wsman_client_get_response_code(cl) != pull_tests[i].final_status) {
if (verbose) {
printf("\nExpected = %ld\nReturned = %ld ",
pull_tests[i].final_status,
- wsman_get_client_response_code(cl));
+ wsman_client_get_response_code(cl));
}
goto RETURN;
}
@@ -190,7 +190,7 @@ static void pull_test() {
while (enumContext != NULL) {
WsXmlDocH docp = wsenum_pull(cl, (char *)pull_tests[i].resource_uri,
- enumContext, options);
+ options, enumContext);
CU_ASSERT_PTR_NOT_NULL(docp);
if (!docp) {
goto RETURN;
diff --git a/tests/cunit/transfer_get.c b/tests/cunit/transfer_get.c
index 2e4981a..d6df91f 100644
--- a/tests/cunit/transfer_get.c
+++ b/tests/cunit/transfer_get.c
@@ -180,7 +180,7 @@ static void transfer_get_test() {
doc = ws_transfer_get(cl, (char *)get_tests[i].resource_uri, options);
- CU_ASSERT_TRUE(wsman_get_client_response_code(cl) == get_tests[i].final_status);
+ CU_ASSERT_TRUE(wsman_client_get_response_code(cl) == get_tests[i].final_status);
CU_ASSERT_PTR_NOT_NULL(doc);
if (!doc) {
diff --git a/tests/cunit/transfer_put.c b/tests/cunit/transfer_put.c
index 1a03567..7c60d07 100755
--- a/tests/cunit/transfer_put.c
+++ b/tests/cunit/transfer_put.c
@@ -195,14 +195,14 @@ static void transfer_put_test() {
doc = ws_transfer_get_and_put(cl, (char *)put_tests[i].resource_uri, options);
//ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(doc));
- CU_ASSERT_TRUE(wsman_get_client_response_code(cl) ==
+ CU_ASSERT_TRUE(wsman_client_get_response_code(cl) ==
put_tests[i].final_status);
- if (wsman_get_client_response_code(cl) !=
+ if (wsman_client_get_response_code(cl) !=
put_tests[i].final_status) {
if (verbose) {
printf("\nExpected = %ld, Returned = %ld ",
put_tests[i].final_status,
- wsman_get_client_response_code(cl));
+ wsman_client_get_response_code(cl));
// ws_xml_dump_node_tree(stdout, ws_xml_get_doc_root(doc));
}
goto RETURN;
diff --git a/tests/interop/interop.c b/tests/interop/interop.c
index 3a846ae..b8584a9 100644
--- a/tests/interop/interop.c
+++ b/tests/interop/interop.c
@@ -171,7 +171,7 @@ static int run_interop_test (WsManClient *cl, WsXmlNodeH scenario, InteropTest i
char *resource_uri = ws_xml_get_node_text(r);
char *method = ws_xml_get_node_text(m);
wsman_add_selectors_list_from_node(input, &options);
- response = wsman_invoke(cl, resource_uri, method, NULL, options);
+ response = wsman_invoke(cl, resource_uri, options, method, NULL);
xml_parser_doc_dump(stdout, response);
}else if (id == 18) { // 9.1 Put