Author: samisa
Date: Wed Jun 13 23:24:55 2007
New Revision: 547143

URL: http://svn.apache.org/viewvc?view=rev&rev=547143
Log:
Fixed proxy problem

Modified:
    webservices/axis2/trunk/c/src/core/clientapi/svc_client.c
    webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c

Modified: webservices/axis2/trunk/c/src/core/clientapi/svc_client.c
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/clientapi/svc_client.c?view=diff&rev=547143&r1=547142&r2=547143
==============================================================================
--- webservices/axis2/trunk/c/src/core/clientapi/svc_client.c (original)
+++ webservices/axis2/trunk/c/src/core/clientapi/svc_client.c Wed Jun 13 
23:24:55 2007
@@ -32,6 +32,8 @@
 #include <axis2_conf_init.h>
 #include <platforms/axutil_platform_auto_sense.h>
 #include <stdio.h>
+#include <axutil_generic_obj.h>
+#include <axis2_http_transport.h>
 
 struct axis2_svc_client
 {
@@ -1288,6 +1290,10 @@
     axutil_param_t *param;
     axis2_char_t *proxy = AXIS2_HTTP_PROXY_API;
     axutil_hash_t *attribute;
+    axutil_generic_obj_t *host_obj = NULL;
+    axutil_generic_obj_t *port_obj = NULL;
+    axiom_attribute_t *host_attr = NULL;
+    axiom_attribute_t *port_attr = NULL;
 
     AXIS2_PARAM_CHECK(env->error, proxy_host, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, proxy_port, AXIS2_FAILURE);
@@ -1309,11 +1315,22 @@
         }
 
         attribute = axutil_hash_make (env);
-        axutil_hash_set (attribute, AXIS2_HTTP_PROXY_HOST, 
AXIS2_HASH_KEY_STRING, proxy_host);
-        axutil_hash_set (attribute, AXIS2_HTTP_PROXY_PORT, 
AXIS2_HASH_KEY_STRING, proxy_port);
+        host_obj = axutil_generic_obj_create(env);
+        port_obj  = axutil_generic_obj_create(env);
+        host_attr = axiom_attribute_create(env, proxy_host, NULL, NULL);
+        port_attr = axiom_attribute_create(env, proxy_port, NULL,  NULL); 
+        axutil_generic_obj_set_value(host_obj, env, host_attr);
+        axutil_generic_obj_set_value(port_obj, env, port_attr);
+
+        axutil_hash_set (attribute, AXIS2_HTTP_PROXY_HOST, 
AXIS2_HASH_KEY_STRING, host_obj);
+        axutil_hash_set (attribute, AXIS2_HTTP_PROXY_PORT, 
AXIS2_HASH_KEY_STRING, port_obj);
         axutil_param_set_attributes (param, env, attribute);
         axutil_param_container_add_param (param_container, env, param);
 
     }
     return AXIS2_SUCCESS;
 }
+
+
+
+

Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c?view=diff&rev=547143&r1=547142&r2=547143
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c 
(original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c Wed 
Jun 13 23:24:55 2007
@@ -903,25 +903,48 @@
             transport_attrs = axutil_param_get_attributes(proxy_param, env);
             if (transport_attrs)
             {
-     
-                proxy_host = (axis2_char_t *)axutil_hash_get(transport_attrs, 
AXIS2_PROXY_HOST_NAME,
-                                      AXIS2_HASH_KEY_STRING);
-                if (!proxy_host)
+                axutil_generic_obj_t *obj = NULL;
+                axiom_attribute_t *host_attr = NULL;
+                axiom_attribute_t *port_attr = NULL;
+                
+                obj = axutil_hash_get(transport_attrs, AXIS2_PROXY_HOST_NAME,
+                                                                
AXIS2_HASH_KEY_STRING);
+                if (! obj)
+                {
+                    return AXIS2_FAILURE;
+                }
+                host_attr = (axiom_attribute_t *) 
axutil_generic_obj_get_value(obj,
+                                                                               
                                                                 env);
+                if (! host_attr)
                 {
                     return AXIS2_FAILURE;
                 }
+                proxy_host = axiom_attribute_get_localname(host_attr, env);
+                if (! proxy_host)
+                {
+                return AXIS2_FAILURE;
+                }
                 /* Now we get the port */
+                obj = NULL;
                 
-                proxy_port = (axis2_char_t *)axutil_hash_get(transport_attrs, 
AXIS2_PROXY_HOST_PORT,
+                obj = axutil_hash_get(transport_attrs, AXIS2_PROXY_HOST_PORT,
                                       AXIS2_HASH_KEY_STRING);
-                if (!proxy_port)
+                port_attr = (axiom_attribute_t*) 
axutil_generic_obj_get_value(obj,
+                                                                              
env);
+                if (! port_attr)
                 {
                     return AXIS2_FAILURE;
                 }
+ 
+               proxy_port = axiom_attribute_get_localname(port_attr, env);
+               if (! proxy_port)
+               {
+                   return AXIS2_FAILURE;
+               }
+                
             }
-        }
-
-    }
+        }       
+     }
     if (proxy_port && proxy_host)
     {
         axis2_http_client_set_proxy(sender->client, env, proxy_host,



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to