[wsf-c-dev] svn commit r202 - wsf/php/src

svn at wso2.com svn at wso2.com
Mon Dec 11 03:42:39 PST 2006


Author: nandika
Date: Mon Dec 11 03:42:38 2006
New Revision: 202

Modified:
   wsf/php/src/util.c
   wsf/php/src/wsf.c
   wsf/php/src/wsf.h
   wsf/php/src/wsf_util.h
Log:
new changes in implementing dynamic client

Modified: wsf/php/src/util.c
==============================================================================
--- wsf/php/src/util.c	(original)
+++ wsf/php/src/util.c	Mon Dec 11 03:42:38 2006
@@ -14,7 +14,8 @@
  * limitations under the License.
  */
 
-#include "wsf_util.h"
+
+
 #include "php.h"
 #include <axis2_dll_desc.h>
 #include <axis2_msg_recv.h>
@@ -24,6 +25,7 @@
 #include <axis2_http_transport.h>
 #include <axis2_addr.h>
 #include "wsf.h"
+#include "wsf_util.h"
 
 ws_svc_info_t* ws_svc_info_create()
 {
@@ -993,7 +995,7 @@
     return;    
 }        
 
-int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, 
+int parse_response(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, 
 						char *fn_name, zval *return_value TSRMLS_DC)
 {
 	char* envelope_ns = NULL;
@@ -1023,6 +1025,10 @@
 		xmlFreeDoc(response);
 		return FALSE;
 	}
+	if(WSF_GLOBAL(soap_version) == SOAP_1_2)
+		envelope_ns = SOAP_1_2_ENV_NAMESPACE;
+	else
+		envelope_ns = SOAP_1_1_ENV_NAMESPACE;
 
 	/*
 	env = NULL;
@@ -1148,9 +1154,8 @@
 		}
 	}
 	*/
-	/* Check if <Body> contains <Fault> element */
 
-	fault = get_node_ex(body->children,"Fault",envelope_ns);
+	fault = get_node_ex(response->children,"Fault",envelope_ns);
 	if (fault != NULL) {
 		char *faultcode = NULL, *faultstring = NULL, *faultactor = NULL;
 		zval *details = NULL;
@@ -1223,7 +1228,7 @@
 
 	/* Parse content of <Body> element */
 	array_init(return_value);
-	resp = body->children;
+	resp = response->children;
 	while (resp != NULL && resp->type != XML_ELEMENT_NODE) {
 		resp = resp->next;
 	}

Modified: wsf/php/src/wsf.c
==============================================================================
--- wsf/php/src/wsf.c	(original)
+++ wsf/php/src/wsf.c	Mon Dec 11 03:42:38 2006
@@ -617,6 +617,8 @@
 	axis2_options_t *client_options = NULL;
 	ws_object_ptr intern= NULL;		
 
+	axiom_node_t *result_node = NULL;
+
 	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS
 		&& Z_LVAL_PP(trace) > 0) {
 		zend_hash_del(Z_OBJPROP_P(this_ptr), "__last_request", sizeof("__last_request"));
@@ -725,8 +727,22 @@
 					php_printf("node null");
 				*/
 				ws_util_set_options(this_ptr, env, client_options, svc_client, 0 TSRMLS_CC);
-				AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, om_node);
-					
+				result_node = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, om_node);
+				if(!result_node){
+					return;
+				}else{
+
+					axis2_char_t *buffer = NULL;
+					int buffer_length = 0;
+
+					buffer = AXIOM_NODE_TO_STRING(result_node, env);
+					if(buffer){
+						buffer_length = strlen(buffer);
+						parse_response(this_ptr, buffer, buffer_length,fn, function , return_value TSRMLS_CC);
+					}
+					else
+						return;
+				}
  			}
 			xmlFreeDoc(request);
 			zval_dtor(&response);

Modified: wsf/php/src/wsf.h
==============================================================================
--- wsf/php/src/wsf.h	(original)
+++ wsf/php/src/wsf.h	Mon Dec 11 03:42:38 2006
@@ -246,6 +246,8 @@
 
 zval* add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC);
 
+int parse_response(zval *this_ptr, char *buffer, int buffer_size, sdlFunctionPtr fn, 
+						char *fn_name, zval *return_value TSRMLS_DC);
 
 #endif	/* WSF_H */
 

Modified: wsf/php/src/wsf_util.h
==============================================================================
--- wsf/php/src/wsf_util.h	(original)
+++ wsf/php/src/wsf_util.h	Mon Dec 11 03:42:38 2006
@@ -77,4 +77,6 @@
 void ws_util_get_attachments(const axis2_env_t *env,
         axiom_node_t *payload_node, zval *cid2str,zval *cid2contentType TSRMLS_DC);  
         
+
+
 #endif /* WS_UTIL_H */




More information about the Wsf-c-dev mailing list