HashTable *ht = Z_OBJPROP_P(data);
if (zend_hash_find(ht, "enc_type", sizeof("enc_type"), (void **)&ztype) == FAILURE) {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: SoapVar hasn't 'enc_type' propery");
+ soap_error0(E_ERROR, "Encoding: SoapVar hasn't 'enc_type' propery");
}
if (SOAP_GLOBAL(sdl) && encode == NULL) {
if (type.map->map_functions.to_xml_before) {
if (call_user_function(EG(function_table), NULL, type.map->map_functions.to_xml_before, data, 1, &data TSRMLS_CC) == FAILURE) {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: Error calling to_xml_before");
+ soap_error0(E_ERROR, "Encoding: Error calling to_xml_before");
}
}
return data;
if (type.map->map_functions.to_xml) {
MAKE_STD_ZVAL(ret);
if (call_user_function(EG(function_table), NULL, type.map->map_functions.to_xml, ret, 1, &data TSRMLS_CC) == FAILURE) {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: Error calling to_xml");
+ soap_error0(E_ERROR, "Encoding: Error calling to_xml");
}
if (Z_TYPE_P(ret) != IS_OBJECT) {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: Error serializing object from to_xml_user");
+ soap_error0(E_ERROR, "Encoding: Error serializing object from to_xml_user");
}
if (zend_hash_index_find(Z_OBJPROP_P(ret), 1, (void **)&addr) == SUCCESS) {
param = php_domobject_new(node, &found, NULL TSRMLS_CC);
if (call_user_function(EG(function_table), NULL, type.map->map_functions.to_xml_after, ret, 1, ¶m TSRMLS_CC) == FAILURE) {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: Error calling to_xml_after");
+ soap_error0(E_ERROR, "Encoding: Error calling to_xml_after");
}
if (zend_hash_index_find(Z_OBJPROP_P(ret), 1, (void **)&addr) == SUCCESS) {
node = (xmlNodePtr)Z_LVAL_PP(addr);
param = php_domobject_new(node, &found, NULL TSRMLS_CC);
if (call_user_function(EG(function_table), NULL, type.map->map_functions.to_zval_before, ret, 1, ¶m TSRMLS_CC) == FAILURE) {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: Error calling to_zval_before");
+ soap_error0(E_ERROR, "Encoding: Error calling to_zval_before");
}
if (zend_hash_index_find(Z_OBJPROP_P(ret), 1, (void **)&addr) == SUCCESS) {
node = (xmlNodePtr)Z_LVAL_PP(addr);
param = php_domobject_new(node, &found, NULL TSRMLS_CC);
if (call_user_function(EG(function_table), NULL, type.map->map_functions.to_zval, ret, 1, ¶m TSRMLS_CC) == FAILURE) {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: Error calling to_zval");
+ soap_error0(E_ERROR, "Encoding: Error calling to_zval");
}
zval_ptr_dtor(¶m);
efree(param);
if (type.map->map_functions.to_zval_after) {
if (call_user_function(EG(function_table), NULL, type.map->map_functions.to_zval_after, data, 1, &data TSRMLS_CC) == FAILURE) {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: Error calling to_zval_after");
+ soap_error0(E_ERROR, "Encoding: Error calling to_zval_after");
}
}
return data;
} else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
ZVAL_STRING(ret, data->children->content, 1);
} else {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Violation of encoding rules");
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
} else {
ZVAL_EMPTY_STRING(ret);
} else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
ZVAL_STRING(ret, data->children->content, 1);
} else {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Violation of encoding rules");
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
} else {
ZVAL_EMPTY_STRING(ret);
} else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
ZVAL_STRING(ret, data->children->content, 1);
} else {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Violation of encoding rules");
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
} else {
ZVAL_EMPTY_STRING(ret);
whiteSpace_collapse(data->children->content);
ZVAL_DOUBLE(ret, atof(data->children->content));
} else {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Violation of encoding rules");
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
} else {
ZVAL_NULL(ret);
whiteSpace_collapse(data->children->content);
ZVAL_LONG(ret, atol(data->children->content));
} else {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Violation of encoding rules");
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
} else {
ZVAL_NULL(ret);
ret->type = IS_LONG;
}
} else {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Violation of encoding rules");
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
} else {
ZVAL_NULL(ret);
ZVAL_BOOL(ret, 0);
}
} else {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Violation of encoding rules");
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
} else {
ZVAL_NULL(ret);
if (node && node->children && node->children->content) {
if (model->u.element->fixed && strcmp(model->u.element->fixed,node->children->content) != 0) {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)",model->u.element->name,model->u.element->fixed,node->children->content);
+ soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, node->children->content);
}
val = master_to_zval(model->u.element->encode, node);
} else if (model->u.element->fixed) {
do {
if (node && node->children && node->children->content) {
if (model->u.element->fixed && strcmp(model->u.element->fixed,node->children->content) != 0) {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)",model->u.element->name,model->u.element->fixed,node->children->content);
+ soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, node->children->content);
}
val = master_to_zval(model->u.element->encode, node);
} else if (model->u.element->fixed) {
if (val && val->children && val->children->content) {
str_val = val->children->content;
if ((*attr)->fixed && strcmp((*attr)->fixed,str_val) != 0) {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)",(*attr)->name,(*attr)->fixed,str_val);
+ soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", (*attr)->name, (*attr)->fixed, str_val);
}
} else if ((*attr)->fixed) {
str_val = (*attr)->fixed;
property = master_to_xml(enc, *val, style, node);
if (property->children && property->children->content &&
model->u.element->fixed && strcmp(model->u.element->fixed,property->children->content) != 0) {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)",model->u.element->name,model->u.element->fixed,property->children->content);
+ soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content);
}
}
xmlNodeSetName(property, model->u.element->name);
property = master_to_xml(enc, *data, style, node);
if (property->children && property->children->content &&
model->u.element->fixed && strcmp(model->u.element->fixed,property->children->content) != 0) {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)",model->u.element->name,model->u.element->fixed,property->children->content);
+ soap_error3(E_ERROR, "Encoding: Element '%s' has fixed value '%s' (value '%s' is not allowed)", model->u.element->name, model->u.element->fixed, property->children->content);
}
}
xmlNodeSetName(property, model->u.element->name);
return 2;
} else {
if (strict) {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: object hasn't '%s' property",model->u.element->name);
+ soap_error1(E_ERROR, "Encoding: object hasn't '%s' property", model->u.element->name);
}
return 0;
}
dummy = master_to_xml((*attr)->encode, *data, SOAP_LITERAL, xmlParam);
if (dummy->children && dummy->children->content) {
if ((*attr)->fixed && strcmp((*attr)->fixed,dummy->children->content) != 0) {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)",(*attr)->name,(*attr)->fixed,dummy->children->content);
+ soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", (*attr)->name, (*attr)->fixed, dummy->children->content);
}
xmlSetProp(xmlParam, (*attr)->name, dummy->children->content);
}
flag = 1;
}
} else if (*str == '*') {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: '*' may only be first arraySize value in list");
+ soap_error0(E_ERROR, "Encoding: '*' may only be first arraySize value in list");
} else {
flag = 0;
}
}
pos[i] = (pos[i]*10)+(*str-'0');
} else if (*str == '*') {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: '*' may only be first arraySize value in list");
+ soap_error0(E_ERROR, "Encoding: '*' may only be first arraySize value in list");
} else {
flag = 0;
}
FOREACHNODE(trav, "item", item) {
xmlKey = get_node(item->children, "key");
if (!xmlKey) {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: Can't decode apache map, missing key");
+ soap_error0(E_ERROR, "Encoding: Can't decode apache map, missing key");
}
xmlValue = get_node(item->children, "value");
if (!xmlKey) {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: Can't decode apache map, missing value");
+ soap_error0(E_ERROR, "Encoding: Can't decode apache map, missing value");
}
key = master_to_zval(NULL, xmlKey);
} else if (Z_TYPE_P(key) == IS_LONG) {
zend_hash_index_update(Z_ARRVAL_P(ret), Z_LVAL_P(key), &value, sizeof(zval *), NULL);
} else {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: Can't decode apache map, only Strings or Longs are allowd as keys");
+ soap_error0(E_ERROR, "Encoding: Can't decode apache map, only Strings or Longs are allowd as keys");
}
zval_ptr_dtor(&key);
}
}
smart_str_appends(&list, dummy->children->content);
} else {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Violation of encoding rules");
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
xmlUnlinkNode(dummy);
xmlFreeNode(dummy);
}
smart_str_appends(&list, dummy->children->content);
} else {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Violation of encoding rules");
+ soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
xmlUnlinkNode(dummy);
xmlFreeNode(dummy);
}
if (type->restrictions->enumeration) {
if (!zend_hash_exists(type->restrictions->enumeration,data->children->content,strlen(data->children->content)+1)) {
- php_error(E_WARNING,"SOAP-ERROR: Encoding: Restriction: invalid enumeration value \"%s\"",data->children->content);
+ soap_error1(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\"", data->children->content);
}
}
if (type->restrictions->minLength &&
strlen(data->children->content) < type->restrictions->minLength->value) {
- php_error(E_WARNING,"SOAP-ERROR: Encoding: Restriction: length less then 'minLength'");
+ soap_error0(E_WARNING, "Encoding: Restriction: length less then 'minLength'");
}
if (type->restrictions->maxLength &&
strlen(data->children->content) > type->restrictions->maxLength->value) {
- php_error(E_WARNING,"SOAP-ERROR: Encoding: Restriction: length greater then 'maxLength'");
+ soap_error0(E_WARNING, "Encoding: Restriction: length greater then 'maxLength'");
}
if (type->restrictions->length &&
strlen(data->children->content) != type->restrictions->length->value) {
- php_error(E_WARNING,"SOAP-ERROR: Encoding: Restriction: length is not equal to 'length'");
+ soap_error0(E_WARNING, "Encoding: Restriction: length is not equal to 'length'");
}
}
*/
}
return to_zval_object(enc, data);
default:
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Internal Error");
+ soap_error0(E_ERROR, "Encoding: Internal Error");
return guess_zval_convert(enc, data);
}
}
if (type->restrictions && Z_TYPE_P(data) == IS_STRING) {
if (type->restrictions->enumeration) {
if (!zend_hash_exists(type->restrictions->enumeration,Z_STRVAL_P(data),Z_STRLEN_P(data)+1)) {
- php_error(E_WARNING,"SOAP-ERROR: Encoding: Restriction: invalid enumeration value \"%s\".",Z_STRVAL_P(data));
+ soap_error1(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\".", Z_STRVAL_P(data));
}
}
if (type->restrictions->minLength &&
Z_STRLEN_P(data) < type->restrictions->minLength->value) {
- php_error(E_WARNING,"SOAP-ERROR: Encoding: Restriction: length less then 'minLength'");
+ soap_error0(E_WARNING, "Encoding: Restriction: length less then 'minLength'");
}
if (type->restrictions->maxLength &&
Z_STRLEN_P(data) > type->restrictions->maxLength->value) {
- php_error(E_WARNING,"SOAP-ERROR: Encoding: Restriction: length greater then 'maxLength'");
+ soap_error0(E_WARNING, "Encoding: Restriction: length greater then 'maxLength'");
}
if (type->restrictions->length &&
Z_STRLEN_P(data) != type->restrictions->length->value) {
- php_error(E_WARNING,"SOAP-ERROR: Encoding: Restriction: length is not equal to 'length'");
+ soap_error0(E_WARNING, "Encoding: Restriction: length is not equal to 'length'");
}
}
}
}
break;
default:
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Internal Error");
+ soap_error0(E_ERROR, "Encoding: Internal Error");
break;
}
if (style == SOAP_ENCODED) {
if (href->children->content[0] == '#') {
xmlNodePtr ret = get_node_with_attribute_recursive(data->doc->children, NULL, "id", &href->children->content[1]);
if (!ret) {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Unresolved reference '%s'",href->children->content);
+ soap_error1(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content);
}
return ret;
} else {
/* TODO: External href....? */
- php_error(E_ERROR,"SOAP-ERROR: Encoding: External reference '%s'",href->children->content);
+ soap_error1(E_ERROR, "Encoding: External reference '%s'", href->children->content);
}
}
/* SOAP 1.2 enc:id enc:ref */
}
ret = get_node_with_attribute_recursive_ex(data->doc->children, NULL, NULL, "id", id, SOAP_1_2_ENC_NAMESPACE);
if (!ret) {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Unresolved reference '%s'",href->children->content);
+ soap_error1(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content);
} else if (ret == data) {
- php_error(E_ERROR,"SOAP-ERROR: Encoding: Violation of id and ref information items '%s'",href->children->content);
+ soap_error1(E_ERROR, "Encoding: Violation of id and ref information items '%s'", href->children->content);
}
return ret;
}
if (zend_hash_find(SOAP_GLOBAL(overrides), nscat.c, nscat.len + 1, (void **)&enc) == FAILURE) {
smart_str_free(&nscat);
- php_error(E_ERROR, "SOAP-ERROR: Encoding: Cannot find encoding");
+ soap_error0(E_ERROR, "Encoding: Cannot find encoding");
return NULL;
} else {
smart_str_free(&nscat);
return *enc;
}
} else {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: Cannot find encoding");
+ soap_error0(E_ERROR, "Encoding: Cannot find encoding");
return NULL;
}
} else {
zval **ztype;
if (zend_hash_find(Z_OBJPROP_PP(tmp), "enc_type", sizeof("enc_type"), (void **)&ztype) == FAILURE) {
- php_error(E_ERROR, "SOAP-ERROR: Encoding: SoapVar hasn't 'enc_type' property");
+ soap_error0(E_ERROR, "Encoding: SoapVar hasn't 'enc_type' property");
}
cur_type = Z_LVAL_PP(ztype);
doc = soap_xmlParseFile(location);
if (doc == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: can't import schema from '%s'",location);
+ soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s'", location);
}
schema = get_node(doc->children, "schema");
if (schema == NULL) {
xmlFreeDoc(doc);
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: can't import schema from '%s'",location);
+ soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s'", location);
}
new_tns = get_attribute(schema->properties, "targetNamespace");
if (import) {
if (ns != NULL && (new_tns == NULL || strcmp(ns->children->content,new_tns->children->content) != 0)) {
xmlFreeDoc(doc);
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s'",location,new_tns->children->content);
+ soap_error2(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s'", location, new_tns->children->content);
}
if (ns == NULL && new_tns != NULL) {
xmlFreeDoc(doc);
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s'",location,new_tns->children->content);
+ soap_error2(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s'", location, new_tns->children->content);
}
} else {
new_tns = get_attribute(schema->properties, "targetNamespace");
}
} else if (tns != NULL && strcmp(tns->children->content,new_tns->children->content) != 0) {
xmlFreeDoc(doc);
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: can't include schema from '%s', different 'targetNamespace'",location);
+ soap_error1(E_ERROR, "Parsing Schema: can't include schema from '%s', different 'targetNamespace'", location);
}
}
zend_hash_add(&ctx->docs, location, strlen(location)+1, (void**)&doc, sizeof(xmlDocPtr), NULL);
location = get_attribute(trav->properties, "schemaLocation");
if (location == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: include has no 'schemaLocation' attribute");
+ soap_error0(E_ERROR, "Parsing Schema: include has no 'schemaLocation' attribute");
} else {
xmlChar *uri;
xmlChar *base = xmlNodeGetBase(trav->doc, trav);
location = get_attribute(trav->properties, "schemaLocation");
if (location == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: redefine has no 'schemaLocation' attribute");
+ soap_error0(E_ERROR, "Parsing Schema: redefine has no 'schemaLocation' attribute");
} else {
xmlChar *uri;
xmlChar *base = xmlNodeGetBase(trav->doc, trav);
location = get_attribute(trav->properties, "schemaLocation");
if (ns != NULL && tns != NULL && strcmp(ns->children->content,tns->children->content) == 0) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: can't import schema from '%s', namespace must not match the enclosing schema 'targetNamespace'",location->children->content);
+ soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s', namespace must not match the enclosing schema 'targetNamespace'", location->children->content);
}
if (location) {
xmlChar *base = xmlNodeGetBase(trav->doc, trav);
} else if (node_is_equal(trav,"annotation")) {
/* TODO: <annotation> support */
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in schema",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in schema", trav->name);
}
trav = trav->next;
}
create_encoder(sdl, cur_type, ns->children->content, name->children->content);
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: simpleType has no 'name' attribute");
+ soap_error0(E_ERROR, "Parsing Schema: simpleType has no 'name' attribute");
}
trav = simpleType->children;
schema_union(sdl, tns, trav, cur_type);
trav = trav->next;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in simpleType",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name);
}
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: expected <restriction>, <list> or <union> in simpleType");
+ soap_error0(E_ERROR, "Parsing Schema: expected <restriction>, <list> or <union> in simpleType");
}
if (trav != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in simpleType",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleType", trav->name);
}
return TRUE;
sdlTypePtr newType, *tmp;
if (itemType != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'itemType' attribute and subtype");
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'itemType' attribute and subtype");
}
newType = emalloc(sizeof(sdlType));
trav = trav->next;
}
if (trav != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in list",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in list", trav->name);
}
return TRUE;
}
sdlTypePtr newType, *tmp;
if (memberTypes != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: union has both 'memberTypes' attribute and subtypes");
+ soap_error0(E_ERROR, "Parsing Schema: union has both 'memberTypes' attribute and subtypes");
}
newType = emalloc(sizeof(sdlType));
schema_simpleType(sdl, tns, trav, newType);
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in union",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name);
}
trav = trav->next;
}
if (trav != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in union",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in union", trav->name);
}
return TRUE;
}
schema_extension_simpleContent(sdl, tns, trav, cur_type);
trav = trav->next;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in simpleContent",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name);
}
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: expected <restriction> or <extension> in simpleContent");
+ soap_error0(E_ERROR, "Parsing Schema: expected <restriction> or <extension> in simpleContent");
}
if (trav != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in simpleContent",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in simpleContent", trav->name);
}
return TRUE;
if (type) {efree(type);}
if (ns) {efree(ns);}
} else if (!simpleType) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: restriction has no 'base' attribute");
+ soap_error0(E_ERROR, "Parsing Schema: restriction has no 'base' attribute");
}
if (cur_type->restrictions == NULL) {
trav = trav->next;
break;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in restriction",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name);
}
trav = trav->next;
}
}
if (trav != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in restriction",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name);
}
return TRUE;
if (type) {efree(type);}
if (ns) {efree(ns);}
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: restriction has no 'base' attribute");
+ soap_error0(E_ERROR, "Parsing Schema: restriction has no 'base' attribute");
}
trav = restType->children;
trav = trav->next;
break;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in restriction",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name);
}
trav = trav->next;
}
if (trav != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in restriction",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in restriction", trav->name);
}
return TRUE;
value = get_attribute(val->properties, "value");
if (value == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: missing restriction value");
+ soap_error0(E_ERROR, "Parsing Schema: missing restriction value");
}
(*valptr)->value = atoi(value->children->content);
value = get_attribute(val->properties, "value");
if (value == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: missing restriction value");
+ soap_error0(E_ERROR, "Parsing Schema: missing restriction value");
}
(*valptr)->value = estrdup(value->children->content);
if (type) {efree(type);}
if (ns) {efree(ns);}
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: extension has no 'base' attribute");
+ soap_error0(E_ERROR, "Parsing Schema: extension has no 'base' attribute");
}
trav = extType->children;
trav = trav->next;
break;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in extension",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name);
}
trav = trav->next;
}
if (trav != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in extension",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name);
}
return TRUE;
}
if (type) {efree(type);}
if (ns) {efree(ns);}
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: extension has no 'base' attribute");
+ soap_error0(E_ERROR, "Parsing Schema: extension has no 'base' attribute");
}
trav = extType->children;
trav = trav->next;
break;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in extension",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name);
}
trav = trav->next;
}
if (trav != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in extension",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in extension", trav->name);
}
return TRUE;
}
if (node_is_equal(trav,"element")) {
schema_element(sdl, tns, trav, cur_type, newModel);
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in all",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in all", trav->name);
}
trav = trav->next;
}
zend_hash_init(sdl->groups, 0, NULL, delete_type, 0);
}
if (zend_hash_add(sdl->groups, key.c, key.len+1, (void**)&newType, sizeof(sdlTypePtr), NULL) != SUCCESS) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: group '%s' already defined",key.c);
+ soap_error1(E_ERROR, "Parsing Schema: group '%s' already defined", key.c);
}
cur_type = newType;
zend_hash_next_index_insert(model->u.content, &newModel, sizeof(sdlContentModelPtr), NULL);
}
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: group has no 'name' nor 'ref' attributes");
+ soap_error0(E_ERROR, "Parsing Schema: group has no 'name' nor 'ref' attributes");
}
newModel->min_occurs = 1;
if (trav != NULL) {
if (node_is_equal(trav,"choice")) {
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: group has both 'ref' attribute and subcontent");
+ soap_error0(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent");
}
newModel->kind = XSD_CONTENT_CHOICE;
schema_choice(sdl, tns, trav, cur_type, newModel);
trav = trav->next;
} else if (node_is_equal(trav,"sequence")) {
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: group has both 'ref' attribute and subcontent");
+ soap_error0(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent");
}
newModel->kind = XSD_CONTENT_SEQUENCE;
schema_sequence(sdl, tns, trav, cur_type, newModel);
trav = trav->next;
} else if (node_is_equal(trav,"all")) {
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: group has both 'ref' attribute and subcontent");
+ soap_error0(E_ERROR, "Parsing Schema: group has both 'ref' attribute and subcontent");
}
newModel->kind = XSD_CONTENT_ALL;
schema_all(sdl, tns, trav, cur_type, newModel);
trav = trav->next;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in group",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name);
}
}
if (trav != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in group",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in group", trav->name);
}
return TRUE;
}
} else if (node_is_equal(trav,"any")) {
schema_any(sdl, tns, trav, cur_type, newModel);
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in choice",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in choice", trav->name);
}
trav = trav->next;
}
} else if (node_is_equal(trav,"any")) {
schema_any(sdl, tns, trav, cur_type, newModel);
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in sequence",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in sequence", trav->name);
}
trav = trav->next;
}
schema_extension_complexContent(sdl, tns, trav, cur_type);
trav = trav->next;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in complexContent",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name);
}
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: <restriction> or <extension> expected in complexContent");
+ soap_error0(E_ERROR, "Parsing Schema: <restriction> or <extension> expected in complexContent");
}
if (trav != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in complexContent", trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexContent", trav->name);
}
return TRUE;
cur_type = (*ptr);
create_encoder(sdl, cur_type, ns->children->content, name->children->content);
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: complexType has no 'name' attribute");
+ soap_error0(E_ERROR, "Parsing Schema: complexType has no 'name' attribute");
return FALSE;
}
trav = trav->next;
break;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in complexType",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name);
}
trav = trav->next;
}
}
}
if (trav != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in complexType",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in complexType", trav->name);
}
return TRUE;
}
smart_str_0(&key);
if (zend_hash_add(addHash, key.c, key.len + 1, &newType, sizeof(sdlTypePtr), NULL) != SUCCESS) {
if (cur_type == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element '%s' already defined",key.c);
+ soap_error1(E_ERROR, "Parsing Schema: element '%s' already defined", key.c);
} else {
zend_hash_next_index_insert(addHash, &newType, sizeof(sdlTypePtr), NULL);
}
}
cur_type = newType;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has no 'name' nor 'ref' attributes");
+ soap_error0(E_ERROR, "Parsing Schema: element has no 'name' nor 'ref' attributes");
}
/* nillable = boolean : false */
attr = get_attribute(attrs, "nillable");
if (attr) {
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'ref' and 'nillable' attributes");
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'nillable' attributes");
}
if (!stricmp(attr->children->content, "true") ||
!stricmp(attr->children->content, "1")) {
attr = get_attribute(attrs, "fixed");
if (attr) {
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'ref' and 'fixed' attributes");
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes");
}
cur_type->fixed = estrdup(attr->children->content);
}
attr = get_attribute(attrs, "default");
if (attr) {
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'ref' and 'fixed' attributes");
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes");
} else if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'default' and 'fixed' attributes");
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'default' and 'fixed' attributes");
}
cur_type->def = estrdup(attr->children->content);
}
xmlNsPtr nsptr;
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'ref' and 'type' attributes");
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'type' attributes");
}
parse_namespace(type->children->content, &cptype, &str_ns);
nsptr = xmlSearchNs(element->doc, element, str_ns);
if (trav != NULL) {
if (node_is_equal(trav,"simpleType")) {
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'ref' attribute and subtype");
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype");
} else if (type != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'type' attribute and subtype");
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype");
}
schema_simpleType(sdl, tns, trav, cur_type);
trav = trav->next;
} else if (node_is_equal(trav,"complexType")) {
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'ref' attribute and subtype");
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' attribute and subtype");
} else if (type != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: element has both 'type' attribute and subtype");
+ soap_error0(E_ERROR, "Parsing Schema: element has both 'type' attribute and subtype");
}
schema_complexType(sdl, tns, trav, cur_type);
trav = trav->next;
} else if (node_is_equal(trav,"keyref")) {
/* TODO: <keyref> support */
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in element",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in element", trav->name);
}
trav = trav->next;
}
}
if (zend_hash_add(addHash, key.c, key.len + 1, &newAttr, sizeof(sdlAttributePtr), NULL) != SUCCESS) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attribute '%s' already defined", key.c);
+ soap_error1(E_ERROR, "Parsing Schema: attribute '%s' already defined", key.c);
}
smart_str_free(&key);
} else{
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attribute has no 'name' nor 'ref' attributes");
+ soap_error0(E_ERROR, "Parsing Schema: attribute has no 'name' nor 'ref' attributes");
}
/* type = QName */
xmlNsPtr nsptr;
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attribute has both 'ref' and 'type' attributes");
+ soap_error0(E_ERROR, "Parsing Schema: attribute has both 'ref' and 'type' attributes");
}
parse_namespace(type->children->content, &cptype, &str_ns);
nsptr = xmlSearchNs(attrType->doc, attrType, str_ns);
if (node_is_equal(trav,"simpleType")) {
sdlTypePtr dummy_type;
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attribute has both 'ref' attribute and subtype");
+ soap_error0(E_ERROR, "Parsing Schema: attribute has both 'ref' attribute and subtype");
} else if (type != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attribute has both 'type' attribute and subtype");
+ soap_error0(E_ERROR, "Parsing Schema: attribute has both 'type' attribute and subtype");
}
dummy_type = emalloc(sizeof(sdlType));
memset(dummy_type, 0, sizeof(sdlType));
}
}
if (trav != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in attribute",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in attribute", trav->name);
}
return TRUE;
}
smart_str_0(&key);
if (zend_hash_add(ctx->attributeGroups, key.c, key.len + 1, &newType, sizeof(sdlTypePtr), NULL) != SUCCESS) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attributeGroup '%s' already defined", key.c);
+ soap_error1(E_ERROR, "Parsing Schema: attributeGroup '%s' already defined", key.c);
}
cur_type = newType;
smart_str_free(&key);
cur_type = NULL;
}
} else{
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attributeGroup has no 'name' nor 'ref' attributes");
+ soap_error0(E_ERROR, "Parsing Schema: attributeGroup has no 'name' nor 'ref' attributes");
}
trav = attrGroup->children;
while (trav != NULL) {
if (node_is_equal(trav,"attribute")) {
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attributeGroup has both 'ref' attribute and subattribute");
+ soap_error0(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute");
}
schema_attribute(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"attributeGroup")) {
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attributeGroup has both 'ref' attribute and subattribute");
+ soap_error0(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute");
}
schema_attributeGroup(sdl, tns, trav, cur_type, NULL);
} else if (node_is_equal(trav,"anyAttribute")) {
if (ref != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: attributeGroup has both 'ref' attribute and subattribute");
+ soap_error0(E_ERROR, "Parsing Schema: attributeGroup has both 'ref' attribute and subattribute");
}
/* TODO: <anyAttribute> support */
trav = trav->next;
break;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in attributeGroup",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name);
}
trav = trav->next;
}
if (trav != NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unexpected <%s> in attributeGroup",trav->name);
+ soap_error1(E_ERROR, "Parsing Schema: unexpected <%s> in attributeGroup", trav->name);
}
return TRUE;
}
model->kind = XSD_CONTENT_GROUP;
model->u.group = (*tmp);
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unresolved group 'ref' attribute");
+ soap_error0(E_ERROR, "Parsing Schema: unresolved group 'ref' attribute");
}
break;
}
type->def = estrdup((*tmp)->def);
}
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: unresolved element 'ref' attribute");
+ soap_error0(E_ERROR, "Parsing Schema: unresolved element 'ref' attribute");
}
}
efree(type->ref);
attr->children && attr->children->content &&
(strcmp(attr->children->content,"1") == 0 ||
strcmp(attr->children->content,"true") == 0)) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension '%s'", node->ns->href);
+ soap_error1(E_ERROR, "Parsing WSDL: Unknown required WSDL extension '%s'", node->ns->href);
}
return 0;
}
wsdl = soap_xmlParseFile(struri);
if (!wsdl) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Couldn't load from '%s'", struri);
+ soap_error1(E_ERROR, "Parsing WSDL: Couldn't load from '%s'", struri);
}
zend_hash_add(&ctx->docs, struri, strlen(struri)+1, (void**)&wsdl, sizeof(xmlDocPtr), NULL);
return;
}
}
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Couldn't find <definitions> in '%s'", struri);
+ soap_error1(E_ERROR, "Parsing WSDL: Couldn't find <definitions> in '%s'", struri);
}
if (!include) {
if (node_is_equal_ex(trav2, "schema", XSD_NAMESPACE)) {
load_schema(ctx, trav2);
} else if (is_wsdl_element(trav2) && !node_is_equal(trav2,"documentation")) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <%s>",trav2->name);
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav2->name);
}
trav2 = trav2->next;
}
xmlAttrPtr name = get_attribute(trav->properties, "name");
if (name && name->children && name->children->content) {
if (zend_hash_add(&ctx->messages, name->children->content, strlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: <message> '%s' already defined",name->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: <message> '%s' already defined", name->children->content);
}
} else {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: <message> hasn't name attribute");
+ soap_error0(E_ERROR, "Parsing WSDL: <message> hasn't name attribute");
}
} else if (node_is_equal(trav,"portType")) {
xmlAttrPtr name = get_attribute(trav->properties, "name");
if (name && name->children && name->children->content) {
if (zend_hash_add(&ctx->portTypes, name->children->content, strlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: <portType> '%s' already defined",name->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: <portType> '%s' already defined", name->children->content);
}
} else {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: <portType> hasn't name attribute");
+ soap_error0(E_ERROR, "Parsing WSDL: <portType> hasn't name attribute");
}
} else if (node_is_equal(trav,"binding")) {
xmlAttrPtr name = get_attribute(trav->properties, "name");
if (name && name->children && name->children->content) {
if (zend_hash_add(&ctx->bindings, name->children->content, strlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: <binding> '%s' already defined",name->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: <binding> '%s' already defined", name->children->content);
}
} else {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: <binding> hasn't name attribute");
+ soap_error0(E_ERROR, "Parsing WSDL: <binding> hasn't name attribute");
}
} else if (node_is_equal(trav,"service")) {
xmlAttrPtr name = get_attribute(trav->properties, "name");
if (name && name->children && name->children->content) {
if (zend_hash_add(&ctx->services, name->children->content, strlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: <service> '%s' already defined",name->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: <service> '%s' already defined", name->children->content);
}
} else {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: <service> hasn't name attribute");
+ soap_error0(E_ERROR, "Parsing WSDL: <service> hasn't name attribute");
}
} else if (!node_is_equal(trav,"documentation")) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <%s>",trav->name);
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name);
}
trav = trav->next;
}
tmp = get_attribute(header->properties, "message");
if (!tmp) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing message attribute for <header>");
+ soap_error0(E_ERROR, "Parsing WSDL: Missing message attribute for <header>");
}
ctype = strrchr(tmp->children->content,':');
++ctype;
}
if (zend_hash_find(&ctx->messages, ctype, strlen(ctype)+1, (void**)&message) != SUCCESS) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing <message> with name '%s'", tmp->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: Missing <message> with name '%s'", tmp->children->content);
}
tmp = get_attribute(header->properties, "part");
if (!tmp) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing part attribute for <header>");
+ soap_error0(E_ERROR, "Parsing WSDL: Missing part attribute for <header>");
}
part = get_node_with_attribute_ex((*message)->children, "part", WSDL_NAMESPACE, "name", tmp->children->content, NULL);
if (!part) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing part '%s' in <message>",tmp->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: Missing part '%s' in <message>", tmp->children->content);
}
h = emalloc(sizeof(sdlSoapBindingFunctionHeader));
} else if (strncmp(tmp->children->content,SOAP_1_2_ENC_NAMESPACE,sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) {
h->encodingStyle = SOAP_ENCODING_1_2;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Unknown encodingStyle '%s'",tmp->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content);
}
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Unspecified encodingStyle");
+ soap_error0(E_ERROR, "Parsing WSDL: Unspecified encodingStyle");
}
}
}
smart_str_free(&key);
} else if (is_wsdl_element(trav) && !node_is_equal(trav,"documentation")) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <%s>",trav->name);
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name);
}
trav = trav->next;
}
} else if (strncmp(tmp->children->content,SOAP_1_2_ENC_NAMESPACE,sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) {
binding->encodingStyle = SOAP_ENCODING_1_2;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Unknown encodingStyle '%s'",tmp->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content);
}
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Unspecified encodingStyle");
+ soap_error0(E_ERROR, "Parsing WSDL: Unspecified encodingStyle");
}
}
} else if (node_is_equal_ex(trav, "header", wsdl_soap_namespace)) {
}
smart_str_free(&key);
} else if (is_wsdl_element(trav) && !node_is_equal(trav,"documentation")) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <%s>",trav->name);
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name);
}
trav = trav->next;
}
++ctype;
}
if (zend_hash_find(&ctx->messages, ctype, strlen(ctype)+1, (void**)&tmp) != SUCCESS) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing <message> with name '%s'", message_name);
+ soap_error1(E_ERROR, "Parsing WSDL: Missing <message> with name '%s'", message_name);
}
message = *tmp;
sdlParamPtr param;
if (trav->ns != NULL && strcmp(trav->ns->href,WSDL_NAMESPACE) != 0) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: Unexpected extensibility element <%s>",trav->name);
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected extensibility element <%s>", trav->name);
}
if (node_is_equal(trav,"documentation")) {
trav = trav->next;
continue;
}
if (!node_is_equal(trav,"part")) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <%s>",trav->name);
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name);
}
part = trav;
param = emalloc(sizeof(sdlParam));
name = get_attribute(part->properties, "name");
if (name == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: No name associated with <part> '%s'", message->name);
+ soap_error1(E_ERROR, "Parsing WSDL: No name associated with <part> '%s'", message->name);
}
param->paramName = estrdup(name->children->content);
continue;
}
if (!node_is_equal(trav,"port")) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <%s>",trav->name);
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name);
}
port = trav;
bindingAttr = get_attribute(port->properties, "binding");
if (bindingAttr == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: No binding associated with <port>");
+ soap_error0(E_ERROR, "Parsing WSDL: No binding associated with <port>");
}
/* find address and figure out binding type */
}
}
if (trav2 != address && is_wsdl_element(trav2) && !node_is_equal(trav2,"documentation")) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <%s>",trav2->name);
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav2->name);
}
trav2 = trav2->next;
}
if (!address) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: No address associated with <port>");
+ soap_error0(E_ERROR, "Parsing WSDL: No address associated with <port>");
}
location = get_attribute(address->properties, "location");
if (!location) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: No location associated with <port>");
+ soap_error0(E_ERROR, "Parsing WSDL: No location associated with <port>");
}
tmpbinding->location = estrdup(location->children->content);
++ctype;
}
if (zend_hash_find(&ctx.bindings, ctype, strlen(ctype)+1, (void*)&tmp) != SUCCESS) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: No <binding> element with name '%s'", ctype);
+ soap_error1(E_ERROR, "Parsing WSDL: No <binding> element with name '%s'", ctype);
}
binding = *tmp;
if (strncmp(tmp->children->content, WSDL_HTTP_TRANSPORT, sizeof(WSDL_HTTP_TRANSPORT)) == 0) {
soapBinding->transport = SOAP_TRANSPORT_HTTP;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: PHP-SOAP doesn't support transport '%s'", tmp->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: PHP-SOAP doesn't support transport '%s'", tmp->children->content);
}
}
}
name = get_attribute(binding->properties, "name");
if (name == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing 'name' attribute for <binding>");
+ soap_error0(E_ERROR, "Parsing WSDL: Missing 'name' attribute for <binding>");
}
tmpbinding->name = estrdup(name->children->content);
type = get_attribute(binding->properties, "type");
if (type == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing 'type' attribute for <binding>");
+ soap_error0(E_ERROR, "Parsing WSDL: Missing 'type' attribute for <binding>");
}
ctype = strrchr(type->children->content,':');
++ctype;
}
if (zend_hash_find(&ctx.portTypes, ctype, strlen(ctype)+1, (void**)&tmp) != SUCCESS) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing <portType> with name '%s'", name->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: Missing <portType> with name '%s'", name->children->content);
}
portType = *tmp;
continue;
}
if (!node_is_equal(trav2,"operation")) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <%s>",trav2->name);
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav2->name);
}
operation = trav2;
op_name = get_attribute(operation->properties, "name");
if (op_name == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing 'name' attribute for <operation>");
+ soap_error0(E_ERROR, "Parsing WSDL: Missing 'name' attribute for <operation>");
}
trav3 = operation->children;
!node_is_equal(trav3,"output") &&
!node_is_equal(trav3,"fault") &&
!node_is_equal(trav3,"documentation")) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <%s>",trav3->name);
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav3->name);
}
trav3 = trav3->next;
}
portTypeOperation = get_node_with_attribute_ex(portType->children, "operation", WSDL_NAMESPACE, "name", op_name->children->content, NULL);
if (portTypeOperation == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing <portType>/<operation> with name '%s'", op_name->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: Missing <portType>/<operation> with name '%s'", op_name->children->content);
}
function = emalloc(sizeof(sdlFunction));
message = get_attribute(input->properties, "message");
if (message == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing name for <input> of '%s'", op_name->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: Missing name for <input> of '%s'", op_name->children->content);
}
function->requestParameters = wsdl_message(&ctx, message->children->content);
message = get_attribute(output->properties, "message");
if (message == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing name for <output> of '%s'", op_name->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: Missing name for <output> of '%s'", op_name->children->content);
}
function->responseParameters = wsdl_message(&ctx, message->children->content);
name = get_attribute(fault->properties, "name");
if (name == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing name for <fault> of '%s'", op_name->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: Missing name for <fault> of '%s'", op_name->children->content);
}
message = get_attribute(fault->properties, "message");
if (message == NULL) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing name for <output> of '%s'", op_name->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: Missing name for <output> of '%s'", op_name->children->content);
}
f = emalloc(sizeof(sdlFault));
f->name = estrdup(name->children->content);
f->details = wsdl_message(&ctx, message->children->content);
if (f->details == NULL || zend_hash_num_elements(f->details) > 1) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: The fault message '%s' must have a single part", message->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: The fault message '%s' must have a single part", message->children->content);
}
if (tmpbinding->bindingType == BINDING_SOAP) {
} else if (strncmp(tmp->children->content,SOAP_1_2_ENC_NAMESPACE,sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) {
binding->encodingStyle = SOAP_ENCODING_1_2;
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Unknown encodingStyle '%s'",tmp->children->content);
+ soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content);
}
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Unspecified encodingStyle");
+ soap_error0(E_ERROR, "Parsing WSDL: Unspecified encodingStyle");
}
}
} else if (is_wsdl_element(trav) && !node_is_equal(trav,"documentation")) {
- php_error(E_ERROR,"SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <%s>",trav->name);
+ soap_error1(E_ERROR, "Parsing WSDL: Unexpected WSDL element <%s>", trav->name);
}
trav = trav->next;
}
zend_hash_init(function->faults, 0, NULL, delete_fault, 0);
}
if (zend_hash_add(function->faults, f->name, strlen(f->name)+1, (void**)&f, sizeof(sdlFaultPtr), NULL) != SUCCESS) {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: <fault> with name '%s' already defined in '%s'", f->name, op_name->children->content);
+ soap_error2(E_ERROR, "Parsing WSDL: <fault> with name '%s' already defined in '%s'", f->name, op_name->children->content);
}
}
fault = fault->next;
zend_hash_move_forward(&ctx.services);
}
} else {
- php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Couldn't bind to service");
+ soap_error0(E_ERROR, "Parsing WSDL: Couldn't bind to service");
}
zend_hash_destroy(&ctx.messages);
zval* add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail TSRMLS_DC);
+#define soap_error0(severity, format) \
+ php_error(severity, "SOAP-ERROR: " format)
+
+#define soap_error1(severity, format, param1) \
+ php_error(severity, "SOAP-ERROR: " format, param1)
+
+#define soap_error2(severity, format, param1, param2) \
+ php_error(severity, "SOAP-ERROR: " format, param1, param2)
+
+#define soap_error3(severity, format, param1, param2, param3) \
+ php_error(severity, "SOAP-ERROR: " format, param1, param2, param3)
+
#endif
int found, name_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &name, &name_len, &pzval) == FAILURE) {
- php_error(E_ERROR, "wrong number of parameters to soap_encode_to_xml");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "wrong number of parameters");
}
enc = get_conversion(Z_TYPE_P(pzval));
xmlNodePtr node;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &dom) == FAILURE) {
- php_error(E_ERROR, "wrong number of parameters to soap_encode_to_zval");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "wrong number of parameters");
}
if (zend_hash_index_find(Z_OBJPROP_P(dom), 1, (void **)&addr) == FAILURE) {
int name_length;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &data, &name, &name_length) == FAILURE) {
- php_error(E_ERROR, "Invalid arguments to SoapParam constructor");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments");
}
#ifndef ZEND_ENGINE_2
zend_bool must_understand = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|zbz", &ns, &ns_len, &name, &name_len, &data, &must_understand, &actor) == FAILURE) {
- php_error(E_ERROR, "Invalid arguments to SoapHeader constructor");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments");
}
add_property_stringl(this_ptr, "namespace", ns, ns_len, 1);
} else if (Z_TYPE_P(actor) == IS_STRING) {
add_property_stringl(this_ptr, "actor", Z_STRVAL_P(actor), Z_STRLEN_P(actor), 1);
} else {
- php_error(E_ERROR, "Invalid arguments to SoapHeader constructor");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments");
}
}
&fault_string, &fault_string_len,
&fault_actor, &fault_actor_len,
&details, &name, &name_len, &headerfault) == FAILURE) {
- php_error(E_ERROR, "Invalid arguments to SoapFault constructor");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments");
}
set_soap_fault(this_ptr, fault_code, fault_string, fault_actor, details, name TSRMLS_CC);
int stype_len, ns_len, name_len, namens_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!z|ssss", &data, &type, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) {
- php_error(E_ERROR, "Invalid arguments to SoapVar constructor");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments");
}
if (Z_TYPE_P(type) == IS_NULL) {
if (zend_hash_index_exists(&SOAP_GLOBAL(defEncIndex), Z_LVAL_P(type))) {
add_property_long(this_ptr, "enc_type", Z_LVAL_P(type));
} else {
- php_error(E_ERROR, "Invalid type ID to SoapVar constructor");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid type ID");
}
}
SOAP_SERVER_BEGIN_CODE();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &wsdl, &options) == FAILURE) {
- php_error(E_ERROR, "Invalid arguments to SoapServer constructor");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments");
}
if (Z_TYPE_P(wsdl) == IS_STRING) {
} else if (Z_TYPE_P(wsdl) == IS_NULL) {
wsdl = NULL;
} else {
- php_error(E_ERROR, "Invalid arguments to SoapServer constructor");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments");
}
service = emalloc(sizeof(soapService));
Z_TYPE_PP(tmp) == IS_STRING) {
service->uri = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
} else if (wsdl == NULL) {
- php_error(E_ERROR, "Invalid arguments to SoapServer constructor. 'uri' option is required in nonWSDL mode.");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments. 'uri' option is required in nonWSDL mode.");
return;
}
service->actor = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
}
} else if (wsdl == NULL) {
- php_error(E_ERROR, "Invalid arguments to SoapServer constructor. 'uri' option is required in nonWSDL mode.");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments. 'uri' option is required in nonWSDL mode.");
}
service->version = version;
smart_str_free(&resloved_ns);
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &type, &type_len, &class_name, &class_name_len, &type) == SUCCESS) {
} else {
- php_error(E_ERROR, "Wrong number of parameters to SoapServer->map");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Wrong number of parameters");
}
}
#endif
value == SOAP_PERSISTENCE_REQUEST) {
service->soap_class.persistance = value;
} else {
- php_error(E_ERROR, "Tried to set persistence with bogus value (%ld)", value);
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Tried to set persistence with bogus value (%ld)", value);
}
} else {
- php_error(E_ERROR, "Tried to set persistence when you are using you SOAP SERVER in function mode, no persistence needed");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Tried to set persistence when you are using you SOAP SERVER in function mode, no persistence needed");
}
}
}
}
} else {
- php_error(E_ERROR, "Tried to set a non existant class (%s)", Z_STRVAL_PP(argv[0]));
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Tried to set a non existant class (%s)", Z_STRVAL_PP(argv[0]));
}
} else {
- php_error(E_ERROR, "You must pass in a string to setclass");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "You must pass in a string");
}
efree(argv);
FETCH_THIS_SERVICE(service);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &function_name) == FAILURE) {
- php_error(E_ERROR, "Invalid parameters passed to addfunction");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters passed");
}
/* TODO: could use zend_is_callable here */
zend_function *f;
if (Z_TYPE_PP(tmp_function) != IS_STRING) {
- php_error(E_ERROR, "Tried to add a function that isn't a string");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Tried to add a function that isn't a string");
}
key_len = Z_STRLEN_PP(tmp_function);
zend_str_tolower_copy(key, Z_STRVAL_PP(tmp_function), key_len);
if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) {
- php_error(E_ERROR, "Tried to add a non existant function '%s'", Z_STRVAL_PP(tmp_function));
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Tried to add a non existant function '%s'", Z_STRVAL_PP(tmp_function));
}
MAKE_STD_ZVAL(function_copy);
zend_str_tolower_copy(key, Z_STRVAL_P(function_name), key_len);
if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) {
- php_error(E_ERROR, "Tried to add a non existant function '%s'", Z_STRVAL_P(function_name));
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Tried to add a non existant function '%s'", Z_STRVAL_P(function_name));
}
if (service->soap_functions.ft == NULL) {
service->soap_functions.functions_all = FALSE;
}
service->soap_functions.functions_all = TRUE;
} else {
- php_error(E_ERROR, "Invalid value passed to addfunction");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid value passed");
}
}
FETCH_THIS_SERVICE(service);
SOAP_GLOBAL(soap_version) = service->version;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) {
- php_error(E_ERROR, "Invalid parameters passed to soapserver:handle");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters passed");
}
INIT_ZVAL(retval);
ZVAL_STRING(param, service->sdl->source, 1);
ZVAL_STRING(&readfile, "readfile", 1);
if (call_user_function(EG(function_table), NULL, &readfile, &readfile_ret, 1, ¶m TSRMLS_CC) == FAILURE) {
- php_error(E_ERROR, "Couldn't find WSDL");
+ soap_server_fault("Server", "Couldn't find WSDL", NULL, NULL, NULL TSRMLS_CC);
}
zval_ptr_dtor(¶m);
SOAP_SERVER_END_CODE();
return;
} else {
- php_error(E_ERROR, "WSDL generation is not supported yet");
+ soap_server_fault("Server", "WSDL generation is not supported yet", NULL, NULL, NULL TSRMLS_CC);
/*
sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\""), 1);
PUTS("<?xml version=\"1.0\" ?>\n<definitions\n");
}
if (php_start_ob_buffer(NULL, 0, 0 TSRMLS_CC) != SUCCESS) {
- php_error(E_ERROR,"ob_start failed");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR,"ob_start failed");
}
if (ZEND_NUM_ARGS() == 0) {
ZVAL_STRINGL(params[0], Z_STRVAL_PP(raw_post), Z_STRLEN_PP(raw_post), 0);
INIT_PZVAL(params[0]);
} else {
- php_error(E_ERROR,"Request is compressed with unknown compression '%s'",Z_STRVAL_PP(encoding));
+ php_error_docref(NULL TSRMLS_CC, E_ERROR,"Request is compressed with unknown compression '%s'",Z_STRVAL_PP(encoding));
}
if (call_user_function(CG(function_table), (zval**)NULL, &func, &retval, 1, params TSRMLS_CC) == SUCCESS &&
Z_TYPE(retval) == IS_STRING) {
doc_request = soap_xmlParseMemory(Z_STRVAL(retval),Z_STRLEN(retval));
zval_dtor(&retval);
} else {
- php_error(E_ERROR,"Can't uncompress compressed request");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR,"Can't uncompress compressed request");
}
} else {
doc_request = soap_xmlParseMemory(Z_STRVAL_PP(raw_post),Z_STRLEN_PP(raw_post));
if (zend_hash_find(Z_ARRVAL_PP(server_vars), "REQUEST_METHOD", sizeof("REQUEST_METHOD"), (void **)&req_method) == SUCCESS) {
if (!strcmp(Z_STRVAL_PP(req_method), "POST")) {
if (!zend_ini_long("always_populate_raw_post_data", sizeof("always_populate_raw_post_data"), 0)) {
- php_error(E_ERROR, "PHP-SOAP requires 'always_populate_raw_post_data' to be on please check your php.ini file");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "PHP-SOAP requires 'always_populate_raw_post_data' to be on please check your php.ini file");
}
}
}
}
- php_error(E_ERROR, "Bad Request. Can't find HTTP_RAW_POST_DATA");
+ soap_server_fault("Server", "Bad Request. Can't find HTTP_RAW_POST_DATA", NULL, NULL, NULL TSRMLS_CC);
return;
}
} else {
doc_request = soap_xmlParseMemory(arg,arg_len);
}
- if (doc_request == NULL) {
- php_error(E_ERROR, "Bad Request");
+ if (doc_request == NULL) {
+ soap_server_fault("Client", "Bad Request", NULL, NULL, NULL TSRMLS_CC);
}
if (xmlGetIntSubset(doc_request) != NULL) {
xmlNodePtr env = get_node(doc_request->children,"Envelope");
}
}
xmlFreeDoc(doc_request);
- php_error(E_ERROR,"DTD are not supported by SOAP");
+ soap_server_fault("Server", "DTD are not supported by SOAP", NULL, NULL, NULL TSRMLS_CC);
}
old_sdl = SOAP_GLOBAL(sdl);
ZVAL_STRING(&constructor, ZEND_CONSTRUCTOR_FUNC_NAME, 1);
if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) {
- php_error(E_ERROR, "Error calling constructor");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor");
}
if (EG(exception)) {
if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
ZVAL_STRING(&constructor, service->soap_class.ce->name, 1);
if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) {
- php_error(E_ERROR, "Error calling constructor");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor");
}
#ifdef ZEND_ENGINE_2
if (EG(exception)) {
call_status = call_user_function(EG(function_table), NULL, &h->function_name, &h->retval, h->num_params, h->parameters TSRMLS_CC);
}
if (call_status != SUCCESS) {
- php_error(E_ERROR, "Function '%s' call failed", Z_STRVAL(h->function_name));
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Function '%s' call failed", Z_STRVAL(h->function_name));
}
if (Z_TYPE(h->retval) == IS_OBJECT &&
Z_OBJCE(h->retval) == soap_fault_class_entry) {
SOAP_GLOBAL(overrides) = NULL;
efree(response_name);
} else {
- php_error(E_ERROR, "Function '%s' call failed", Z_STRVAL(function_name));
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Function '%s' call failed", Z_STRVAL(function_name));
}
/* Flush buffer */
xmlDocDumpMemory(doc_return, &buf, &size);
if (size == 0) {
- php_error(E_ERROR, "Dump memory failed");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Dump memory failed");
}
sprintf(cont_len, "Content-Length: %d", size);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|szs",
&code, &code_len, &string, &string_len, &actor, &actor_len, &details,
&name, &name_len) == FAILURE) {
- php_error(E_ERROR, "Invalid parameters passed to soapserver:fault");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters");
}
soap_server_fault(code, string, actor, details, name TSRMLS_CC);
SOAP_CLIENT_BEGIN_CODE();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &wsdl, &options) == FAILURE) {
- php_error(E_ERROR, "Can't create SoapClient. Invalid parameters.");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid parameters.");
return;
}
if (Z_TYPE_P(wsdl) == IS_STRING) {
} else if (Z_TYPE_P(wsdl) != IS_NULL ) {
- php_error(E_ERROR, "Can't create SoapClient. $wsdl must be string or null.");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "$wsdl must be string or null.");
return;
} else {
wsdl = NULL;
Z_TYPE_PP(tmp) == IS_STRING) {
add_property_stringl(this_ptr, "location", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
} else {
- php_error(E_ERROR, "Can't create SoapClient. 'location' option is requred in nonWSDL mode.");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' option is requred in nonWSDL mode.");
return;
}
Z_TYPE_PP(tmp) == IS_STRING) {
add_property_stringl(this_ptr, "uri", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
} else {
- php_error(E_ERROR, "Can't create SoapClient. 'uri' option is requred in nonWSDL mode.");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "'uri' option is requred in nonWSDL mode.");
return;
}
add_property_long(this_ptr, "compression", Z_LVAL_PP(tmp));
}
} else if (wsdl == NULL) {
- php_error(E_ERROR, "Can't create SoapClient. 'location' and 'uri' options are requred in nonWSDL mode.");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "'location' and 'uri' options are requred in nonWSDL mode.");
return;
}
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa|zzz",
&function, &function_len, &args, &options, &headers, &output_headers) == FAILURE) {
- php_error(E_ERROR, "Invalid arguments to SoapClient->__call");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments");
}
if (options) {
soap_action = Z_STRVAL_PP(tmp);
}
} else if (Z_TYPE_P(options) != IS_NULL) {
- php_error(E_ERROR, "Invalid arguments to SoapClient->__call");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments");
}
}
while (zend_hash_get_current_data(soap_headers, (void**)&tmp) == SUCCESS) {
if (Z_TYPE_PP(tmp) != IS_OBJECT ||
Z_OBJCE_PP(tmp) != soap_header_class_entry) {
- php_error(E_ERROR, "Invalid arguments to SoapClient->__call");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments");
}
zend_hash_move_forward(soap_headers);
}
zend_hash_next_index_insert(soap_headers, &headers, sizeof(zval*), NULL);
headers = NULL;
} else{
- php_error(E_ERROR, "Invalid arguments to SoapClient->__call");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid arguments");
}
arg_count = zend_hash_num_elements(Z_ARRVAL_P(args));
sdlParamPtr *param = NULL;
if (function != NULL &&
zend_hash_index_find(function->requestParameters, cur_param, (void **)¶m) == FAILURE) {
- php_error(E_ERROR, "Error cannot find parameter");
+ TSRMLS_FETCH();
+ soap_server_fault("Client", "Error cannot find parameter", NULL, NULL, NULL TSRMLS_CC);
}
if (param == NULL) {
enc = NULL;
envelope_ns = SOAP_1_2_ENV_NAMESPACE;
SOAP_GLOBAL(soap_version) = SOAP_1_2;
} else {
- soap_server_fault("VersionMismatch","Wrong Version", NULL, NULL, NULL TSRMLS_CC);
+ soap_server_fault("VersionMismatch", "Wrong Version", NULL, NULL, NULL TSRMLS_CC);
}
}
trav = trav->next;
}
if (env == NULL) {
- php_error(E_ERROR,"looks like we got XML without \"Envelope\" element");
+ soap_server_fault("Client", "looks like we got XML without \"Envelope\" element", NULL, NULL, NULL TSRMLS_CC);
}
attr = env->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
- php_error(E_ERROR,"A SOAP Envelope element cannot have non Namespace qualified attributes");
+ soap_server_fault("Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC);
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
- php_error(E_ERROR,"encodingStyle cannot be specified on the Envelope");
+ soap_server_fault("Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL, NULL TSRMLS_CC);
} else if (strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- php_error(E_ERROR,"Unknown data encoding style");
+ soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
}
}
attr = attr->next;
trav = trav->next;
}
if (body == NULL) {
- php_error(E_ERROR,"Body must be present in a SOAP envelope");
+ soap_server_fault("Client", "Body must be present in a SOAP envelope", NULL, NULL, NULL TSRMLS_CC);
}
attr = body->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
if (*version == SOAP_1_2) {
- php_error(E_ERROR,"A SOAP Body element cannot have non Namespace qualified attributes");
+ soap_server_fault("Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC);
}
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
- php_error(E_ERROR,"encodingStyle cannot be specified on the Body");
+ soap_server_fault("Client", "encodingStyle cannot be specified on the Body", NULL, NULL, NULL TSRMLS_CC);
} else if (strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- php_error(E_ERROR,"Unknown data encoding style");
+ soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
}
}
attr = attr->next;
}
if (trav != NULL && *version == SOAP_1_2) {
- php_error(E_ERROR,"A SOAP 1.2 envelope can contain only Header and Body");
+ soap_server_fault("Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL, NULL TSRMLS_CC);
}
func = NULL;
while (trav != NULL) {
if (trav->type == XML_ELEMENT_NODE) {
if (func != NULL) {
- php_error(E_ERROR,"looks like we got \"Body\" with several functions call");
+ soap_server_fault("Client", "looks like we got \"Body\" with several functions call", NULL, NULL, NULL TSRMLS_CC);
}
func = trav;
}
INIT_ZVAL(*function_name);
ZVAL_STRING(function_name, (char *)function->functionName, 1);
} else {
- php_error(E_ERROR,"looks like we got \"Body\" without function call");
+ soap_server_fault("Client", "looks like we got \"Body\" without function call", NULL, NULL, NULL TSRMLS_CC);
}
} else {
if (*version == SOAP_1_1) {
attr = head->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
- php_error(E_ERROR,"A SOAP Header element cannot have non Namespace qualified attributes");
+ soap_server_fault("Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL, NULL TSRMLS_CC);
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
- php_error(E_ERROR,"encodingStyle cannot be specified on the Header");
+ soap_server_fault("Client", "encodingStyle cannot be specified on the Header", NULL, NULL, NULL TSRMLS_CC);
} else if (strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
- php_error(E_ERROR,"Unknown data encoding style");
+ soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
}
}
attr = attr->next;
ns = xmlNewNs(envelope, SOAP_1_2_ENV_NAMESPACE, SOAP_1_2_ENV_NS_PREFIX);
xmlSetNs(envelope,ns);
} else {
- php_error(E_ERROR, "Unknown SOAP version");
+ soap_server_fault("Server", "Unknown SOAP version", NULL, NULL, NULL TSRMLS_CC);
}
xmlDocSetRootElement(doc, envelope);
ns = xmlNewNs(envelope, SOAP_1_2_ENV_NAMESPACE, SOAP_1_2_ENV_NS_PREFIX);
xmlSetNs(envelope,ns);
} else {
- php_error(E_ERROR, "SOAP-ERROR: Unknown SOAP version");
+ soap_error0(E_ERROR, "Unknown SOAP version");
}
xmlDocSetRootElement(doc, envelope);
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>encodingStyle cannot be specified on the Body</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>encodingStyle cannot be specified on the Body</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>Body must be present in a SOAP envelope</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>Body must be present in a SOAP envelope</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>A SOAP 1.2 envelope can contain only Header and Body</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>A SOAP 1.2 envelope can contain only Header and Body</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>A SOAP Envelope element cannot have non Namespace qualified attributes</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>A SOAP Envelope element cannot have non Namespace qualified attributes</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>encodingStyle cannot be specified on the Envelope</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>encodingStyle cannot be specified on the Envelope</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>