]> granicus.if.org Git - php/commitdiff
Support for SOAP 1.2 Fault/Code/Value and Fault/Reason/Text
authorDmitry Stogov <dmitry@php.net>
Mon, 26 Jan 2004 17:11:05 +0000 (17:11 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 26 Jan 2004 17:11:05 +0000 (17:11 +0000)
ext/soap/php_packet_soap.c
ext/soap/soap.c

index 9bc874efeb26d4cd0902dd85cd507acb85957ac7..e379f447f383f503badf0d04b8c6f31e757ed8dd 100644 (file)
@@ -118,12 +118,19 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
                } else {
                        tmp = get_node(fault->children,"Code");
                        if (tmp != NULL && tmp->children != NULL) {
-                               faultcode = tmp->children->content;
+                               tmp = get_node(tmp->children,"Value");
+                               if (tmp != NULL && tmp->children != NULL) {
+                                       faultcode = tmp->children->content;
+                               }
                        }
 
                        tmp = get_node(fault->children,"Reason");
                        if (tmp != NULL && tmp->children != NULL) {
-                               faultstring = tmp->children->content;
+                               /* TODO: lang attribute */
+                               tmp = get_node(tmp->children,"Text");
+                               if (tmp != NULL && tmp->children != NULL) {
+                                       faultstring = tmp->children->content;
+                               }
                        }
 
                        tmp = get_node(fault->children,"Detail");
index 0e31a9fee7617229aab9180724d5171b051bfe14..9c376c173cac05c38ea51fb0685f86f2c7e4294a 100644 (file)
@@ -1985,6 +1985,7 @@ static xmlDocPtr seralize_response_call(sdlFunctionPtr function, char *function_
                                int new_len;
                                xmlNodePtr node = xmlNewChild(param, NULL, SOAP_1_2_ENV_NS_PREFIX":Code", NULL);
                                char *str = php_escape_html_entities(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC);
+                               node = xmlNewChild(node, NULL, SOAP_1_2_ENV_NS_PREFIX":Value", NULL);
                                xmlNodeSetContentLen(node, str, new_len);
                                efree(str);
                        }
@@ -1992,6 +1993,7 @@ static xmlDocPtr seralize_response_call(sdlFunctionPtr function, char *function_
                                int new_len;
                                xmlNodePtr node = xmlNewChild(param, NULL, SOAP_1_2_ENV_NS_PREFIX":Reason", NULL);
                                char *str = php_escape_html_entities(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC);
+                               node = xmlNewChild(node, NULL, SOAP_1_2_ENV_NS_PREFIX":Text", NULL);
                                xmlNodeSetContentLen(node, str, new_len);
                                efree(str);
                        }