incubator-celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abroekh...@apache.org
Subject svn commit: r1543326 - /incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c
Date Tue, 19 Nov 2013 07:19:54 GMT
Author: abroekhuis
Date: Tue Nov 19 07:19:54 2013
New Revision: 1543326

URL: http://svn.apache.org/r1543326
Log:
CELIX-89: Small update to the remote proxy to fix URL usage.

Modified:
    incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c

Modified: incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c?rev=1543326&r1=1543325&r2=1543326&view=diff
==============================================================================
--- incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c
(original)
+++ incubator/celix/trunk/remote_services/calculator_proxy/private/src/calculator_proxy_impl.c
Tue Nov 19 07:19:54 2013
@@ -99,8 +99,9 @@ celix_status_t calculatorProxy_add(calcu
 celix_status_t calculatorProxy_sub(calculator_pt calculator, double a, double b, double *result)
{
 	celix_status_t status = CELIX_SUCCESS;
 	if (calculator->endpoint != NULL) {
-		printf("CALCULATOR_PROXY: URL: %s\n", calculator->endpoint->id);
-		char *url = apr_pstrcat(calculator->pool, calculator->endpoint->id, "/sub", NULL);
+	    char *serviceUrl = properties_get(calculator->endpoint->properties, ".ars.alias");
+		printf("CALCULATOR_PROXY: URL: %s\n", serviceUrl);
+		char *url = apr_pstrcat(calculator->pool, serviceUrl, "/sub", NULL);
 
 		json_t *root;
 		root = json_pack("{s:f, s:f}", "arg0", a, "arg1", b);
@@ -118,7 +119,7 @@ celix_status_t calculatorProxy_sub(calcu
 		if (status == CELIX_SUCCESS) {
 			json_error_t jsonError;
 			json_t *reply = json_loads(get.writeptr, 0, &jsonError);
-			json_unpack(reply, "[f]", "result", result);
+			json_unpack(reply, "[f]", result);
 		}
 	} else {
 		printf("CALCULATOR_PROXY: No endpoint information available\n");
@@ -130,8 +131,9 @@ celix_status_t calculatorProxy_sub(calcu
 celix_status_t calculatorProxy_sqrt(calculator_pt calculator, double a, double *result) {
 	celix_status_t status = CELIX_SUCCESS;
 	if (calculator->endpoint != NULL) {
-		printf("CALCULATOR_PROXY: URL: %s\n", calculator->endpoint->id);
-		char *url = apr_pstrcat(calculator->pool, calculator->endpoint->id, "/sqrt", NULL);
+	    char *serviceUrl = properties_get(calculator->endpoint->properties, ".ars.alias");
+		printf("CALCULATOR_PROXY: URL: %s\n", serviceUrl);
+		char *url = apr_pstrcat(calculator->pool, serviceUrl, "/sqrt", NULL);
 
 		json_t *root;
 		root = json_pack("{s:f}", "arg0", a);
@@ -149,7 +151,7 @@ celix_status_t calculatorProxy_sqrt(calc
 		if (status == CELIX_SUCCESS) {
 			json_error_t jsonError;
 			json_t *reply = json_loads(get.writeptr, 0, &jsonError);
-			json_unpack(reply, "[f]", "result", result);
+			json_unpack(reply, "[f]", result);
 		}
 	} else {
 		printf("CALCULATOR_PROXY: No endpoint information available\n");



Mime
View raw message