ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r390952 [2/2] - in /webservices/axis2/trunk/c: ./ include/ modules/core/clientapi/diclient/ modules/wsdl/ modules/wsdl/builder/ samples/client/ samples/client/diclient/
Date Mon, 03 Apr 2006 04:41:56 GMT
Modified: webservices/axis2/trunk/c/modules/wsdl/builder/wsdl_pump.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/builder/wsdl_pump.c?rev=390952&r1=390951&r2=390952&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/builder/wsdl_pump.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/builder/wsdl_pump.c Sun Apr  2 21:41:53 2006
@@ -26,6 +26,7 @@
 #include <axis2_wsdl4c_qname.h>
 #include <axis2_wsdl4c_service.h>
 #include <axis2_wsdl4c_soap.h>
+#include <axis2_wsdl4c_schema_parser.h>
 
 #include <axis2_wsdl11_mep_finder.h>
 #include <axis2_wsdl_ext_soap_address.h>
@@ -79,6 +80,7 @@
 {
 	axis2_wsdl_pump_t wsdl_pump;
     int ns_count;
+    axis2_array_list_t *wsdl4c_svcs;
     axis2_wsdl_desc_t *wom_def;
     axis2_hash_t * declared_nameSpaces;
     axis2_hash_t *resolved_rpc_wrapped_element_map;
@@ -239,6 +241,7 @@
     
     wsdl_pump_impl->wom_def = NULL;
 	wsdl_pump_impl->parser = NULL;
+	wsdl_pump_impl->wsdl4c_svcs = NULL;
     wsdl_pump_impl->wsdl_pump.ops = NULL;
 
 	if(wom_def)
@@ -291,16 +294,7 @@
 axis2_wsdl_pump_pump(axis2_wsdl_pump_t *wsdl_pump,
 						axis2_env_t **env)
 {
-	axis2_wsdl_pump_impl_t *pump_impl = NULL;
-	
 	AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-	pump_impl = AXIS2_INTF_TO_IMPL(wsdl_pump);
-	
-    while (axis2_wsdl4c_parser_get_event_type(pump_impl->parser) != 
-                    AXIS2_WSDL4C_PARSER_END)
-    {
-	    axis2_wsdl4c_parser_get_next_element(pump_impl->parser);
-    }
 	return axis2_wsdl_pump_populate_def(wsdl_pump, env);	
 }
 
@@ -309,15 +303,12 @@
                                 axis2_env_t **env)
 {
     axis2_wsdl_pump_impl_t *pump_impl = NULL;
-    axis2_array_list_t *port_types = NULL;
+    int element_type = -1;
     axis2_wsdl_interface_t *wsdl_interface = NULL;
     void *port_type = NULL;
-    int i = 0, size = 0;
     axis2_status_t status = AXIS2_FAILURE;
-    axis2_array_list_t *bindings = NULL;
     axis2_wsdl_binding_t *wsdl_binding = NULL;
     void *binding = NULL;
-    axis2_array_list_t *services = NULL;
     axis2_wsdl_svc_t *wsdl_svc = NULL;
     void *service = NULL;
 
@@ -345,36 +336,32 @@
     //copy the Interfaces: Get the port_types from axis2_wsdl4c parse OM and
     // copy it to the  WOM's axis2_wsdl_interface Components
     */
-			
-    port_types = axis2_wsdl4c_parser_get_port_types(pump_impl->parser);
-    if(!port_types)
-    {
-        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_WSDL_PARSER_INVALID_STATE, 
-            AXIS2_FAILURE);
-        return AXIS2_FAILURE;
-    }
-    size = AXIS2_ARRAY_LIST_SIZE(port_types, env);
-    for(i = 0; i < size; i++)
+    while (axis2_wsdl4c_parser_get_event_type(pump_impl->parser) != 
+                    AXIS2_WSDL4C_PARSER_END)
     {
-        wsdl_interface = axis2_wsdl_interface_create(env);
-        if(!wsdl_interface)
-        {
-            return AXIS2_FAILURE;
-        }
-        port_type = (void *) AXIS2_ARRAY_LIST_GET(port_types, env, i);
-        status = axis2_wsdl_pump_populate_interfaces(wsdl_pump, env, 
-            wsdl_interface, port_type);
-        if(AXIS2_SUCCESS != status)
+	    element_type = axis2_wsdl4c_parser_get_next_element(pump_impl->parser);
+    	switch (element_type)
         {
-            return status;
-        }
-        status = AXIS2_WSDL_DESC_ADD_INTERFACE(pump_impl->wom_def, env, 
-			wsdl_interface);
-        if(AXIS2_SUCCESS != status)
-        {
-            return status;
-        }
-    }
+            case AXIS2_WSDL4C_PARSER_PORT_TYPE:
+                wsdl_interface = axis2_wsdl_interface_create(env);
+                if(!wsdl_interface)
+                {
+                    return AXIS2_FAILURE;
+                }
+                port_type = axis2_wsdl4c_parser_get_port_type(pump_impl->parser);
+                status = axis2_wsdl_pump_populate_interfaces(wsdl_pump, env, 
+                    wsdl_interface, port_type);
+                if(AXIS2_SUCCESS != status)
+                {
+                    return status;
+                }
+                status = AXIS2_WSDL_DESC_ADD_INTERFACE(pump_impl->wom_def, env, 
+			        wsdl_interface);
+                if(AXIS2_SUCCESS != status)
+                {
+                    return status;
+                }
+                break;
 
     /*
 	///////////////////////////////////////(3)Copy the Bindings///////////////////////
@@ -382,64 +369,48 @@
     // map of wsdl_binding elements. At this point we need to do some extra work since there
     //can be header parameters 
 	*/
-    
-    bindings = axis2_wsdl4c_parser_get_bindings(pump_impl->parser);
-    if(!bindings)
-    {
-        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_WSDL_PARSER_INVALID_STATE, 
-            AXIS2_FAILURE);
-        return AXIS2_FAILURE;
-    }
-    size = AXIS2_ARRAY_LIST_SIZE(bindings, env);
-    for(i = 0; i < size; i++)
-    {
-        wsdl_binding = axis2_wsdl_binding_create(env);
-        if(!wsdl_binding)
-        {
-            return AXIS2_FAILURE;
-        }
-        binding = (void *) AXIS2_ARRAY_LIST_GET(bindings, env, i);
-        status = axis2_wsdl_pump_populate_bindings(wsdl_pump, env, wsdl_binding, 
-            binding);
-        if(AXIS2_SUCCESS != status)
-        {
-            return status;
-        }
-        status = AXIS2_WSDL_DESC_ADD_BINDING(pump_impl->wom_def, env, wsdl_binding);
-        if(AXIS2_SUCCESS != status)
-        {
-            return status;
-        }
-    }    
+            case AXIS2_WSDL4C_PARSER_BINDING:
+                wsdl_binding = axis2_wsdl_binding_create(env);
+                if(!wsdl_binding)
+                {
+                    return AXIS2_FAILURE;
+                }
+                binding = axis2_wsdl4c_parser_get_binding(pump_impl->parser);
+                status = axis2_wsdl_pump_populate_bindings(wsdl_pump, env, wsdl_binding,

+                    binding);
+                if(AXIS2_SUCCESS != status)
+                {
+                    return status;
+                }
+                status = AXIS2_WSDL_DESC_ADD_BINDING(pump_impl->wom_def, env, 
+                            wsdl_binding);
+                if(AXIS2_SUCCESS != status)
+                {
+                    return status;
+                }
+                break;
 
    /* ///////////////////(4)Copy the Services///////////////////////////////*/
 
-    services = axis2_wsdl4c_parser_get_services(pump_impl->parser);
-    if(!services)
-    {
-        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_WSDL_PARSER_INVALID_STATE, 
-            AXIS2_FAILURE);
-        return AXIS2_FAILURE;
-    }
-    size = AXIS2_ARRAY_LIST_SIZE(services, env);
-    for(i = 0; i < size; i++)
-    {
-        wsdl_svc = axis2_wsdl_svc_create(env);
-        if(!wsdl_svc)
-        {
-            return AXIS2_FAILURE;
-        }
-        service = (void *) AXIS2_ARRAY_LIST_GET(services, env, i);
-        status = axis2_wsdl_pump_populate_services(wsdl_pump, env, wsdl_svc, 
-            service);
-        if(AXIS2_SUCCESS != status)
-        {
-            return status;
-        }
-        status = AXIS2_WSDL_DESC_ADD_SVC(pump_impl->wom_def, env, wsdl_svc);
-        if(AXIS2_SUCCESS != status)
-        {
-            return status;
+            case AXIS2_WSDL4C_PARSER_SERVICE:
+                wsdl_svc = axis2_wsdl_svc_create(env);
+                if(!wsdl_svc)
+                {
+                    return AXIS2_FAILURE;
+                }
+                 service = axis2_wsdl4c_parser_get_service(pump_impl->parser);
+                status = axis2_wsdl_pump_populate_services(wsdl_pump, env, wsdl_svc, 
+                    service);
+                if(AXIS2_SUCCESS != status)
+                {
+                    return status;
+                }
+                status = AXIS2_WSDL_DESC_ADD_SVC(pump_impl->wom_def, env, wsdl_svc);
+                if(AXIS2_SUCCESS != status)
+                {
+                    return status;
+                }
+                break;
         }
     }
 	return AXIS2_SUCCESS;
@@ -493,7 +464,6 @@
     {
         return status;
     }
-     
     operations = axis2_wsdl4c_port_type_get_operations(port_type);
     size = AXIS2_ARRAY_LIST_SIZE(operations, env);
     for(i = 0; i < size; i++)
@@ -517,6 +487,8 @@
             return status;
         }
     }
+    if(operations)
+        AXIS2_ARRAY_LIST_FREE(operations, env);
 	return AXIS2_SUCCESS;
 }
 
@@ -551,7 +523,7 @@
 		wrappable = AXIS2_TRUE;
 	if(AXIS2_FALSE == wrappable)
 	{
-		void *part = (void*)axis2_wsdl4c_msg_get_message_part_a_index(message, 0);
+		void *part = axis2_wsdl4c_msg_get_message_part_a_index(message, 0);
 		int part_id = axis2_wsdl4c_part_type(part);
 		if(0 != part_id)
 			wrappable = AXIS2_TRUE;
@@ -596,7 +568,7 @@
     {
         return status;
     }
-    port_type = (void*)axis2_wsdl4c_binding_get_port_type(binding);
+    port_type = axis2_wsdl4c_binding_get_port_type(binding);
     interface_name = axis2_wsdl4c_port_type_get_name(port_type);
     interface_qname = axis2_qname_create(env, interface_name, NULL, NULL);
     wsdl_interface = AXIS2_WSDL_DESC_GET_INTERFACE(pump_impl->wom_def, env, 
@@ -661,6 +633,8 @@
             return status;
         }
     }
+    if(ops)
+        AXIS2_ARRAY_LIST_FREE(ops, env);
 	return AXIS2_SUCCESS;
 }
 
@@ -684,7 +658,7 @@
     int soap_op_binding_id = 0;
     void *soap = NULL;
     axis2_char_t *action = NULL;
-    axis2_wsdl4c_style_t style = 0;
+    int style = 0;
 	axis2_char_t *str_style = NULL;
     axis2_qname_t *binding_op_qname = NULL;
     int nbindings = 0;
@@ -736,7 +710,7 @@
         if(AXIS2_TRUE == axis2_wsdl4c_soap_is_soap_body(soap, bindings[i]))
         {
             axis2_wsdl_ext_soap_body_t *soap_body = NULL;
-            axis2_wsdl4c_encoding_t use = 0;
+            axis2_wsdl4c_style_t use = 0;
             axis2_char_t *nsp = NULL;
 			axis2_char_t *str_use = NULL;
 
@@ -802,7 +776,7 @@
         if(AXIS2_TRUE == axis2_wsdl4c_soap_is_soap_body(soap, bindings[i]))
         {
             axis2_wsdl_ext_soap_body_t *soap_body = NULL;
-            axis2_wsdl4c_encoding_t use = 0;
+            axis2_wsdl4c_style_t use = 0;
 			axis2_char_t *str_use = NULL;
             axis2_char_t *nsp = NULL;
 
@@ -858,7 +832,7 @@
         if(AXIS2_TRUE == axis2_wsdl4c_soap_is_soap_body(soap, bindings[i]))
         {
             axis2_wsdl_ext_soap_body_t *soap_body = NULL;
-            axis2_wsdl4c_encoding_t use = 0;
+            axis2_wsdl4c_style_t use = 0;
 			axis2_char_t *str_use = NULL;
             char *nsp = NULL;
 
@@ -941,7 +915,7 @@
 		axis2_wsdl_ext_soap_address_t *ext_soap_address = NULL;
 
 		port_name = AXIS2_ARRAY_LIST_GET(ports, env, i);
-	    binding = (void*)axis2_wsdl4c_service_get_port_binding(wsdl4c_svc, port_name);
+	    binding = axis2_wsdl4c_service_get_port_binding(wsdl4c_svc, port_name);
 		wsdl_endpoint = axis2_wsdl_endpoint_create(env);
 		if(!wsdl_endpoint) return AXIS2_FAILURE;
 		status = axis2_wsdl_pump_populate_ports(wsdl_pump, env, wsdl_endpoint, 
@@ -960,6 +934,8 @@
 		status = AXIS2_WSDL_SVC_SET_ENDPOINT(wsdl_svc, env, wsdl_endpoint);
 	    if(AXIS2_SUCCESS != status) return status;
 	}
+    if(ports)
+        AXIS2_ARRAY_LIST_FREE(ports, env);
 	return AXIS2_SUCCESS;
 }
 					
@@ -1016,7 +992,7 @@
      * defined in the WSDL 2.0. eg like #any, #none
      * Create the Input Message and add
 	 */
-    wsdl4c_input_msg = (void*)axis2_wsdl4c_operation_get_message(wsdl4c_op, 
+    wsdl4c_input_msg = axis2_wsdl4c_operation_get_message(wsdl4c_op, 
 		AXIS2_WSDL4C_INPUT);
 	wrapped_input_qname = AXIS2_WSDL_OP_GET_QNAME(wsdl_op, env);
 	if(wsdl4c_input_msg)
@@ -1050,16 +1026,11 @@
     /* Create an output message and add */
 	temp = AXIS2_QNAME_GET_LOCALPART(wrapped_input_qname, env);
 	qname_localpart = AXIS2_STRACAT(temp, "Response", env);
-	if(temp)
-	{
-		AXIS2_FREE((*env)->allocator, temp);
-		temp = NULL;
-	}
 	qname_uri = AXIS2_QNAME_GET_URI(wrapped_input_qname, env);
     qname_prefix = AXIS2_QNAME_GET_PREFIX(wrapped_input_qname, env);
 	wrapped_output_qname = axis2_qname_create(env, qname_localpart, qname_uri,
 		qname_prefix);
-	wsdl4c_output_msg = (void*)axis2_wsdl4c_operation_get_message(wsdl4c_op, 
+	wsdl4c_output_msg = axis2_wsdl4c_operation_get_message(wsdl4c_op, 
 		AXIS2_WSDL4C_OUTPUT);
 	if(wsdl4c_output_msg)
 	{
@@ -1127,6 +1098,8 @@
 			AXIS2_WSDL_OP_ADD_OUT_FAULT(wsdl_op, env, wsdl_fault_msg);
 		}
 	}
+    if(faults)
+        AXIS2_ARRAY_LIST_FREE(faults, env);
     /* Set the MEP */
 	mep = axis2_wsdl11_mep_finder_get_mep(wsdl4c_op, env);
 	return AXIS2_WSDL_OP_SET_MSG_EXCHANGE_PATTERN(wsdl_op, env, mep);
@@ -1148,35 +1121,48 @@
 											void *wsdl4c_msg,
 											axis2_bool_t is_wrappable)
 {
+    axis2_wsdl_pump_impl_t *pump_impl = NULL;
 	axis2_qname_t *reference_qname = NULL;
 	
 	AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 	AXIS2_PARAM_CHECK((*env)->error, outer_qname, AXIS2_FAILURE);
 	AXIS2_PARAM_CHECK((*env)->error, wsdl4c_msg, AXIS2_FAILURE);
+    pump_impl = AXIS2_INTF_TO_IMPL(wsdl_pump);
 
-	if(AXIS2_TRUE == is_wrappable)
+	/*if(AXIS2_TRUE == is_wrappable)
 	{
-        /* TODO The schema for this should be already made ! Find the QName from 
-		 * the list 
-		 */
 		
-    } 
+    }
 	else 
-	{
+	{*/
 	    int i = 0;
 		int no_of_parts = 0;
 		
 		no_of_parts = axis2_wsdl4c_msg_get_num_parts(wsdl4c_msg);
 		for(i = 0; i < no_of_parts; i++)
 		{
-			void *out_part = (void*)axis2_wsdl4c_msg_get_message_part_a_index(wsdl4c_msg, i);
-			void *element = (void*)axis2_wsdl4c_part_element(out_part);
+			void *out_part = axis2_wsdl4c_msg_get_message_part_a_index(wsdl4c_msg, i);
+            if(!out_part)
+            {
+                /* TODO set error code */
+                return NULL;
+            }
+			void *element = axis2_wsdl4c_part_element(out_part);
+            int schema_id = axis2_wsdl4c_part_schema_id(out_part);
+            void *sp = axis2_wsdl4c_parser_get_schema_parser_a_schema_id(
+               pump_impl->parser, schema_id);
+            if(!sp)
+            {
+                /* TODO set error code */
+                return NULL;
+            }
+            axis2_char_t *namespc = axis2_wsdl4c_schema_parser_get_namespace(sp);
 			axis2_char_t *name = axis2_wsdl4c_element_get_name(element);
-			reference_qname = axis2_qname_create(env, name, NULL, NULL);
+			reference_qname = axis2_qname_create(env, name, namespc, NULL);
 			if(!reference_qname) return AXIS2_FAILURE;
 		}
 				
-    }
+    /*}*/
 
     return reference_qname;
 }

Modified: webservices/axis2/trunk/c/modules/wsdl/wsdl_binding.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_binding.c?rev=390952&r1=390951&r2=390952&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_binding.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_binding.c Sun Apr  2 21:41:53 2006
@@ -134,6 +134,7 @@
     }
     
     wsdl_binding_impl->qname = NULL;
+    wsdl_binding_impl->bound_interface = NULL;
 	wsdl_binding_impl->binding_ops = NULL;
     wsdl_binding_impl->binding_faults = NULL;
     wsdl_binding_impl->wsdl_binding.extensible_component = NULL;

Modified: webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c?rev=390952&r1=390951&r2=390952&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c Sun Apr  2 21:41:53 2006
@@ -458,7 +458,7 @@
 {
     axis2_wsdl_interface_impl_t *interface_impl = NULL;
     axis2_qname_t *wsdl_op_qname = NULL;
-    axis2_char_t *op_name = NULL;
+    axis2_char_t *op_qname_str = NULL;
         
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, op, AXIS2_FAILURE); 
@@ -473,9 +473,9 @@
         return AXIS2_FAILURE;
     }
     
-    op_name = AXIS2_QNAME_GET_LOCALPART(wsdl_op_qname, env);
+    op_qname_str = AXIS2_QNAME_TO_STRING(wsdl_op_qname, env);
     
-    axis2_hash_set(interface_impl->ops, op_name, AXIS2_HASH_KEY_STRING, op);
+    axis2_hash_set(interface_impl->ops, op_qname_str, AXIS2_HASH_KEY_STRING, op);
     
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/modules/wsdl/wsdl_op.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_op.c?rev=390952&r1=390951&r2=390952&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_op.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_op.c Sun Apr  2 21:41:53 2006
@@ -424,11 +424,14 @@
 axis2_wsdl_op_get_qname (void *wsdl_op, 
                          axis2_env_t **env)
 {
+    axis2_wsdl_op_impl_t *op_impl = NULL;
     axis2_wsdl_op_t *wsdl_op_l = NULL;
     
     AXIS2_ENV_CHECK(env, NULL);
     wsdl_op_l = (axis2_wsdl_op_t *) wsdl_op;
-    return AXIS2_INTF_TO_IMPL(wsdl_op_l)->name;
+    op_impl = AXIS2_INTF_TO_IMPL(wsdl_op_l);
+    
+    return op_impl->name;
 }
 
 axis2_status_t AXIS2_CALL 

Modified: webservices/axis2/trunk/c/samples/client/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/client/Makefile.am?rev=390952&r1=390951&r2=390952&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/client/Makefile.am (original)
+++ webservices/axis2/trunk/c/samples/client/Makefile.am Sun Apr  2 21:41:53 2006
@@ -1,4 +1 @@
-samplesdir=$(prefix)/samples/client
-samples_DATA=Makefile.am Makefile.in
 SUBDIRS = echo math addr_echo google echo_non_blocking notify $(DICLIENT_DIR)
-

Modified: webservices/axis2/trunk/c/samples/client/diclient/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/client/diclient/Makefile.am?rev=390952&r1=390951&r2=390952&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/client/diclient/Makefile.am (original)
+++ webservices/axis2/trunk/c/samples/client/diclient/Makefile.am Sun Apr  2 21:41:53 2006
@@ -1,7 +1,7 @@
 prgbindir=$(prefix)/bin/samples
 prgbin_PROGRAMS = echo_client
 samplesdir=$(prefix)/samples/client/diclient
-samples_DATA=echo_client.c di_client.h Makefile.am README Makefile.in
+samples_DATA=echo_client.c Makefile.am README Makefile.in
 echo_client_SOURCES = echo_client.c
 echo_client_LDADD   =  \
 					-laxis2_util \

Modified: webservices/axis2/trunk/c/samples/client/diclient/README
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/client/diclient/README?rev=390952&r1=390951&r2=390952&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/client/diclient/README (original)
+++ webservices/axis2/trunk/c/samples/client/diclient/README Sun Apr  2 21:41:53 2006
@@ -0,0 +1,38 @@
+This sample demonstrate the Dynamic Invocation capabilities of Axis2 C.
+It should be noted that to run this sample you should have configured
+Axis2 C with the configure option --enable-wsdl-pull=yes.
+To do this you should have installed WsdlPull and Axis2c_wsdl4c which
+is a C wrapper for WsdlPull.
+However in the WsdlPull version I used(version 1.9) I noticed that,  WsdlParser::getService()

+method is there in the Header file but not implemented. I sent a mail to WsdlPull yahoo group
+asking to rectify this, so I hope that this problem will not be there in future versions.
+However for the time being Please add the following code to WsdlParser.cpp
+
+const Service *
+WsdlParser::getService()
+{
+    if (element_ != SERVICE)
+    {
+         error ("Attempted to extract a Service when ,no service was parsed",1);
+         return 0;
+    }
+    else
+    {
+        return services_.back();
+    }
+}
+
+Also there is another fix for WsdlPull
+In WsdlParser.cpp's parseService method
+
+Add the following two lines
+    if ("name" == xParser_->getAttributeName(i) &&
+                (xParser_->getAttributePrefix(i)).empty())
+        portName = xParser_->getAttributeValue(i);
+
+after following code
+
+for (i = 0; i < num_att; i++) {
+    if ("binding" == xParser_->getAttributeName(i) &&
+                (xParser_->getAttributePrefix(i)).empty())
+        bnName = xParser_->getAttributeValue(i);

Modified: webservices/axis2/trunk/c/samples/client/diclient/echo_client.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/client/diclient/echo_client.c?rev=390952&r1=390951&r2=390952&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/client/diclient/echo_client.c (original)
+++ webservices/axis2/trunk/c/samples/client/diclient/echo_client.c Sun Apr  2 21:41:53 2006
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 #include <axis2_om_node.h>
+#include <axis2_op.h>
 #include <axis2_om_element.h>
 #include <axis2_om_text.h>
 #include <axis2_wsdl4c_parser.h>
@@ -25,19 +26,25 @@
 #include <stdio.h>
 
 axis2_om_node_t *
-build_om_programatically(axis2_env_t **env);
+build_om_programatically(axis2_env_t **env,
+                            axis2_diclient_t *diclient,
+                            axis2_qname_t *op_qname);
 
 int main(int argc, char** argv)
 {
 	axis2_status_t status = AXIS2_FAILURE;
-	void *wp = NULL;
 	axis2_om_node_t *node = NULL;
 	axis2_env_t *env = NULL;
     axis2_error_t *error = NULL;
     axis2_log_t *log = NULL;
     axis2_allocator_t *allocator = NULL;
     char *wsdl_file_name = NULL;
-    axis2_di_client_t *diclient = NULL;
+    axis2_diclient_t *diclient = NULL;
+    axis2_qname_t *op_qname = NULL;
+    axis2_qname_t *endpoint_qname = NULL;
+    axis2_hash_t *op_map = NULL;
+    axis2_hash_index_t *index = NULL;
+    axis2_op_t *op = NULL;
 
     /* set up the envioronment with allocator and log*/
     allocator = axis2_allocator_init (NULL);
@@ -53,38 +60,67 @@
       return 1;
     }
     wsdl_file_name = argv[1];
-    diclient = axis2_di_client_create(&env);
-	status = AXIS2_DI_CLIENT_INIT(diclient, &env, wsdl_file_name);
+    diclient = axis2_diclient_create(&env);
+	status = AXIS2_DICLIENT_INIT(diclient, &env, wsdl_file_name);
     if(AXIS2_SUCCESS != status)
             return status;
+    op_qname = axis2_qname_create(&env, "echo", NULL, NULL);
+    endpoint_qname = axis2_qname_create(&env, "wsaTestServicePort0", NULL, NULL);
+    AXIS2_DICLIENT_SET_ADDRESS_AND_ACTION_FOR_OP(diclient, &env, op_qname,
+            endpoint_qname);
     /* build the SOAP request message content using OM API.*/
-    node = build_om_programatically(&env);
-	status = AXIS2_DI_CLIENT_INVOKE(diclient, &env, node);
+    node = build_om_programatically(&env, diclient, op_qname);
+    op_map = AXIS2_DICLIENT_GET_OPERATIONS(diclient, &env);
+    for (index = axis2_hash_first (op_map, &env); index; 
+            index = axis2_hash_next (&env, index))
+    {
+        void *value = NULL;
+        axis2_qname_t *op_qname = NULL;
+        axis2_char_t *op_name = NULL;
+        
+	    axis2_hash_this(index, NULL, NULL, &value);
+	    op = (axis2_op_t *) value;
+        op_qname = AXIS2_OP_GET_QNAME(op, &env);
+        op_name = AXIS2_QNAME_GET_LOCALPART(op_qname, &env);
+        if(0 == AXIS2_STRCMP(op_name, "echo"))
+            break;
+    }
+
+	status = AXIS2_DICLIENT_INVOKE(diclient, &env, node, op);
 	if(AXIS2_SUCCESS == status)
 		printf("status:%s\n", "Success");
 	else
 		printf("status:%s\n", "Failure");
+    if(diclient)
+    {
+        AXIS2_DICLIENT_FREE(diclient, &env);
+        diclient = NULL;
+    }
 	return 0;
 }
 
 /* build SOAP request message content using OM */
 axis2_om_node_t *
-build_om_programatically(axis2_env_t **env)
+build_om_programatically(axis2_env_t **env,
+                            axis2_diclient_t *diclient,
+                            axis2_qname_t *op_qname)
 {
     axis2_om_node_t *echo_om_node = NULL;
     axis2_om_element_t* echo_om_ele = NULL;
-    axis2_om_node_t* text_om_node = NULL;
-    axis2_om_element_t * text_om_ele = NULL;
     axis2_om_namespace_t *ns1 = NULL;
     
 
     axis2_xml_writer_t *xml_writer = NULL;
     axis2_om_output_t *om_output = NULL;
     axis2_char_t *buffer = NULL;
+    axis2_char_t *param_localname = NULL;
+    axis2_char_t *param_namespc = NULL;
 
-    ns1 = axis2_om_namespace_create (env, "http://example.org/echo", "tns1");
+    param_localname = AXIS2_DICLIENT_GET_PARAM_LOCALNAME(diclient, env, op_qname);
+    param_namespc = AXIS2_DICLIENT_GET_PARAM_NAMESPACE(diclient, env, op_qname);
+    ns1 = axis2_om_namespace_create (env, param_namespc, "tns0");
 
-    echo_om_ele = axis2_om_element_create(env, NULL, "echoIn", ns1, &echo_om_node);
+    echo_om_ele = axis2_om_element_create(env, NULL, param_localname, ns1, &echo_om_node);
     
     AXIS2_OM_ELEMENT_SET_TEXT(echo_om_ele, env, "Hello World", echo_om_node);
     

Modified: webservices/axis2/trunk/c/samples/client/diclient/wsaTestService.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/client/diclient/wsaTestService.wsdl?rev=390952&r1=390951&r2=390952&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/client/diclient/wsaTestService.wsdl (original)
+++ webservices/axis2/trunk/c/samples/client/diclient/wsaTestService.wsdl Sun Apr  2 21:41:53
2006
@@ -23,6 +23,9 @@
       <wsdl:input name="echoInRequest" message="impl:wsaEchoOutMessage" wsaw:Action="http://example.org/action/echoIn"/>
       <wsdl:output name="echoInResponse" message="impl:wsaEchoInMessage" wsaw:Action="http://example.org/action/echoOut"/>
     </wsdl:operation>
+    <wsdl:operation name="notify">
+      <wsdl:input name="notifyRequest" message="impl:wsaNotifyMessage" wsaw:Action="http://example.org/action/notify"/>
+    </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="wsaTestSoap11Binding" type="impl:wsaTestPortType">
     <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
@@ -34,6 +37,12 @@
       <wsdl:output>
         <wsdlsoap:body use="literal" namespace="http://org.apache.axis2/"/>
       </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="notify">
+      <wsdlsoap:operation soapAction="notify" style="document"/>
+      <wsdl:input>
+        <wsdlsoap:body use="literal" namespace="http://org.apache.axis2/"/>
+      </wsdl:input>
     </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="wsaTestService">



Mime
View raw message