summaryrefslogtreecommitdiff
path: root/ext/soap
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2004-01-16 07:55:27 +0000
committerDmitry Stogov <dmitry@php.net>2004-01-16 07:55:27 +0000
commit9bf8d5bfe9e076177991e9a9ee737ecb0395dbcf (patch)
tree5c63dcf0aecdcc7e78bf9791dfa2f133346e11af /ext/soap
parent7e19a6724757b0104ef30c4572aa989f12217e6c (diff)
downloadphp-git-9bf8d5bfe9e076177991e9a9ee737ecb0395dbcf.tar.gz
faultcode/faultstring mismatch was fixed
Diffstat (limited to 'ext/soap')
-rw-r--r--ext/soap/TODO2
-rw-r--r--ext/soap/soap.c24
2 files changed, 18 insertions, 8 deletions
diff --git a/ext/soap/TODO b/ext/soap/TODO
index fcd61548d6..02b3f3aaa7 100644
--- a/ext/soap/TODO
+++ b/ext/soap/TODO
@@ -11,7 +11,7 @@ SOAP
+ SOAP versioning model
+ SOAP message must not contain a Document Type Declaration
- SOAP message MUST NOT contain Processing Instructions <?xml-stylesheet ... ?> (XML_PI_NODE)
-- SOAP 1.1 fault codes ("client","server"), SOAP 1.1 fault codes ("Sender","Receiver")
++ SOAP 1.1 fault codes ("client","server"), SOAP 1.1 fault codes ("Sender","Receiver")
+ SOAP 1.1 Content-Type - "text/xml", SOAP 1.2 - "application/soap+xml"
- support for SOAP headers
- actor attribute
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 367ad69bce..7eee91f227 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -529,8 +529,10 @@ PHP_METHOD(soapfault,soapfault)
int fault_string_len, fault_code_len, fault_actor_len;
zval *thisObj, *details = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|zs", &fault_string, &fault_string_len,
- &fault_code, &fault_code_len, &details, &fault_actor, &fault_actor_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|zs",
+ &fault_code, &fault_code_len,
+ &fault_string, &fault_string_len,
+ &details, &fault_actor, &fault_actor_len) == FAILURE) {
php_error(E_ERROR, "Invalid arguments to SoapFault constructor");
}
@@ -1697,7 +1699,8 @@ zval* add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *faul
{
zval *fault;
MAKE_STD_ZVAL(fault);
- set_soap_fault(fault, fault_string, fault_code, fault_actor, fault_detail TSRMLS_CC);
+// set_soap_fault(fault, fault_string, fault_code, fault_actor, fault_detail TSRMLS_CC);
+ set_soap_fault(fault, fault_code, fault_string, fault_actor, fault_detail TSRMLS_CC);
#ifdef ZEND_ENGINE_2
fault->refcount--;
#endif
@@ -1717,15 +1720,22 @@ static void set_soap_fault(zval *obj, char *fault_code, char *fault_string, char
int soap_version = SOAP_GLOBAL(soap_version);
smart_str code = {0};
if (soap_version == SOAP_1_1) {
- smart_str_appendl(&code, SOAP_1_1_ENV_NS_PREFIX, sizeof(SOAP_1_1_ENV_NS_PREFIX)-1);
- smart_str_appendc(&code, ':');
+ if (strcmp(fault_code,"Client") == 0) {
+ smart_str_appendl(&code, SOAP_1_1_ENV_NS_PREFIX, sizeof(SOAP_1_1_ENV_NS_PREFIX)-1);
+ smart_str_appendc(&code, ':');
+ } else if (strcmp(fault_code,"Server") == 0) {
+ smart_str_appendl(&code, SOAP_1_1_ENV_NS_PREFIX, sizeof(SOAP_1_1_ENV_NS_PREFIX)-1);
+ smart_str_appendc(&code, ':');
+ }
smart_str_appends(&code,fault_code);
} else if (soap_version == SOAP_1_2) {
- smart_str_appendl(&code, SOAP_1_2_ENV_NS_PREFIX, sizeof(SOAP_1_2_ENV_NS_PREFIX)-1);
- smart_str_appendc(&code, ':');
if (strcmp(fault_code,"Client") == 0) {
+ smart_str_appendl(&code, SOAP_1_2_ENV_NS_PREFIX, sizeof(SOAP_1_2_ENV_NS_PREFIX)-1);
+ smart_str_appendc(&code, ':');
smart_str_appendl(&code,"Sencer",sizeof("Sender")-1);
} else if (strcmp(fault_code,"Server") == 0) {
+ smart_str_appendl(&code, SOAP_1_2_ENV_NS_PREFIX, sizeof(SOAP_1_2_ENV_NS_PREFIX)-1);
+ smart_str_appendc(&code, ':');
smart_str_appendl(&code,"Receiver",sizeof("Receiver")-1);
} else {
smart_str_appends(&code,fault_code);