int numDefaultEncodings = sizeof(defaultEncoding)/sizeof(encode);
-void whiteSpace_replace(char* str)
+void whiteSpace_replace(xmlChar* str)
{
while (*str != '\0') {
if (*str == '\x9' || *str == '\xA' || *str == '\xD') {
}
}
-void whiteSpace_collapse(char* str)
+void whiteSpace_collapse(xmlChar* str)
{
- char *pos;
- char old;
+ xmlChar *pos;
+ xmlChar old;
pos = str;
whiteSpace_replace(str);
}
if (zend_hash_find(ht, "enc_name", sizeof("enc_name"), (void **)&zname) == SUCCESS) {
- xmlNodeSetName(node, Z_STRVAL_PP(zname));
+ xmlNodeSetName(node, BAD_CAST(Z_STRVAL_PP(zname)));
}
if (zend_hash_find(ht, "enc_namens", sizeof("enc_namens"), (void **)&znamens) == SUCCESS) {
xmlNsPtr nsp = encode_add_ns(node, Z_STRVAL_PP(znamens));
TSRMLS_FETCH();
if (SOAP_GLOBAL(encoding) != NULL) {
- xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, strlen(data->children->content));
+ xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, xmlStrlen(data->children->content));
xmlBufferPtr out = xmlBufferCreate();
int n = xmlCharEncOutFunc(SOAP_GLOBAL(encoding), out, in);
if (n >= 0) {
ZVAL_STRING(ret, (char*)xmlBufferContent(out), 1);
} else {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
}
xmlBufferFree(out);
xmlBufferFree(in);
} else {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
}
} else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
whiteSpace_replace(data->children->content);
if (SOAP_GLOBAL(encoding) != NULL) {
- xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, strlen(data->children->content));
+ xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, xmlStrlen(data->children->content));
xmlBufferPtr out = xmlBufferCreate();
int n = xmlCharEncOutFunc(SOAP_GLOBAL(encoding), out, in);
if (n >= 0) {
ZVAL_STRING(ret, (char*)xmlBufferContent(out), 1);
} else {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
}
xmlBufferFree(out);
xmlBufferFree(in);
} else {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
}
} else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
whiteSpace_collapse(data->children->content);
if (SOAP_GLOBAL(encoding) != NULL) {
- xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, strlen(data->children->content));
+ xmlBufferPtr in = xmlBufferCreateStatic(data->children->content, xmlStrlen(data->children->content));
xmlBufferPtr out = xmlBufferCreate();
int n = xmlCharEncOutFunc(SOAP_GLOBAL(encoding), out, in);
if (n >= 0) {
ZVAL_STRING(ret, (char*)xmlBufferContent(out), 1);
} else {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
}
xmlBufferFree(out);
xmlBufferFree(in);
} else {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
}
} else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
FIND_XML_NULL(data, ret);
if (data && data->children) {
if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
- whiteSpace_collapse((char*)data->children->content);
+ whiteSpace_collapse(data->children->content);
str = (char*)php_base64_decode(data->children->content, strlen((char*)data->children->content), &str_len);
ZVAL_STRINGL(ret, str, str_len, 0);
} else if (data->children->type == XML_CDATA_SECTION_NODE && data->children->next == NULL) {
FIND_XML_NULL(data, ret);
if (data && data->children) {
if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
- whiteSpace_collapse((char*)data->children->content);
+ whiteSpace_collapse(data->children->content);
} else if (data->children->type != XML_CDATA_SECTION_NODE || data->children->next != NULL) {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
return ret;
int new_len;
TSRMLS_FETCH();
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
if (n >= 0) {
efree(str);
- str = estrdup(xmlBufferContent(out));
+ str = estrdup((char*)xmlBufferContent(out));
new_len = n;
- } else if (!php_libxml_xmlCheckUTF8(str)) {
+ } else if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) {
soap_error1(E_ERROR, "Encoding: string '%s' is not a valid utf-8 string", str);
}
xmlBufferFree(out);
xmlBufferFree(in);
- } else if (!php_libxml_xmlCheckUTF8(str)) {
+ } else if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) {
soap_error1(E_ERROR, "Encoding: string '%s' is not a valid utf-8 string", str);
}
- text = xmlNewTextLen(str, new_len);
+ text = xmlNewTextLen(BAD_CAST(str), new_len);
xmlAddChild(ret, text);
efree(str);
unsigned char *str;
int str_len;
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
zval tmp;
int i, j;
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
if (data && data->children) {
if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
whiteSpace_collapse(data->children->content);
- ZVAL_DOUBLE(ret, atof(data->children->content));
+ ZVAL_DOUBLE(ret, atof((char*)data->children->content));
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
whiteSpace_collapse(data->children->content);
errno = 0;
- ret->value.lval = strtol(data->children->content, NULL, 0);
+ ret->value.lval = strtol((char*)data->children->content, NULL, 0);
if (errno == ERANGE) { /* overflow */
- ret->value.dval = zend_strtod(data->children->content, NULL);
+ ret->value.dval = zend_strtod((char*)data->children->content, NULL);
ret->type = IS_DOUBLE;
} else {
ret->type = IS_LONG;
{
xmlNodePtr ret;
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
char s[256];
sprintf(s, "%0.0f",floor(Z_DVAL_P(data)));
- xmlNodeSetContent(ret, s);
+ xmlNodeSetContent(ret, BAD_CAST(s));
} else {
zval tmp = *data;
convert_to_long(&tmp);
}
convert_to_string(&tmp);
- xmlNodeSetContentLen(ret, Z_STRVAL(tmp), Z_STRLEN(tmp));
+ xmlNodeSetContentLen(ret, BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp));
zval_dtor(&tmp);
}
xmlNodePtr ret;
zval tmp;
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
convert_to_double(&tmp);
}
convert_to_string(&tmp);
- xmlNodeSetContentLen(ret, Z_STRVAL(tmp), Z_STRLEN(tmp));
+ xmlNodeSetContentLen(ret, BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp));
zval_dtor(&tmp);
if (style == SOAP_ENCODED) {
if (data && data->children) {
if (data->children->type == XML_TEXT_NODE && data->children->next == NULL) {
whiteSpace_collapse(data->children->content);
- if (stricmp(data->children->content,"true") == 0 ||
- stricmp(data->children->content,"t") == 0 ||
- strcmp(data->children->content,"1") == 0) {
+ if (stricmp((char*)data->children->content, "true") == 0 ||
+ stricmp((char*)data->children->content, "t") == 0 ||
+ strcmp((char*)data->children->content, "1") == 0) {
ZVAL_BOOL(ret, 1);
- } else if (stricmp(data->children->content,"false") == 0 ||
- stricmp(data->children->content,"f") == 0 ||
- strcmp(data->children->content,"0") == 0) {
+ } else if (stricmp((char*)data->children->content, "false") == 0 ||
+ stricmp((char*)data->children->content, "f") == 0 ||
+ strcmp((char*)data->children->content, "0") == 0) {
ZVAL_BOOL(ret, 0);
} else {
- ZVAL_STRING(ret, data->children->content, 1);
+ ZVAL_STRING(ret, (char*)data->children->content, 1);
convert_to_boolean(ret);
}
} else {
{
xmlNodePtr ret;
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
if (zend_is_true(data)) {
- xmlNodeSetContent(ret, "true");
+ xmlNodeSetContent(ret, BAD_CAST("true"));
} else {
- xmlNodeSetContent(ret, "false");
+ xmlNodeSetContent(ret, BAD_CAST("false"));
}
if (style == SOAP_ENCODED) {
{
xmlNodePtr ret;
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, ret);
if (style == SOAP_ENCODED) {
set_xsi_nil(ret);
node = check_and_resolve_href(node);
if (node && node->children && node->children->content) {
- if (model->u.element->fixed && strcmp(model->u.element->fixed,node->children->content) != 0) {
+ if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)node->children->content) != 0) {
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) {
- xmlNodePtr dummy = xmlNewNode(NULL, "BOGUS");
- xmlNodeSetContent(dummy, model->u.element->fixed);
+ xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlNodeSetContent(dummy, BAD_CAST(model->u.element->fixed));
val = master_to_zval(model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else if (model->u.element->def && !model->u.element->nillable) {
- xmlNodePtr dummy = xmlNewNode(NULL, "BOGUS");
- xmlNodeSetContent(dummy, model->u.element->def);
+ xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlNodeSetContent(dummy, BAD_CAST(model->u.element->def));
val = master_to_zval(model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else {
add_next_index_zval(array, val);
do {
if (node && node->children && node->children->content) {
- if (model->u.element->fixed && strcmp(model->u.element->fixed,node->children->content) != 0) {
+ if (model->u.element->fixed && strcmp(model->u.element->fixed, (char*)node->children->content) != 0) {
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) {
- xmlNodePtr dummy = xmlNewNode(NULL, "BOGUS");
- xmlNodeSetContent(dummy, model->u.element->fixed);
+ xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlNodeSetContent(dummy, BAD_CAST(model->u.element->fixed));
val = master_to_zval(model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else if (model->u.element->def && !model->u.element->nillable) {
- xmlNodePtr dummy = xmlNewNode(NULL, "BOGUS");
- xmlNodeSetContent(dummy, model->u.element->def);
+ xmlNodePtr dummy = xmlNewNode(NULL, BAD_CAST("BOGUS"));
+ xmlNodeSetContent(dummy, BAD_CAST(model->u.element->def));
val = master_to_zval(model->u.element->encode, dummy);
xmlFreeNode(dummy);
} else {
while (zend_hash_get_current_data_ex(sdlType->attributes, (void**)&attr, &pos) == SUCCESS) {
if ((*attr)->name) {
xmlAttrPtr val = get_attribute(data->properties, (*attr)->name);
- xmlChar *str_val = NULL;
+ char *str_val = NULL;
if (val && val->children && val->children->content) {
- str_val = val->children->content;
- if ((*attr)->fixed && strcmp((*attr)->fixed,str_val) != 0) {
+ str_val = (char*)val->children->content;
+ if ((*attr)->fixed && strcmp((*attr)->fixed, str_val) != 0) {
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) {
zend_hash_internal_pointer_reset(ht);
while (zend_hash_get_current_data(ht,(void**)&val) == SUCCESS) {
if (Z_TYPE_PP(val) == IS_NULL && model->u.element->nillable) {
- property = xmlNewNode(NULL,"BOGUS");
+ property = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(node, property);
set_xsi_nil(property);
} else {
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) {
+ model->u.element->fixed && strcmp(model->u.element->fixed, (char*)property->children->content) != 0) {
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);
+ xmlNodeSetName(property, BAD_CAST(model->u.element->name));
if (style == SOAP_LITERAL &&
model->u.element->namens &&
model->u.element->form == XSD_FORM_QUALIFIED) {
}
} else {
if (Z_TYPE_P(data) == IS_NULL && model->u.element->nillable) {
- property = xmlNewNode(NULL,"BOGUS");
+ property = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(node, property);
set_xsi_nil(property);
} else {
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) {
+ model->u.element->fixed && strcmp(model->u.element->fixed, (char*)property->children->content) != 0) {
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);
+ xmlNodeSetName(property, BAD_CAST(model->u.element->name));
if (style == SOAP_LITERAL &&
model->u.element->namens &&
model->u.element->form == XSD_FORM_QUALIFIED) {
}
return 1;
} else if (strict && model->u.element->nillable && model->min_occurs > 0) {
- property = xmlNewNode(NULL,model->u.element->name);
+ property = xmlNewNode(NULL, BAD_CAST(model->u.element->name));
xmlAddChild(node, property);
set_xsi_nil(property);
if (style == SOAP_LITERAL &&
TSRMLS_FETCH();
if (!data || Z_TYPE_P(data) == IS_NULL) {
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
if (style == SOAP_ENCODED) {
set_xsi_nil(xmlParam);
} else if (prop == NULL) {
xmlParam = master_to_xml(enc, data, style, parent);
} else {
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
}
} else {
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
}
} else if (sdlType->kind == XSD_TYPEKIND_EXTENSION &&
} else if (prop == NULL) {
xmlParam = master_to_xml(sdlType->encode, data, style, parent);
} else {
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
}
}
} else {
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
}
while (zend_hash_get_current_data(prop,(void**)&val) == SUCCESS) {
xmlNodePtr property;
if (Z_TYPE_PP(val) == IS_NULL && array_el->nillable) {
- property = xmlNewNode(NULL,"BOGUS");
+ property = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(xmlParam, property);
set_xsi_nil(property);
} else {
property = master_to_xml(array_el->encode, *val, style, xmlParam);
}
- xmlNodeSetName(property, array_el->name);
+ xmlNodeSetName(property, BAD_CAST(array_el->name));
if (style == SOAP_LITERAL &&
array_el->namens &&
array_el->form == XSD_FORM_QUALIFIED) {
dummy = master_to_xml((*attr)->encode, zattr, SOAP_LITERAL, xmlParam);
if (dummy->children && dummy->children->content) {
- if ((*attr)->fixed && strcmp((*attr)->fixed,dummy->children->content) != 0) {
+ if ((*attr)->fixed && strcmp((*attr)->fixed, (char*)dummy->children->content) != 0) {
soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", (*attr)->name, (*attr)->fixed, dummy->children->content);
}
/* we need to handle xml: namespace specially, since it is
(*attr)->form == XSD_FORM_QUALIFIED)) {
xmlNsPtr nsp = encode_add_ns(xmlParam, (*attr)->namens);
- xmlSetNsProp(xmlParam, nsp, (*attr)->name, dummy->children->content);
+ xmlSetNsProp(xmlParam, nsp, BAD_CAST((*attr)->name), dummy->children->content);
} else {
- xmlSetProp(xmlParam, (*attr)->name, dummy->children->content);
+ xmlSetProp(xmlParam, BAD_CAST((*attr)->name), dummy->children->content);
}
}
xmlUnlinkNode(dummy);
set_ns_and_type(xmlParam, type);
}
} else {
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
if (prop != NULL) {
prop_name = str_key;
}
if (prop_name) {
- xmlNodeSetName(property, prop_name);
+ xmlNodeSetName(property, BAD_CAST(prop_name));
}
}
zend_hash_move_forward(prop);
xparam = master_to_xml(enc, (*zdata), style, xmlParam);
}
} else {
- xparam = xmlNewNode(NULL,"BOGUS");
+ xparam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(xmlParam, xparam);
}
if (type) {
- xmlNodeSetName(xparam, type->name);
+ xmlNodeSetName(xparam, BAD_CAST(type->name));
} else if (style == SOAP_LITERAL && enc && enc->details.type_str) {
- xmlNodeSetName(xparam, enc->details.type_str);
+ xmlNodeSetName(xparam, BAD_CAST(enc->details.type_str));
xmlSetNs(xparam, ns);
} else {
- xmlNodeSetName(xparam, "item");
+ xmlNodeSetName(xparam, BAD_CAST("item"));
}
} else {
if (zdata) {
if (dimension == 1) {
xmlNodePtr xparam;
- xparam = xmlNewNode(NULL,"BOGUS");
+ xparam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(xmlParam, xparam);
if (type) {
- xmlNodeSetName(xparam, type->name);
+ xmlNodeSetName(xparam, BAD_CAST(type->name));
} else if (style == SOAP_LITERAL && enc && enc->details.type_str) {
- xmlNodeSetName(xparam, enc->details.type_str);
+ xmlNodeSetName(xparam, BAD_CAST(enc->details.type_str));
xmlSetNs(xparam, ns);
} else {
- xmlNodeSetName(xparam, "item");
+ xmlNodeSetName(xparam, BAD_CAST("item"));
}
} else {
add_xml_array_elements(xmlParam, type, enc, ns, dimension-1, dims+1, NULL, style);
soap_version = SOAP_GLOBAL(soap_version);
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
FIND_ZVAL_NULL(data, xmlParam, style);
xmlNsPtr nsptr;
parse_namespace(attr->children->content, &type, &ns);
- nsptr = xmlSearchNs(attr->doc, attr->parent, ns);
+ nsptr = xmlSearchNs(attr->doc, attr->parent, BAD_CAST(ns));
end = strrchr(type,'[');
if (end) {
dims = get_position(dimension, end+1);
}
if (nsptr != NULL) {
- enc = get_encoder(SOAP_GLOBAL(sdl), nsptr->href, type);
+ enc = get_encoder(SOAP_GLOBAL(sdl), (char*)nsptr->href, type);
}
efree(type);
if (ns) {efree(ns);}
xmlNsPtr nsptr;
parse_namespace(attr->children->content, &type, &ns);
- nsptr = xmlSearchNs(attr->doc, attr->parent, ns);
+ nsptr = xmlSearchNs(attr->doc, attr->parent, BAD_CAST(ns));
if (nsptr != NULL) {
- enc = get_encoder(SOAP_GLOBAL(sdl), nsptr->href, type);
+ enc = get_encoder(SOAP_GLOBAL(sdl), (char*)nsptr->href, type);
}
efree(type);
if (ns) {efree(ns);}
if ((attr = get_attribute(data->properties,"arraySize")) &&
attr->children && attr->children->content) {
- dimension = calc_dimension_12(attr->children->content);
- dims = get_position_12(dimension, attr->children->content);
+ dimension = calc_dimension_12((char*)attr->children->content);
+ dims = get_position_12(dimension, (char*)attr->children->content);
} else {
dims = emalloc(sizeof(int));
*dims = 0;
} else if ((attr = get_attribute(data->properties,"arraySize")) &&
attr->children && attr->children->content) {
- dimension = calc_dimension_12(attr->children->content);
- dims = get_position_12(dimension, attr->children->content);
+ dimension = calc_dimension_12((char*)attr->children->content);
+ dims = get_position_12(dimension, (char*)attr->children->content);
} else if (type->sdl_type != NULL &&
type->sdl_type->attributes != NULL &&
if (data &&
(attr = get_attribute(data->properties,"offset")) &&
attr->children && attr->children->content) {
- char* tmp = strrchr(attr->children->content,'[');
+ char* tmp = strrchr((char*)attr->children->content,'[');
if (tmp == NULL) {
- tmp = attr->children->content;
+ tmp = (char*)attr->children->content;
}
get_position_ex(dimension, tmp, &pos);
}
tmpVal = master_to_zval(enc, trav);
if (position != NULL && position->children && position->children->content) {
- char* tmp = strrchr(position->children->content,'[');
+ char* tmp = strrchr((char*)position->children->content, '[');
if (tmp == NULL) {
- tmp = position->children->content;
+ tmp = (char*)position->children->content;
}
get_position_ex(dimension, tmp, &pos);
}
xmlNodePtr xmlParam;
int i;
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
FIND_ZVAL_NULL(data, xmlParam, style);
zend_hash_get_current_data(data->value.ht, (void **)&temp_data);
if (Z_TYPE_PP(temp_data) != IS_NULL) {
- item = xmlNewNode(NULL,"item");
+ item = xmlNewNode(NULL, BAD_CAST("item"));
xmlAddChild(xmlParam, item);
- key = xmlNewNode(NULL,"key");
+ key = xmlNewNode(NULL, BAD_CAST("key"));
xmlAddChild(item,key);
if (zend_hash_get_current_key(data->value.ht, &key_val, (long *)&int_val, FALSE) == HASH_KEY_IS_STRING) {
if (style == SOAP_ENCODED) {
set_xsi_type(key, "xsd:string");
}
- xmlNodeSetContent(key, key_val);
+ xmlNodeSetContent(key, BAD_CAST(key_val));
} else {
smart_str tmp = {0};
smart_str_append_long(&tmp, int_val);
if (style == SOAP_ENCODED) {
set_xsi_type(key, "xsd:int");
}
- xmlNodeSetContentLen(key, tmp.c, tmp.len);
+ xmlNodeSetContentLen(key, BAD_CAST(tmp.c), tmp.len);
smart_str_free(&tmp);
}
xparam = master_to_xml(get_conversion((*temp_data)->type), (*temp_data), style, item);
- xmlNodeSetName(xparam, "value");
+ xmlNodeSetName(xparam, BAD_CAST("value"));
}
zend_hash_move_forward(data->value.ht);
}
{
encodePtr enc = NULL;
xmlAttrPtr tmpattr;
- char *type_name = NULL;
+ xmlChar *type_name = NULL;
zval *ret;
TSRMLS_FETCH();
#endif
add_property_zval(soapvar, "enc_value", ret);
parse_namespace(type_name, &cptype, &ns);
- nsptr = xmlSearchNs(data->doc, data, ns);
+ nsptr = xmlSearchNs(data->doc, data, BAD_CAST(ns));
add_property_string(soapvar, "enc_stype", cptype, 1);
if (nsptr) {
add_property_string(soapvar, "enc_ns", (char*)nsptr->href, 1);
xmlNodePtr xmlParam;
- xmlParam = xmlNewNode(NULL,"BOGUS");
+ xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, xmlParam);
FIND_ZVAL_NULL(data, xmlParam, style);
}
strcat(buf, tzbuf);
- xmlNodeSetContent(xmlParam, buf);
+ xmlNodeSetContent(xmlParam, BAD_CAST(buf));
efree(buf);
} else if (Z_TYPE_P(data) == IS_STRING) {
- xmlNodeSetContentLen(xmlParam, Z_STRVAL_P(data), Z_STRLEN_P(data));
+ xmlNodeSetContentLen(xmlParam, BAD_CAST(Z_STRVAL_P(data)), Z_STRLEN_P(data));
}
if (style == SOAP_ENCODED) {
}
}
- ret = xmlNewNode(NULL,"BOGUS");
+ ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
if (Z_TYPE_P(data) == IS_ARRAY) {
if (list.len != 0) {
smart_str_appendc(&list, ' ');
}
- smart_str_appends(&list, dummy->children->content);
+ smart_str_appends(&list, (char*)dummy->children->content);
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
zend_hash_move_forward(ht);
}
smart_str_0(&list);
- xmlNodeSetContentLen(ret, list.c, list.len);
+ xmlNodeSetContentLen(ret, BAD_CAST(list.c), list.len);
smart_str_free(&list);
} else {
zval tmp = *data;
data = &tmp;
}
str = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data));
- whiteSpace_collapse(str);
+ whiteSpace_collapse(BAD_CAST(str));
start = str;
while (start != NULL && *start != '\0') {
xmlNodePtr dummy;
if (list.len != 0) {
smart_str_appendc(&list, ' ');
}
- smart_str_appends(&list, dummy->children->content);
+ smart_str_appends(&list, (char*)dummy->children->content);
} else {
soap_error0(E_ERROR, "Encoding: Violation of encoding rules");
}
start = next;
}
smart_str_0(&list);
- xmlNodeSetContentLen(ret, list.c, list.len);
+ xmlNodeSetContentLen(ret, BAD_CAST(list.c), list.len);
smart_str_free(&list);
efree(str);
if (data == &tmp) {zval_dtor(&tmp);}
xmlNodePtr ret;
if (Z_TYPE_P(data) == IS_STRING) {
- ret = xmlNewTextLen(Z_STRVAL_P(data), Z_STRLEN_P(data));
+ ret = xmlNewTextLen(BAD_CAST(Z_STRVAL_P(data)), Z_STRLEN_P(data));
} else {
zval tmp = *data;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
- ret = xmlNewTextLen(Z_STRVAL(tmp), Z_STRLEN(tmp));
+ ret = xmlNewTextLen(BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp));
zval_dtor(&tmp);
}
ret->name = xmlStringTextNoenc;
if (href) {
/* Internal href try and find node */
if (href->children->content[0] == '#') {
- xmlNodePtr ret = get_node_with_attribute_recursive(data->doc->children, NULL, "id", &href->children->content[1]);
+ xmlNodePtr ret = get_node_with_attribute_recursive(data->doc->children, NULL, "id", (char*)&href->children->content[1]);
if (!ret) {
soap_error1(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content);
}
/* SOAP 1.2 enc:id enc:ref */
href = get_attribute_ex(data->properties, "ref", SOAP_1_2_ENC_NAMESPACE);
if (href) {
- char* id;
+ xmlChar* id;
xmlNodePtr ret;
if (href->children->content[0] == '#') {
} else {
id = href->children->content;
}
- ret = get_node_with_attribute_recursive_ex(data->doc->children, NULL, NULL, "id", id, SOAP_1_2_ENC_NAMESPACE);
+ ret = get_node_with_attribute_recursive_ex(data->doc->children, NULL, NULL, "id", (char*)id, SOAP_1_2_ENC_NAMESPACE);
if (!ret) {
soap_error1(E_ERROR, "Encoding: Unresolved reference '%s'", href->children->content);
} else if (ret == data) {
return NULL;
}
- xmlns = xmlSearchNsByHref(node->doc,node,ns);
+ xmlns = xmlSearchNsByHref(node->doc, node, BAD_CAST(ns));
if (xmlns == NULL) {
- char* prefix;
+ xmlChar* prefix;
TSRMLS_FETCH();
if (zend_hash_find(&SOAP_GLOBAL(defEncNs), (char*)ns, strlen(ns) + 1, (void **)&prefix) == SUCCESS) {
- xmlns = xmlNewNs(node->doc->children,ns,prefix);
+ xmlns = xmlNewNs(node->doc->children, BAD_CAST(ns), prefix);
} else {
smart_str prefix = {0};
int num = ++SOAP_GLOBAL(cur_uniq_ns);
smart_str_appendl(&prefix, "ns", 2);
smart_str_append_long(&prefix, num);
smart_str_0(&prefix);
- xmlns = xmlNewNs(node->doc->children,ns,prefix.c);
+ xmlns = xmlNewNs(node->doc->children, BAD_CAST(ns), BAD_CAST(prefix.c));
smart_str_free(&prefix);
}
}
static void set_ns_prop(xmlNodePtr node, char *ns, char *name, char *val)
{
- xmlSetNsProp(node, encode_add_ns(node, ns), name, val);
+ xmlSetNsProp(node, encode_add_ns(node, ns), BAD_CAST(name), BAD_CAST(val));
}
static void set_xsi_nil(xmlNodePtr node)
if (cur_ns) {
xmlNsPtr ns = encode_add_ns(node,cur_ns);
- smart_str_appends(type, ns->prefix);
+ smart_str_appends(type, (char*)ns->prefix);
smart_str_appendc(type, ':');
smart_str_appends(&array_type, cur_ns);
smart_str_appendc(&array_type, ':');
ns = SOAP_1_1_ENC_NAMESPACE;
}
xmlns = encode_add_ns(node,ns);
- smart_str_appends(ret, xmlns->prefix);
+ smart_str_appends(ret, (char*)xmlns->prefix);
smart_str_appendc(ret, ':');
}
smart_str_appendl(ret, type, strlen(type));
zval *to_zval_after_user(encodeTypePtr type, zval *data);
#endif
-void whiteSpace_replace(char* str);
-void whiteSpace_collapse(char* str);
+void whiteSpace_replace(xmlChar* str);
+void whiteSpace_collapse(xmlChar* str);
xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval* data, int style, xmlNodePtr parent);
zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data);
zval **login, **password;
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_login", sizeof("_proxy_login"), (void **)&login) == SUCCESS) {
- char* buf;
+ unsigned char* buf;
int len;
smart_str auth = {0};
smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password));
}
smart_str_0(&auth);
- buf = php_base64_encode(auth.c, auth.len, &len);
+ buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len);
smart_str_append_const(soap_headers, "Proxy-Authorization: Basic ");
- smart_str_appendl(soap_headers, buf, len);
+ smart_str_appendl(soap_headers, (char*)buf, len);
smart_str_append_const(soap_headers, "\r\n");
efree(buf);
smart_str_free(&auth);
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_login", sizeof("_login"), (void **)&login) == SUCCESS &&
!zend_hash_exists(Z_OBJPROP_P(this_ptr), "_digest", sizeof("_digest"))) {
- char* buf;
+ unsigned char* buf;
int len;
smart_str auth = {0};
smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password));
}
smart_str_0(&auth);
- buf = php_base64_encode(auth.c, auth.len, &len);
+ buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len);
smart_str_append_const(soap_headers, "Authorization: Basic ");
- smart_str_appendl(soap_headers, buf, len);
+ smart_str_appendl(soap_headers, (char*)buf, len);
smart_str_append_const(soap_headers, "\r\n");
efree(buf);
smart_str_free(&auth);
PHP_MD5Init(&md5ctx);
sprintf(cnonce, "%d", rand());
- PHP_MD5Update(&md5ctx, cnonce, strlen(cnonce));
+ PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, strlen(cnonce));
PHP_MD5Final(hash, &md5ctx);
make_digest(cnonce, hash);
}
PHP_MD5Init(&md5ctx);
- PHP_MD5Update(&md5ctx, Z_STRVAL_PP(login), Z_STRLEN_PP(login));
- PHP_MD5Update(&md5ctx, ":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(login), Z_STRLEN_PP(login));
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
if (zend_hash_find(Z_ARRVAL_PP(digest), "realm", sizeof("realm"), (void **)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_STRING) {
- PHP_MD5Update(&md5ctx, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
}
- PHP_MD5Update(&md5ctx, ":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_password", sizeof("_password"), (void **)&password) == SUCCESS &&
Z_TYPE_PP(password) == IS_STRING) {
- PHP_MD5Update(&md5ctx, Z_STRVAL_PP(password), Z_STRLEN_PP(password));
+ PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(password), Z_STRLEN_PP(password));
}
PHP_MD5Final(hash, &md5ctx);
make_digest(HA1, hash);
Z_STRLEN_PP(tmp) == sizeof("md5-sess")-1 &&
stricmp(Z_STRVAL_PP(tmp), "md5-sess") == 0) {
PHP_MD5Init(&md5ctx);
- PHP_MD5Update(&md5ctx, HA1, 32);
- PHP_MD5Update(&md5ctx, ":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)HA1, 32);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
if (zend_hash_find(Z_ARRVAL_PP(digest), "nonce", sizeof("nonce"), (void **)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_STRING) {
- PHP_MD5Update(&md5ctx, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
}
- PHP_MD5Update(&md5ctx, ":", 1);
- PHP_MD5Update(&md5ctx, cnonce, 8);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, 8);
PHP_MD5Final(hash, &md5ctx);
make_digest(HA1, hash);
}
PHP_MD5Init(&md5ctx);
- PHP_MD5Update(&md5ctx, "POST:", sizeof("POST:")-1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)"POST:", sizeof("POST:")-1);
if (phpurl->path) {
- PHP_MD5Update(&md5ctx, phpurl->path, strlen(phpurl->path));
+ PHP_MD5Update(&md5ctx, (unsigned char*)phpurl->path, strlen(phpurl->path));
}
if (phpurl->query) {
- PHP_MD5Update(&md5ctx, "?", 1);
- PHP_MD5Update(&md5ctx, phpurl->query, strlen(phpurl->query));
+ PHP_MD5Update(&md5ctx, (unsigned char*)"?", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)phpurl->query, strlen(phpurl->query));
}
/* TODO: Support for qop="auth-int" */
make_digest(HA2, hash);
PHP_MD5Init(&md5ctx);
- PHP_MD5Update(&md5ctx, HA1, 32);
- PHP_MD5Update(&md5ctx, ":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)HA1, 32);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
if (zend_hash_find(Z_ARRVAL_PP(digest), "nonce", sizeof("nonce"), (void **)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_STRING) {
- PHP_MD5Update(&md5ctx, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
+ PHP_MD5Update(&md5ctx, (unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
}
- PHP_MD5Update(&md5ctx, ":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
if (zend_hash_find(Z_ARRVAL_PP(digest), "qop", sizeof("qop"), (void **)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_STRING) {
- PHP_MD5Update(&md5ctx, nc, 8);
- PHP_MD5Update(&md5ctx, ":", 1);
- PHP_MD5Update(&md5ctx, cnonce, 8);
- PHP_MD5Update(&md5ctx, ":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)nc, 8);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)cnonce, 8);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
/* TODO: Support for qop="auth-int" */
- PHP_MD5Update(&md5ctx, "auth", sizeof("auth")-1);
- PHP_MD5Update(&md5ctx, ":", 1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)"auth", sizeof("auth")-1);
+ PHP_MD5Update(&md5ctx, (unsigned char*)":", 1);
}
- PHP_MD5Update(&md5ctx, HA2, 32);
+ PHP_MD5Update(&md5ctx, (unsigned char*)HA2, 32);
PHP_MD5Final(hash, &md5ctx);
make_digest(response, hash);
smart_str_append_const(&soap_headers, "\"\r\n");
}
} else {
- char* buf;
+ unsigned char* buf;
int len;
smart_str auth = {0};
smart_str_appendl(&auth, Z_STRVAL_PP(password), Z_STRLEN_PP(password));
}
smart_str_0(&auth);
- buf = php_base64_encode(auth.c, auth.len, &len);
+ buf = php_base64_encode((unsigned char*)auth.c, auth.len, &len);
smart_str_append_const(&soap_headers, "Authorization: Basic ");
- smart_str_appendl(&soap_headers, buf, len);
+ smart_str_appendl(&soap_headers, (char*)buf, len);
smart_str_append_const(&soap_headers, "\r\n");
efree(buf);
smart_str_free(&auth);
add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL TSRMLS_CC);
xmlFreeDoc(response);
return FALSE;
- } else if (strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
+ } else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC);
xmlFreeDoc(response);
return FALSE;
add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Body", NULL, NULL TSRMLS_CC);
xmlFreeDoc(response);
return FALSE;
- } else if (strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
+ } else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC);
xmlFreeDoc(response);
return FALSE;
add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Header", NULL, NULL TSRMLS_CC);
xmlFreeDoc(response);
return FALSE;
- } else if (strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
+ } else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL TSRMLS_CC);
xmlFreeDoc(response);
return FALSE;
xmlNodePtr tmp;
if (soap_version == SOAP_1_1) {
- tmp = get_node(fault->children,"faultcode");
+ tmp = get_node(fault->children, "faultcode");
if (tmp != NULL && tmp->children != NULL) {
- faultcode = tmp->children->content;
+ faultcode = (char*)tmp->children->content;
}
- tmp = get_node(fault->children,"faultstring");
+ tmp = get_node(fault->children, "faultstring");
if (tmp != NULL && tmp->children != NULL) {
zval *zv = master_to_zval(get_conversion(IS_STRING), tmp);
faultstring = Z_STRVAL_P(zv);
FREE_ZVAL(zv);
}
- tmp = get_node(fault->children,"faultactor");
+ tmp = get_node(fault->children, "faultactor");
if (tmp != NULL && tmp->children != NULL) {
zval *zv = master_to_zval(get_conversion(IS_STRING), tmp);
faultactor = Z_STRVAL_P(zv);
FREE_ZVAL(zv);
}
- tmp = get_node(fault->children,"detail");
+ tmp = get_node(fault->children, "detail");
if (tmp != NULL) {
details = master_to_zval(NULL, tmp);
}
} else {
- tmp = get_node(fault->children,"Code");
+ tmp = get_node(fault->children, "Code");
if (tmp != NULL && tmp->children != NULL) {
- tmp = get_node(tmp->children,"Value");
+ tmp = get_node(tmp->children, "Value");
if (tmp != NULL && tmp->children != NULL) {
- faultcode = tmp->children->content;
+ faultcode = (char*)tmp->children->content;
}
}
sdlSoapBindingFunctionHeaderPtr *hdr;
if (trav->ns) {
- smart_str_appends(&key,trav->ns->href);
+ smart_str_appends(&key, (char*)trav->ns->href);
smart_str_appendc(&key,':');
}
- smart_str_appends(&key,trav->name);
+ smart_str_appends(&key, (char*)trav->name);
smart_str_0(&key);
if (zend_hash_find(hdrs, key.c, key.len+1, (void**)&hdr) == SUCCESS) {
enc = (*hdr)->encode;
static void schema_type_fixup(sdlCtx *ctx, sdlTypePtr type);
-static encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type)
+static encodePtr create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const xmlChar *ns, const xmlChar *type)
{
smart_str nscat = {0};
encodePtr enc, *enc_ptr;
sdl->encoders = emalloc(sizeof(HashTable));
zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, 0);
}
- smart_str_appends(&nscat, ns);
+ smart_str_appends(&nscat, (char*)ns);
smart_str_appendc(&nscat, ':');
- smart_str_appends(&nscat, type);
+ smart_str_appends(&nscat, (char*)type);
smart_str_0(&nscat);
if (zend_hash_find(sdl->encoders, nscat.c, nscat.len + 1, (void**)&enc_ptr) == SUCCESS) {
enc = *enc_ptr;
}
memset(enc, 0, sizeof(encode));
- enc->details.ns = estrdup(ns);
- enc->details.type_str = estrdup(type);
+ enc->details.ns = estrdup((char*)ns);
+ enc->details.type_str = estrdup((char*)type);
enc->details.sdl_type = cur_type;
enc->to_xml = sdl_guess_convert_xml;
enc->to_zval = sdl_guess_convert_zval;
return enc;
}
-static encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char *ns, const char *type)
+static encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const xmlChar *ns, const xmlChar *type)
{
- encodePtr enc = get_encoder(sdl, ns, type);
+ encodePtr enc = get_encoder(sdl, (char*)ns, (char*)type);
if (enc == NULL) {
enc = create_encoder(sdl, cur_type, ns, type);
}
static void schema_load_file(sdlCtx *ctx, xmlAttrPtr ns, xmlChar *location, xmlAttrPtr tns, int import TSRMLS_DC) {
if (location != NULL &&
- !zend_hash_exists(&ctx->docs, location, strlen(location)+1)) {
+ !zend_hash_exists(&ctx->docs, (char*)location, xmlStrlen(location)+1)) {
xmlDocPtr doc;
xmlNodePtr schema;
xmlAttrPtr new_tns;
- doc = soap_xmlParseFile(location TSRMLS_CC);
+ doc = soap_xmlParseFile((char*)location TSRMLS_CC);
if (doc == NULL) {
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)) {
+ if (ns != NULL && (new_tns == NULL || xmlStrcmp(ns->children->content, new_tns->children->content) != 0)) {
xmlFreeDoc(doc);
soap_error2(E_ERROR, "Parsing Schema: can't import schema from '%s', unexpected 'targetNamespace'='%s'", location, ns->children->content);
}
new_tns = get_attribute(schema->properties, "targetNamespace");
if (new_tns == NULL) {
if (tns != NULL) {
- xmlSetProp(schema, "targetNamespace", tns->children->content);
+ xmlSetProp(schema, BAD_CAST("targetNamespace"), tns->children->content);
}
- } else if (tns != NULL && strcmp(tns->children->content,new_tns->children->content) != 0) {
+ } else if (tns != NULL && xmlStrcmp(tns->children->content, new_tns->children->content) != 0) {
xmlFreeDoc(doc);
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);
+ zend_hash_add(&ctx->docs, (char*)location, xmlStrlen(location)+1, (void**)&doc, sizeof(xmlDocPtr), NULL);
load_schema(ctx, schema TSRMLS_CC);
}
}
tns = get_attribute(schema->properties, "targetNamespace");
if (tns == NULL) {
- tns = xmlSetProp(schema, "targetNamespace", "");
- xmlNewNs(schema, "", NULL);
+ tns = xmlSetProp(schema, BAD_CAST("targetNamespace"), BAD_CAST(""));
+ xmlNewNs(schema, BAD_CAST(""), NULL);
}
trav = schema->children;
ns = get_attribute(trav->properties, "namespace");
location = get_attribute(trav->properties, "schemaLocation");
- if (ns != NULL && tns != NULL && strcmp(ns->children->content,tns->children->content) == 0) {
+ if (ns != NULL && tns != NULL && xmlStrcmp(ns->children->content, tns->children->content) == 0) {
if (location) {
soap_error1(E_ERROR, "Parsing Schema: can't import schema from '%s', namespace must not match the enclosing schema 'targetNamespace'", location->children->content);
} else {
memset(newType, 0, sizeof(sdlType));
newType->kind = XSD_TYPEKIND_SIMPLE;
if (name != NULL) {
- newType->name = estrdup(name->children->content);
- newType->namens = estrdup(ns->children->content);
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
} else {
newType->name = estrdup(cur_type->name);
newType->namens = estrdup(cur_type->namens);
newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
newType->kind = XSD_TYPEKIND_SIMPLE;
- newType->name = estrdup(name->children->content);
- newType->namens = estrdup(ns->children->content);
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
if (cur_type == NULL) {
zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr);
xmlNsPtr nsptr;
parse_namespace(itemType->children->content, &type, &ns);
- nsptr = xmlSearchNs(listType->doc, listType, ns);
+ nsptr = xmlSearchNs(listType->doc, listType, BAD_CAST(ns));
if (nsptr != NULL) {
sdlTypePtr newType, *tmp;
memset(newType, 0, sizeof(sdlType));
newType->name = estrdup(type);
- newType->namens = estrdup(nsptr->href);
+ newType->namens = estrdup((char*)nsptr->href);
- newType->encode = get_create_encoder(sdl, newType, (char *)nsptr->href, type);
+ newType->encode = get_create_encoder(sdl, newType, nsptr->href, BAD_CAST(type));
if (cur_type->elements == NULL) {
cur_type->elements = emalloc(sizeof(HashTable));
memset(newType, 0, sizeof(sdlType));
newType->name = estrdup("anonymous");
- newType->namens = estrdup(tns->children->content);
+ newType->namens = estrdup((char*)tns->children->content);
if (cur_type->elements == NULL) {
cur_type->elements = emalloc(sizeof(HashTable));
char *type, *ns;
xmlNsPtr nsptr;
- str = estrdup(memberTypes->children->content);
- whiteSpace_collapse(str);
+ str = estrdup((char*)memberTypes->children->content);
+ whiteSpace_collapse(BAD_CAST(str));
start = str;
while (start != NULL && *start != '\0') {
end = strchr(start,' ');
next = end+1;
}
- parse_namespace(start, &type, &ns);
- nsptr = xmlSearchNs(unionType->doc, unionType, ns);
+ parse_namespace(BAD_CAST(start), &type, &ns);
+ nsptr = xmlSearchNs(unionType->doc, unionType, BAD_CAST(ns));
if (nsptr != NULL) {
sdlTypePtr newType, *tmp;
memset(newType, 0, sizeof(sdlType));
newType->name = estrdup(type);
- newType->namens = estrdup(nsptr->href);
+ newType->namens = estrdup((char*)nsptr->href);
- newType->encode = get_create_encoder(sdl, newType, (char *)nsptr->href, type);
+ newType->encode = get_create_encoder(sdl, newType, nsptr->href, BAD_CAST(type));
if (cur_type->elements == NULL) {
cur_type->elements = emalloc(sizeof(HashTable));
memset(newType, 0, sizeof(sdlType));
newType->name = estrdup("anonymous");
- newType->namens = estrdup(tns->children->content);
+ newType->namens = estrdup((char*)tns->children->content);
if (cur_type->elements == NULL) {
cur_type->elements = emalloc(sizeof(HashTable));
xmlNsPtr nsptr;
parse_namespace(base->children->content, &type, &ns);
- nsptr = xmlSearchNs(restType->doc, restType, ns);
+ nsptr = xmlSearchNs(restType->doc, restType, BAD_CAST(ns));
if (nsptr != NULL) {
- cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, type);
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(type));
}
if (type) {efree(type);}
if (ns) {efree(ns);}
xmlNsPtr nsptr;
parse_namespace(base->children->content, &type, &ns);
- nsptr = xmlSearchNs(restType->doc, restType, ns);
+ nsptr = xmlSearchNs(restType->doc, restType, BAD_CAST(ns));
if (nsptr != NULL) {
- cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, type);
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(type));
}
if (type) {efree(type);}
if (ns) {efree(ns);}
fixed = get_attribute(val->properties, "fixed");
(*valptr)->fixed = FALSE;
if (fixed != NULL) {
- if (!strncmp(fixed->children->content, "true", sizeof("true")) ||
- !strncmp(fixed->children->content, "1", sizeof("1")))
+ if (!strncmp((char*)fixed->children->content, "true", sizeof("true")) ||
+ !strncmp((char*)fixed->children->content, "1", sizeof("1")))
(*valptr)->fixed = TRUE;
}
soap_error0(E_ERROR, "Parsing Schema: missing restriction value");
}
- (*valptr)->value = atoi(value->children->content);
+ (*valptr)->value = atoi((char*)value->children->content);
return TRUE;
}
fixed = get_attribute(val->properties, "fixed");
(*valptr)->fixed = FALSE;
if (fixed != NULL) {
- if (!strncmp(fixed->children->content, "true", sizeof("true")) ||
- !strncmp(fixed->children->content, "1", sizeof("1"))) {
+ if (!strncmp((char*)fixed->children->content, "true", sizeof("true")) ||
+ !strncmp((char*)fixed->children->content, "1", sizeof("1"))) {
(*valptr)->fixed = TRUE;
}
}
soap_error0(E_ERROR, "Parsing Schema: missing restriction value");
}
- (*valptr)->value = estrdup(value->children->content);
+ (*valptr)->value = estrdup((char*)value->children->content);
return TRUE;
}
xmlNsPtr nsptr;
parse_namespace(base->children->content, &type, &ns);
- nsptr = xmlSearchNs(extType->doc, extType, ns);
+ nsptr = xmlSearchNs(extType->doc, extType, BAD_CAST(ns));
if (nsptr != NULL) {
- cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, type);
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(type));
}
if (type) {efree(type);}
if (ns) {efree(ns);}
xmlNsPtr nsptr;
parse_namespace(base->children->content, &type, &ns);
- nsptr = xmlSearchNs(extType->doc, extType, ns);
+ nsptr = xmlSearchNs(extType->doc, extType, BAD_CAST(ns));
if (nsptr != NULL) {
- cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, type);
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(type));
}
if (type) {efree(type);}
if (ns) {efree(ns);}
return TRUE;
}
+void schema_min_max(xmlNodePtr node, sdlContentModelPtr model)
+{
+ xmlAttrPtr attr = get_attribute(node->properties, "minOccurs");
+
+ if (attr) {
+ model->min_occurs = atoi((char*)attr->children->content);
+ } else {
+ model->min_occurs = 1;
+ }
+
+ attr = get_attribute(node->properties, "maxOccurs");
+ if (attr) {
+ if (!strncmp((char*)attr->children->content, "unbounded", sizeof("unbounded"))) {
+ model->max_occurs = -1;
+ } else {
+ model->max_occurs = atoi((char*)attr->children->content);
+ }
+ } else {
+ model->max_occurs = 1;
+ }
+}
+
/*
<all
id = ID
static int schema_all(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr all, sdlTypePtr cur_type, sdlContentModelPtr model)
{
xmlNodePtr trav;
- xmlAttrPtr attr;
sdlContentModelPtr newModel;
newModel = emalloc(sizeof(sdlContentModel));
zend_hash_next_index_insert(model->u.content,&newModel,sizeof(sdlContentModelPtr), NULL);
}
- newModel->min_occurs = 1;
- newModel->max_occurs = 1;
-
- attr = get_attribute(all->properties, "minOccurs");
- if (attr) {
- newModel->min_occurs = atoi(attr->children->content);
- }
-
- attr = get_attribute(all->properties, "maxOccurs");
- if (attr) {
- if (!strncmp(attr->children->content, "unbounded", sizeof("unbounded"))) {
- newModel->max_occurs = -1;
- } else {
- newModel->max_occurs = atoi(attr->children->content);
- }
- }
+ schema_min_max(all, newModel);
trav = all->children;
if (trav != NULL && node_is_equal(trav,"annotation")) {
static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTypePtr cur_type, sdlContentModelPtr model)
{
xmlNodePtr trav;
- xmlAttrPtr attr;
xmlAttrPtr ns, name, ref = NULL;
sdlContentModelPtr newModel;
xmlNsPtr nsptr;
parse_namespace(ref->children->content, &type, &ns);
- nsptr = xmlSearchNs(groupType->doc, groupType, ns);
+ nsptr = xmlSearchNs(groupType->doc, groupType, BAD_CAST(ns));
if (nsptr != NULL) {
- smart_str_appends(&key, nsptr->href);
+ smart_str_appends(&key, (char*)nsptr->href);
smart_str_appendc(&key, ':');
}
smart_str_appends(&key, type);
newModel->u.content = emalloc(sizeof(HashTable));
zend_hash_init(newModel->u.content, 0, NULL, delete_model, 0);
- smart_str_appends(&key, ns->children->content);
+ smart_str_appends(&key, (char*)ns->children->content);
smart_str_appendc(&key, ':');
- smart_str_appends(&key, name->children->content);
+ smart_str_appends(&key, (char*)name->children->content);
smart_str_0(&key);
}
soap_error0(E_ERROR, "Parsing Schema: group has no 'name' nor 'ref' attributes");
}
- newModel->min_occurs = 1;
- newModel->max_occurs = 1;
-
- attr = get_attribute(groupType->properties, "minOccurs");
- if (attr) {
- newModel->min_occurs = atoi(attr->children->content);
- }
-
- attr = get_attribute(groupType->properties, "maxOccurs");
- if (attr) {
- if (!strncmp(attr->children->content, "unbounded", sizeof("unbounded"))) {
- newModel->max_occurs = -1;
- } else {
- newModel->max_occurs = atoi(attr->children->content);
- }
- }
+ schema_min_max(groupType, newModel);
trav = groupType->children;
if (trav != NULL && node_is_equal(trav,"annotation")) {
static int schema_choice(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr choiceType, sdlTypePtr cur_type, sdlContentModelPtr model)
{
xmlNodePtr trav;
- xmlAttrPtr attr;
sdlContentModelPtr newModel;
newModel = emalloc(sizeof(sdlContentModel));
zend_hash_next_index_insert(model->u.content,&newModel,sizeof(sdlContentModelPtr), NULL);
}
- newModel->min_occurs = 1;
- newModel->max_occurs = 1;
-
- attr = get_attribute(choiceType->properties, "minOccurs");
- if (attr) {
- newModel->min_occurs = atoi(attr->children->content);
- }
-
- attr = get_attribute(choiceType->properties, "maxOccurs");
- if (attr) {
- if (!strncmp(attr->children->content, "unbounded", sizeof("unbounded"))) {
- newModel->max_occurs = -1;
- } else {
- newModel->max_occurs = atoi(attr->children->content);
- }
- }
+ schema_min_max(choiceType, newModel);
trav = choiceType->children;
if (trav != NULL && node_is_equal(trav,"annotation")) {
static int schema_sequence(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr seqType, sdlTypePtr cur_type, sdlContentModelPtr model)
{
xmlNodePtr trav;
- xmlAttrPtr attr;
sdlContentModelPtr newModel;
newModel = emalloc(sizeof(sdlContentModel));
zend_hash_next_index_insert(model->u.content,&newModel,sizeof(sdlContentModelPtr), NULL);
}
- newModel->min_occurs = 1;
- newModel->max_occurs = 1;
-
- attr = get_attribute(seqType->properties, "minOccurs");
- if (attr) {
- newModel->min_occurs = atoi(attr->children->content);
- }
-
- attr = get_attribute(seqType->properties, "maxOccurs");
- if (attr) {
- if (!strncmp(attr->children->content, "unbounded", sizeof("unbounded"))) {
- newModel->max_occurs = -1;
- } else {
- newModel->max_occurs = atoi(attr->children->content);
- }
- }
+ schema_min_max(seqType, newModel);
trav = seqType->children;
if (trav != NULL && node_is_equal(trav,"annotation")) {
{
if (model != NULL) {
sdlContentModelPtr newModel;
- xmlAttrPtr attr;
newModel = emalloc(sizeof(sdlContentModel));
newModel->kind = XSD_CONTENT_ANY;
- newModel->min_occurs = 1;
- newModel->max_occurs = 1;
- attr = get_attribute(anyType->properties, "minOccurs");
- if (attr) {
- newModel->min_occurs = atoi(attr->children->content);
- }
-
- attr = get_attribute(anyType->properties, "maxOccurs");
- if (attr) {
- if (!strncmp(attr->children->content, "unbounded", sizeof("unbounded"))) {
- newModel->max_occurs = -1;
- } else {
- newModel->max_occurs = atoi(attr->children->content);
- }
- }
+ schema_min_max(anyType, newModel);
zend_hash_next_index_insert(model->u.content, &newModel, sizeof(sdlContentModelPtr), NULL);
}
memset(newType, 0, sizeof(sdlType));
newType->kind = XSD_TYPEKIND_COMPLEX;
if (name != NULL) {
- newType->name = estrdup(name->children->content);
- newType->namens = estrdup(ns->children->content);
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
} else {
newType->name = estrdup(cur_type->name);
newType->namens = estrdup(cur_type->namens);
newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
newType->kind = XSD_TYPEKIND_COMPLEX;
- newType->name = estrdup(name->children->content);
- newType->namens = estrdup(ns->children->content);
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
zend_hash_next_index_insert(sdl->types, &newType, sizeof(sdlTypePtr), (void **)&ptr);
xmlNsPtr nsptr;
parse_namespace(ref->children->content, &type, &ns);
- nsptr = xmlSearchNs(element->doc, element, ns);
+ nsptr = xmlSearchNs(element->doc, element, BAD_CAST(ns));
if (nsptr != NULL) {
- smart_str_appends(&nscat, nsptr->href);
+ smart_str_appends(&nscat, (char*)nsptr->href);
smart_str_appendc(&nscat, ':');
- newType->namens = estrdup(nsptr->href);
+ newType->namens = estrdup((char*)nsptr->href);
}
smart_str_appends(&nscat, type);
newType->name = estrdup(type);
newType->ref = estrdup(nscat.c);
smart_str_free(&nscat);
} else {
- newType->name = estrdup(name->children->content);
- newType->namens = estrdup(ns->children->content);
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
}
newType->nillable = FALSE;
newModel->kind = XSD_CONTENT_ELEMENT;
newModel->u.element = newType;
- newModel->min_occurs = 1;
- newModel->max_occurs = 1;
- attr = get_attribute(attrs, "maxOccurs");
- if (attr) {
- if (!strncmp(attr->children->content, "unbounded", sizeof("unbounded"))) {
- newModel->max_occurs = -1;
- } else {
- newModel->max_occurs = atoi(attr->children->content);
- }
- }
+ schema_min_max(element, newModel);
- attr = get_attribute(attrs, "minOccurs");
- if (attr) {
- newModel->min_occurs = atoi(attr->children->content);
- }
zend_hash_next_index_insert(model->u.content, &newModel, sizeof(sdlContentModelPtr), NULL);
}
if (ref != NULL) {
soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'nillable' attributes");
}
- if (!stricmp(attr->children->content, "true") ||
- !stricmp(attr->children->content, "1")) {
+ if (!stricmp((char*)attr->children->content, "true") ||
+ !stricmp((char*)attr->children->content, "1")) {
cur_type->nillable = TRUE;
} else {
cur_type->nillable = FALSE;
if (ref != NULL) {
soap_error0(E_ERROR, "Parsing Schema: element has both 'ref' and 'fixed' attributes");
}
- cur_type->fixed = estrdup(attr->children->content);
+ cur_type->fixed = estrdup((char*)attr->children->content);
}
attr = get_attribute(attrs, "default");
} else if (ref != NULL) {
soap_error0(E_ERROR, "Parsing Schema: element has both 'default' and 'fixed' attributes");
}
- cur_type->def = estrdup(attr->children->content);
+ cur_type->def = estrdup((char*)attr->children->content);
}
/* form */
attr = get_attribute(attrs, "form");
if (attr) {
- if (strncmp(attr->children->content,"qualified",sizeof("qualified")) == 0) {
+ if (strncmp((char*)attr->children->content, "qualified", sizeof("qualified")) == 0) {
cur_type->form = XSD_FORM_QUALIFIED;
- } else if (strncmp(attr->children->content,"unqualified",sizeof("unqualified")) == 0) {
+ } else if (strncmp((char*)attr->children->content, "unqualified", sizeof("unqualified")) == 0) {
cur_type->form = XSD_FORM_UNQUALIFIED;
} else {
cur_type->form = XSD_FORM_DEFAULT;
if (node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) {
xmlAttrPtr def;
def = get_attribute(parent->properties, "elementFormDefault");
- if(def == NULL || strncmp(def->children->content, "qualified", sizeof("qualified"))) {
+ if(def == NULL || strncmp((char*)def->children->content, "qualified", sizeof("qualified"))) {
cur_type->form = XSD_FORM_UNQUALIFIED;
} else {
cur_type->form = XSD_FORM_QUALIFIED;
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);
+ nsptr = xmlSearchNs(element->doc, element, BAD_CAST(str_ns));
if (nsptr != NULL) {
- cur_type->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, (char *)cptype);
+ cur_type->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(cptype));
}
if (str_ns) {efree(str_ns);}
if (cptype) {efree(cptype);}
xmlNsPtr nsptr;
parse_namespace(ref->children->content, &attr_name, &ns);
- nsptr = xmlSearchNs(attrType->doc, attrType, ns);
+ nsptr = xmlSearchNs(attrType->doc, attrType, BAD_CAST(ns));
if (nsptr != NULL) {
- smart_str_appends(&key, nsptr->href);
+ smart_str_appends(&key, (char*)nsptr->href);
smart_str_appendc(&key, ':');
- newAttr->namens = estrdup(nsptr->href);
+ newAttr->namens = estrdup((char*)nsptr->href);
}
smart_str_appends(&key, attr_name);
smart_str_0(&key);
ns = tns;
}
if (ns != NULL) {
- smart_str_appends(&key, ns->children->content);
+ smart_str_appends(&key, (char*)ns->children->content);
smart_str_appendc(&key, ':');
- newAttr->namens = estrdup(ns->children->content);
+ newAttr->namens = estrdup((char*)ns->children->content);
}
- smart_str_appends(&key, name->children->content);
+ smart_str_appends(&key, (char*)name->children->content);
smart_str_0(&key);
}
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);
+ nsptr = xmlSearchNs(attrType->doc, attrType, BAD_CAST(str_ns));
if (nsptr != NULL) {
- newAttr->encode = get_create_encoder(sdl, cur_type, (char *)nsptr->href, (char *)cptype);
+ newAttr->encode = get_create_encoder(sdl, cur_type, nsptr->href, BAD_CAST(cptype));
}
if (str_ns) {efree(str_ns);}
if (cptype) {efree(cptype);}
attr = attrType->properties;
while (attr != NULL) {
if (attr_is_equal_ex(attr, "default", SCHEMA_NAMESPACE)) {
- newAttr->def = estrdup(attr->children->content);
+ newAttr->def = estrdup((char*)attr->children->content);
} else if (attr_is_equal_ex(attr, "fixed", SCHEMA_NAMESPACE)) {
- newAttr->fixed = estrdup(attr->children->content);
+ newAttr->fixed = estrdup((char*)attr->children->content);
} else if (attr_is_equal_ex(attr, "form", SCHEMA_NAMESPACE)) {
- if (strncmp(attr->children->content,"qualified",sizeof("qualified")) == 0) {
+ if (strncmp((char*)attr->children->content, "qualified", sizeof("qualified")) == 0) {
newAttr->form = XSD_FORM_QUALIFIED;
- } else if (strncmp(attr->children->content,"unqualified",sizeof("unqualified")) == 0) {
+ } else if (strncmp((char*)attr->children->content, "unqualified", sizeof("unqualified")) == 0) {
newAttr->form = XSD_FORM_UNQUALIFIED;
} else {
newAttr->form = XSD_FORM_DEFAULT;
} else if (attr_is_equal_ex(attr, "id", SCHEMA_NAMESPACE)) {
/* skip */
} else if (attr_is_equal_ex(attr, "name", SCHEMA_NAMESPACE)) {
- newAttr->name = estrdup(attr->children->content);
+ newAttr->name = estrdup((char*)attr->children->content);
} else if (attr_is_equal_ex(attr, "ref", SCHEMA_NAMESPACE)) {
/* already processed */
} else if (attr_is_equal_ex(attr, "type", SCHEMA_NAMESPACE)) {
/* already processed */
} else if (attr_is_equal_ex(attr, "use", SCHEMA_NAMESPACE)) {
- if (strncmp(attr->children->content,"prohibited",sizeof("prohibited")) == 0) {
+ if (strncmp((char*)attr->children->content, "prohibited", sizeof("prohibited")) == 0) {
newAttr->use = XSD_USE_PROHIBITED;
- } else if (strncmp(attr->children->content,"required",sizeof("required")) == 0) {
+ } else if (strncmp((char*)attr->children->content, "required", sizeof("required")) == 0) {
newAttr->use = XSD_USE_REQUIRED;
- } else if (strncmp(attr->children->content,"optional",sizeof("optional")) == 0) {
+ } else if (strncmp((char*)attr->children->content, "optional", sizeof("optional")) == 0) {
newAttr->use = XSD_USE_OPTIONAL;
} else {
newAttr->use = XSD_USE_DEFAULT;
} else {
xmlNsPtr nsPtr = attr_find_ns(attr);
- if (strncmp(nsPtr->href, SCHEMA_NAMESPACE, sizeof(SCHEMA_NAMESPACE))) {
+ if (strncmp((char*)nsPtr->href, SCHEMA_NAMESPACE, sizeof(SCHEMA_NAMESPACE))) {
smart_str key2 = {0};
sdlExtraAttributePtr ext;
xmlNsPtr nsptr;
ext = emalloc(sizeof(sdlExtraAttribute));
memset(ext, 0, sizeof(sdlExtraAttribute));
parse_namespace(attr->children->content, &value, &ns);
- nsptr = xmlSearchNs(attr->doc, attr->parent, ns);
+ nsptr = xmlSearchNs(attr->doc, attr->parent, BAD_CAST(ns));
if (nsptr) {
- ext->ns = estrdup(nsptr->href);
+ ext->ns = estrdup((char*)nsptr->href);
ext->val = estrdup(value);
} else {
- ext->val = estrdup(attr->children->content);
+ ext->val = estrdup((char*)attr->children->content);
}
if (ns) {efree(ns);}
efree(value);
zend_hash_init(newAttr->extraAttributes, 0, NULL, delete_extra_attribute, 0);
}
- smart_str_appends(&key2, nsPtr->href);
+ smart_str_appends(&key2, (char*)nsPtr->href);
smart_str_appendc(&key2, ':');
- smart_str_appends(&key2, attr->name);
+ smart_str_appends(&key2, (char*)attr->name);
smart_str_0(&key2);
zend_hash_add(newAttr->extraAttributes, key2.c, key2.len + 1, &ext, sizeof(sdlExtraAttributePtr), NULL);
smart_str_free(&key2);
if (node_is_equal_ex(parent, "schema", SCHEMA_NAMESPACE)) {
xmlAttrPtr def;
def = get_attribute(parent->properties, "attributeFormDefault");
- if(def == NULL || strncmp(def->children->content, "qualified", sizeof("qualified"))) {
+ if(def == NULL || strncmp((char*)def->children->content, "qualified", sizeof("qualified"))) {
newAttr->form = XSD_FORM_UNQUALIFIED;
} else {
newAttr->form = XSD_FORM_QUALIFIED;
dummy_type = emalloc(sizeof(sdlType));
memset(dummy_type, 0, sizeof(sdlType));
dummy_type->name = estrdup("anonymous");
- dummy_type->namens = estrdup(tns->children->content);
+ dummy_type->namens = estrdup((char*)tns->children->content);
schema_simpleType(sdl, tns, trav, dummy_type);
newAttr->encode = dummy_type->encode;
delete_type(&dummy_type);
}
newType = emalloc(sizeof(sdlType));
memset(newType, 0, sizeof(sdlType));
- newType->name = estrdup(name->children->content);
- newType->namens = estrdup(ns->children->content);
+ newType->name = estrdup((char*)name->children->content);
+ newType->namens = estrdup((char*)ns->children->content);
smart_str_appends(&key, newType->namens);
smart_str_appendc(&key, ':');
memset(newAttr, 0, sizeof(sdlAttribute));
parse_namespace(ref->children->content, &group_name, &ns);
- nsptr = xmlSearchNs(attrGroup->doc, attrGroup, ns);
+ nsptr = xmlSearchNs(attrGroup->doc, attrGroup, BAD_CAST(ns));
if (nsptr != NULL) {
- smart_str_appends(&key, nsptr->href);
+ smart_str_appends(&key, (char*)nsptr->href);
smart_str_appendc(&key, ':');
}
smart_str_appends(&key, group_name);
static void delete_header_persistent(void *header);
static void delete_document(void *doc_ptr);
-encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr node, const char *type)
+encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr node, const xmlChar *type)
{
encodePtr enc = NULL;
xmlNsPtr nsptr;
char *ns, *cptype;
parse_namespace(type, &cptype, &ns);
- nsptr = xmlSearchNs(node->doc, node, ns);
+ nsptr = xmlSearchNs(node->doc, node, BAD_CAST(ns));
if (nsptr != NULL) {
- enc = get_encoder(sdl, nsptr->href, cptype);
+ enc = get_encoder(sdl, (char*)nsptr->href, cptype);
if (enc == NULL) {
enc = get_encoder_ex(sdl, cptype, strlen(cptype));
}
} else {
- enc = get_encoder_ex(sdl, type, strlen(type));
+ enc = get_encoder_ex(sdl, (char*)type, xmlStrlen(type));
}
efree(cptype);
if (ns) {efree(ns);}
return enc;
}
-static sdlTypePtr get_element(sdlPtr sdl, xmlNodePtr node, const char *type)
+static sdlTypePtr get_element(sdlPtr sdl, xmlNodePtr node, const xmlChar *type)
{
sdlTypePtr ret = NULL;
sdlTypePtr *sdl_type;
parse_namespace(type, &cptype, &ns);
- nsptr = xmlSearchNs(node->doc, node, ns);
+ nsptr = xmlSearchNs(node->doc, node, BAD_CAST(ns));
if (nsptr != NULL) {
- int ns_len = strlen(nsptr->href);
+ int ns_len = xmlStrlen(nsptr->href);
int type_len = strlen(cptype);
int len = ns_len + type_len + 1;
char *nscat = emalloc(len + 1);
}
efree(nscat);
} else {
- if (zend_hash_find(sdl->elements, (char*)type, strlen(type) + 1, (void **)&sdl_type) == SUCCESS) {
+ if (zend_hash_find(sdl->elements, (char*)type, xmlStrlen(type) + 1, (void **)&sdl_type) == SUCCESS) {
ret = *sdl_type;
}
}
static int is_wsdl_element(xmlNodePtr node)
{
- if (node->ns && strcmp(node->ns->href,WSDL_NAMESPACE) != 0) {
+ if (node->ns && strcmp((char*)node->ns->href, WSDL_NAMESPACE) != 0) {
xmlAttrPtr attr;
if ((attr = get_attribute_ex(node->properties, "required", WSDL_NAMESPACE)) != NULL &&
attr->children && attr->children->content &&
- (strcmp(attr->children->content,"1") == 0 ||
- strcmp(attr->children->content,"true") == 0)) {
+ (strcmp((char*)attr->children->content, "1") == 0 ||
+ strcmp((char*)attr->children->content, "true") == 0)) {
soap_error1(E_ERROR, "Parsing WSDL: Unknown required WSDL extension '%s'", node->ns->href);
}
return 0;
if (!include) {
targetNamespace = get_attribute(definitions->properties, "targetNamespace");
if (targetNamespace) {
- tmpsdl->target_ns = estrdup(targetNamespace->children->content);
+ tmpsdl->target_ns = estrdup((char*)targetNamespace->children->content);
}
}
uri = xmlBuildURI(tmp->children->content, base);
xmlFree(base);
}
- load_wsdl_ex(this_ptr, uri, ctx, 1 TSRMLS_CC);
+ load_wsdl_ex(this_ptr, (char*)uri, ctx, 1 TSRMLS_CC);
xmlFree(uri);
}
} else if (node_is_equal(trav,"message")) {
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) {
+ if (zend_hash_add(&ctx->messages, (char*)name->children->content, xmlStrlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
soap_error1(E_ERROR, "Parsing WSDL: <message> '%s' already defined", name->children->content);
}
} else {
} 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) {
+ if (zend_hash_add(&ctx->portTypes, (char*)name->children->content, xmlStrlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
soap_error1(E_ERROR, "Parsing WSDL: <portType> '%s' already defined", name->children->content);
}
} else {
} 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) {
+ if (zend_hash_add(&ctx->bindings, (char*)name->children->content, xmlStrlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
soap_error1(E_ERROR, "Parsing WSDL: <binding> '%s' already defined", name->children->content);
}
} else {
} 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) {
+ if (zend_hash_add(&ctx->services, (char*)name->children->content, xmlStrlen(name->children->content)+1,&trav, sizeof(xmlNodePtr), NULL) != SUCCESS) {
soap_error1(E_ERROR, "Parsing WSDL: <service> '%s' already defined", name->children->content);
}
} else {
soap_error0(E_ERROR, "Parsing WSDL: Missing message attribute for <header>");
}
- ctype = strrchr(tmp->children->content,':');
+ ctype = strrchr((char*)tmp->children->content,':');
if (ctype == NULL) {
- ctype = tmp->children->content;
+ ctype = (char*)tmp->children->content;
} else {
++ctype;
}
if (!tmp) {
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);
+ part = get_node_with_attribute_ex((*message)->children, "part", WSDL_NAMESPACE, "name", (char*)tmp->children->content, NULL);
if (!part) {
soap_error1(E_ERROR, "Parsing WSDL: Missing part '%s' in <message>", tmp->children->content);
}
h = emalloc(sizeof(sdlSoapBindingFunctionHeader));
memset(h, 0, sizeof(sdlSoapBindingFunctionHeader));
- h->name = estrdup(tmp->children->content);
+ h->name = estrdup((char*)tmp->children->content);
tmp = get_attribute(header->properties, "use");
- if (tmp && !strncmp(tmp->children->content, "encoded", sizeof("encoded"))) {
+ if (tmp && !strncmp((char*)tmp->children->content, "encoded", sizeof("encoded"))) {
h->use = SOAP_ENCODED;
} else {
h->use = SOAP_LITERAL;
tmp = get_attribute(header->properties, "namespace");
if (tmp) {
- h->ns = estrdup(tmp->children->content);
+ h->ns = estrdup((char*)tmp->children->content);
}
if (h->use == SOAP_ENCODED) {
tmp = get_attribute(header->properties, "encodingStyle");
if (tmp) {
- if (strncmp(tmp->children->content,SOAP_1_1_ENC_NAMESPACE,sizeof(SOAP_1_1_ENC_NAMESPACE)) == 0) {
+ if (strncmp((char*)tmp->children->content, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE)) == 0) {
h->encodingStyle = SOAP_ENCODING_1_1;
- } else if (strncmp(tmp->children->content,SOAP_1_2_ENC_NAMESPACE,sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) {
+ } else if (strncmp((char*)tmp->children->content, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) {
h->encodingStyle = SOAP_ENCODING_1_2;
} else {
soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content);
body = trav;
tmp = get_attribute(body->properties, "use");
- if (tmp && !strncmp(tmp->children->content, "literal", sizeof("literal"))) {
+ if (tmp && !strncmp((char*)tmp->children->content, "literal", sizeof("literal"))) {
binding->use = SOAP_LITERAL;
} else {
binding->use = SOAP_ENCODED;
tmp = get_attribute(body->properties, "namespace");
if (tmp) {
- binding->ns = estrdup(tmp->children->content);
+ binding->ns = estrdup((char*)tmp->children->content);
}
tmp = get_attribute(body->properties, "parts");
if (tmp) {
HashTable ht;
- char *parts = tmp->children->content;
+ char *parts = (char*)tmp->children->content;
/* Delete all parts those are not in the "parts" attribute */
zend_hash_init(&ht, 0, NULL, delete_parameter, 0);
if (binding->use == SOAP_ENCODED) {
tmp = get_attribute(body->properties, "encodingStyle");
if (tmp) {
- if (strncmp(tmp->children->content,SOAP_1_1_ENC_NAMESPACE,sizeof(SOAP_1_1_ENC_NAMESPACE)) == 0) {
+ if (strncmp((char*)tmp->children->content, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE)) == 0) {
binding->encodingStyle = SOAP_ENCODING_1_1;
- } else if (strncmp(tmp->children->content,SOAP_1_2_ENC_NAMESPACE,sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) {
+ } else if (strncmp((char*)tmp->children->content, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) {
binding->encodingStyle = SOAP_ENCODING_1_2;
} else {
soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content);
}
}
-static HashTable* wsdl_message(sdlCtx *ctx, char* message_name)
+static HashTable* wsdl_message(sdlCtx *ctx, xmlChar* message_name)
{
xmlNodePtr trav, part, message = NULL, *tmp;
HashTable* parameters = NULL;
char *ctype;
- ctype = strrchr(message_name,':');
+ ctype = strrchr((char*)message_name,':');
if (ctype == NULL) {
- ctype = message_name;
+ ctype = (char*)message_name;
} else {
++ctype;
}
xmlAttrPtr element, type, name;
sdlParamPtr param;
- if (trav->ns != NULL && strcmp(trav->ns->href,WSDL_NAMESPACE) != 0) {
+ if (trav->ns != NULL && strcmp((char*)trav->ns->href, WSDL_NAMESPACE) != 0) {
soap_error1(E_ERROR, "Parsing WSDL: Unexpected extensibility element <%s>", trav->name);
}
if (node_is_equal(trav,"documentation")) {
soap_error1(E_ERROR, "Parsing WSDL: No name associated with <part> '%s'", message->name);
}
- param->paramName = estrdup(name->children->content);
+ param->paramName = estrdup((char*)name->children->content);
type = get_attribute(part->properties, "type");
if (type != NULL) {
trav2 = port->children;
while (trav2 != NULL) {
if (node_is_equal(trav2,"address") && trav2->ns) {
- if (!strncmp(trav2->ns->href, WSDL_SOAP11_NAMESPACE, sizeof(WSDL_SOAP11_NAMESPACE))) {
+ if (!strncmp((char*)trav2->ns->href, WSDL_SOAP11_NAMESPACE, sizeof(WSDL_SOAP11_NAMESPACE))) {
address = trav2;
wsdl_soap_namespace = WSDL_SOAP11_NAMESPACE;
tmpbinding->bindingType = BINDING_SOAP;
- } else if (!strncmp(trav2->ns->href, WSDL_SOAP12_NAMESPACE, sizeof(WSDL_SOAP12_NAMESPACE))) {
+ } else if (!strncmp((char*)trav2->ns->href, WSDL_SOAP12_NAMESPACE, sizeof(WSDL_SOAP12_NAMESPACE))) {
address = trav2;
wsdl_soap_namespace = WSDL_SOAP12_NAMESPACE;
tmpbinding->bindingType = BINDING_SOAP;
- } else if (!strncmp(trav2->ns->href, RPC_SOAP12_NAMESPACE, sizeof(RPC_SOAP12_NAMESPACE))) {
+ } else if (!strncmp((char*)trav2->ns->href, RPC_SOAP12_NAMESPACE, sizeof(RPC_SOAP12_NAMESPACE))) {
address = trav2;
wsdl_soap_namespace = RPC_SOAP12_NAMESPACE;
tmpbinding->bindingType = BINDING_SOAP;
- } else if (!strncmp(trav2->ns->href, WSDL_HTTP11_NAMESPACE, sizeof(WSDL_HTTP11_NAMESPACE))) {
+ } else if (!strncmp((char*)trav2->ns->href, WSDL_HTTP11_NAMESPACE, sizeof(WSDL_HTTP11_NAMESPACE))) {
address = trav2;
tmpbinding->bindingType = BINDING_HTTP;
- } else if (!strncmp(trav2->ns->href, WSDL_HTTP12_NAMESPACE, sizeof(WSDL_HTTP12_NAMESPACE))) {
+ } else if (!strncmp((char*)trav2->ns->href, WSDL_HTTP12_NAMESPACE, sizeof(WSDL_HTTP12_NAMESPACE))) {
address = trav2;
tmpbinding->bindingType = BINDING_HTTP;
}
soap_error0(E_ERROR, "Parsing WSDL: No location associated with <port>");
}
- tmpbinding->location = estrdup(location->children->content);
+ tmpbinding->location = estrdup((char*)location->children->content);
- ctype = strrchr(bindingAttr->children->content,':');
+ ctype = strrchr((char*)bindingAttr->children->content,':');
if (ctype == NULL) {
- ctype = bindingAttr->children->content;
+ ctype = (char*)bindingAttr->children->content;
} else {
++ctype;
}
soapBindingNode = get_node_ex(binding->children, "binding", wsdl_soap_namespace);
if (soapBindingNode) {
tmp = get_attribute(soapBindingNode->properties, "style");
- if (tmp && !strncmp(tmp->children->content, "rpc", sizeof("rpc"))) {
+ if (tmp && !strncmp((char*)tmp->children->content, "rpc", sizeof("rpc"))) {
soapBinding->style = SOAP_RPC;
}
tmp = get_attribute(soapBindingNode->properties, "transport");
if (tmp) {
- if (strncmp(tmp->children->content, WSDL_HTTP_TRANSPORT, sizeof(WSDL_HTTP_TRANSPORT)) == 0) {
+ if (strncmp((char*)tmp->children->content, WSDL_HTTP_TRANSPORT, sizeof(WSDL_HTTP_TRANSPORT)) == 0) {
soapBinding->transport = SOAP_TRANSPORT_HTTP;
} else {
soap_error1(E_ERROR, "Parsing WSDL: PHP-SOAP doesn't support transport '%s'", tmp->children->content);
if (name == NULL) {
soap_error0(E_ERROR, "Parsing WSDL: Missing 'name' attribute for <binding>");
}
- tmpbinding->name = estrdup(name->children->content);
+ tmpbinding->name = estrdup((char*)name->children->content);
type = get_attribute(binding->properties, "type");
if (type == NULL) {
soap_error0(E_ERROR, "Parsing WSDL: Missing 'type' attribute for <binding>");
}
- ctype = strrchr(type->children->content,':');
+ ctype = strrchr((char*)type->children->content,':');
if (ctype == NULL) {
- ctype = type->children->content;
+ ctype = (char*)type->children->content;
} else {
++ctype;
}
trav3 = trav3->next;
}
- portTypeOperation = get_node_with_attribute_ex(portType->children, "operation", WSDL_NAMESPACE, "name", op_name->children->content, NULL);
+ portTypeOperation = get_node_with_attribute_ex(portType->children, "operation", WSDL_NAMESPACE, "name", (char*)op_name->children->content, NULL);
if (portTypeOperation == NULL) {
soap_error1(E_ERROR, "Parsing WSDL: Missing <portType>/<operation> with name '%s'", op_name->children->content);
}
function = emalloc(sizeof(sdlFunction));
memset(function, 0, sizeof(sdlFunction));
- function->functionName = estrdup(op_name->children->content);
+ function->functionName = estrdup((char*)op_name->children->content);
if (tmpbinding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr soapFunctionBinding;
if (soapOperation) {
tmp = get_attribute(soapOperation->properties, "soapAction");
if (tmp) {
- soapFunctionBinding->soapAction = estrdup(tmp->children->content);
+ soapFunctionBinding->soapAction = estrdup((char*)tmp->children->content);
}
tmp = get_attribute(soapOperation->properties, "style");
if (tmp) {
- if (!strncmp(tmp->children->content, "rpc", sizeof("rpc"))) {
+ if (!strncmp((char*)tmp->children->content, "rpc", sizeof("rpc"))) {
soapFunctionBinding->style = SOAP_RPC;
} else {
soapFunctionBinding->style = SOAP_DOCUMENT;
f = emalloc(sizeof(sdlFault));
memset(f, 0, sizeof(sdlFault));
- f->name = estrdup(name->children->content);
+ f->name = estrdup((char*)name->children->content);
f->details = wsdl_message(&ctx, message->children->content);
if (f->details == NULL || zend_hash_num_elements(f->details) > 1) {
soap_error1(E_ERROR, "Parsing WSDL: The fault message '%s' must have a single part", message->children->content);
memset(f->bindingAttributes, 0, sizeof(sdlSoapBindingFunctionFault));
tmp = get_attribute(trav->properties, "use");
- if (tmp && !strncmp(tmp->children->content, "encoded", sizeof("encoded"))) {
+ if (tmp && !strncmp((char*)tmp->children->content, "encoded", sizeof("encoded"))) {
binding->use = SOAP_ENCODED;
} else {
binding->use = SOAP_LITERAL;
tmp = get_attribute(trav->properties, "namespace");
if (tmp) {
- binding->ns = estrdup(tmp->children->content);
+ binding->ns = estrdup((char*)tmp->children->content);
}
if (binding->use == SOAP_ENCODED) {
tmp = get_attribute(trav->properties, "encodingStyle");
if (tmp) {
- if (strncmp(tmp->children->content,SOAP_1_1_ENC_NAMESPACE,sizeof(SOAP_1_1_ENC_NAMESPACE)) == 0) {
+ if (strncmp((char*)tmp->children->content, SOAP_1_1_ENC_NAMESPACE, sizeof(SOAP_1_1_ENC_NAMESPACE)) == 0) {
binding->encodingStyle = SOAP_ENCODING_1_1;
- } else if (strncmp(tmp->children->content,SOAP_1_2_ENC_NAMESPACE,sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) {
+ } else if (strncmp((char*)tmp->children->content, SOAP_1_2_ENC_NAMESPACE, sizeof(SOAP_1_2_ENC_NAMESPACE)) == 0) {
binding->encodingStyle = SOAP_ENCODING_1_2;
} else {
soap_error1(E_ERROR, "Parsing WSDL: Unknown encodingStyle '%s'", tmp->children->content);
md5str[0] = '\0';
PHP_MD5Init(&context);
- PHP_MD5Update(&context, uri, uri_len);
+ PHP_MD5Update(&context, (unsigned char*)uri, uri_len);
PHP_MD5Final(digest, &context);
make_digest(md5str, digest);
key = emalloc(len+sizeof("/wsdl-")-1+sizeof(md5str));
sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC);
-encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const char *type);
+encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const xmlChar *type);
encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type);
encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len);
/* Channel libxml file io layer through the PHP streams subsystem.
* This allows use of ftps:// and https:// urls */
-static int is_blank(const char* str)
+static int is_blank(const xmlChar* str)
{
while (*str != '\0') {
if (*str != ' ' && *str != 0x9 && *str != 0xa && *str != 0xd) {
if (ctxt->wellFormed) {
ret = ctxt->myDoc;
if (ret->URL == NULL && ctxt->directory != NULL) {
- ret->URL = xmlStrdup(ctxt->directory);
+ ret->URL = xmlCharStrdup(ctxt->directory);
}
} else {
ret = NULL;
if (ctxt->wellFormed) {
ret = ctxt->myDoc;
if (ret->URL == NULL && ctxt->directory != NULL) {
- ret->URL = xmlStrdup(ctxt->directory);
+ ret->URL = xmlCharStrdup(ctxt->directory);
}
} else {
ret = NULL;
int attr_is_equal_ex(xmlAttrPtr node, char *name, char *ns)
{
- if (name == NULL || strcmp(node->name, name) == 0) {
+ if (name == NULL || strcmp((char*)node->name, name) == 0) {
if (ns) {
xmlNsPtr nsPtr = attr_find_ns(node);
if (nsPtr) {
- return (strcmp(nsPtr->href, ns) == 0);
+ return (strcmp((char*)nsPtr->href, ns) == 0);
} else {
return FALSE;
}
int node_is_equal_ex(xmlNodePtr node, char *name, char *ns)
{
- if (name == NULL || strcmp(node->name, name) == 0) {
+ if (name == NULL || strcmp((char*)node->name, name) == 0) {
if (ns) {
xmlNsPtr nsPtr = node_find_ns(node);
if (nsPtr) {
- return (strcmp(nsPtr->href, ns) == 0);
+ return (strcmp((char*)nsPtr->href, ns) == 0);
} else {
return FALSE;
}
}
attr = get_attribute_ex(node->properties, attribute, attr_ns);
- if (attr != NULL && strcmp(attr->children->content, value) == 0) {
+ if (attr != NULL && strcmp((char*)attr->children->content, value) == 0) {
return node;
}
node = node->next;
while (node != NULL) {
if (node_is_equal_ex(node, name, name_ns)) {
xmlAttrPtr attr = get_attribute_ex(node->properties, attribute, attr_ns);
- if (attr != NULL && strcmp(attr->children->content, value) == 0) {
+ if (attr != NULL && strcmp((char*)attr->children->content, value) == 0) {
return node;
}
}
return NULL;
}
-int parse_namespace(const char *inval, char **value, char **namespace)
+int parse_namespace(const xmlChar *inval, char **value, char **namespace)
{
- char *found = strrchr(inval, ':');
+ char *found = strrchr((char*)inval, ':');
- if (found != NULL && found != inval) {
- (*namespace) = estrndup(inval, found - inval);
+ if (found != NULL && found != (char*)inval) {
+ (*namespace) = estrndup((char*)inval, found - (char*)inval);
(*value) = estrdup(++found);
} else {
- (*value) = estrdup(inval);
+ (*value) = estrdup((char*)inval);
(*namespace) = NULL;
}
xmlNodePtr get_node_recursive_ex(xmlNodePtr node,char *name, char *ns);
xmlNodePtr get_node_with_attribute_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns);
xmlNodePtr get_node_with_attribute_recursive_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns);
-int parse_namespace(const char *inval,char **value,char **namespace);
+int parse_namespace(const xmlChar *inval,char **value,char **namespace);
#ifndef ZEND_ENGINE_2
int php_stream_xmlIO_match_wrapper(const char *filename);
if (xmlGetIntSubset(doc_request) != NULL) {
xmlNodePtr env = get_node(doc_request->children,"Envelope");
if (env && env->ns) {
- if (strcmp(env->ns->href,SOAP_1_1_ENV_NAMESPACE) == 0) {
+ if (strcmp((char*)env->ns->href, SOAP_1_1_ENV_NAMESPACE) == 0) {
SOAP_GLOBAL(soap_version) = SOAP_1_1;
- } else if (strcmp(env->ns->href,SOAP_1_2_ENV_NAMESPACE) == 0) {
+ } else if (strcmp((char*)env->ns->href,SOAP_1_2_ENV_NAMESPACE) == 0) {
SOAP_GLOBAL(soap_version) = SOAP_1_2;
}
}
static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader *hdr TSRMLS_DC)
{
int soap_version;
- xmlChar *buf, cont_len[30];
+ xmlChar *buf;
+ char cont_len[30];
int size;
xmlDocPtr doc_return;
{
sdlFunctionPtr function;
- function = get_function(sdl, func->name);
+ function = get_function(sdl, (char*)func->name);
if (function && function->binding && function->binding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes;
if (fnb->style == SOAP_DOCUMENT) {
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
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) {
+ } else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
}
}
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
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) {
+ } else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
}
}
} else {
if (*version == SOAP_1_1) {
attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE);
- if (attr && strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
+ if (attr && strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
}
} else {
attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE);
- if (attr && strcmp(attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
+ if (attr && strcmp((char*)attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
}
}
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
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) {
+ } else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL TSRMLS_CC);
}
}
if (*version == SOAP_1_1) {
attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE);
- if (attr && strcmp(attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
+ if (attr && strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
}
attr = get_attribute_ex(hdr_func->properties,"actor",envelope_ns);
if (attr != NULL) {
- if (strcmp(attr->children->content,SOAP_1_1_ACTOR_NEXT) != 0 &&
- (actor == NULL || strcmp(attr->children->content,actor) != 0)) {
+ if (strcmp((char*)attr->children->content,SOAP_1_1_ACTOR_NEXT) != 0 &&
+ (actor == NULL || strcmp((char*)attr->children->content,actor) != 0)) {
goto ignore_header;
}
}
} else if (*version == SOAP_1_2) {
attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE);
- if (attr && strcmp(attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
+ if (attr && strcmp((char*)attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL TSRMLS_CC);
}
attr = get_attribute_ex(hdr_func->properties,"role",envelope_ns);
if (attr != NULL) {
- if (strcmp(attr->children->content,SOAP_1_2_ACTOR_UNLIMATERECEIVER) != 0 &&
- strcmp(attr->children->content,SOAP_1_2_ACTOR_NEXT) != 0 &&
- (actor == NULL || strcmp(attr->children->content,actor) != 0)) {
+ if (strcmp((char*)attr->children->content,SOAP_1_2_ACTOR_UNLIMATERECEIVER) != 0 &&
+ strcmp((char*)attr->children->content,SOAP_1_2_ACTOR_NEXT) != 0 &&
+ (actor == NULL || strcmp((char*)attr->children->content,actor) != 0)) {
goto ignore_header;
}
}
}
attr = get_attribute_ex(hdr_func->properties,"mustUnderstand",envelope_ns);
if (attr) {
- if (strcmp(attr->children->content,"1") == 0 ||
- strcmp(attr->children->content,"true") == 0) {
+ if (strcmp((char*)attr->children->content,"1") == 0 ||
+ strcmp((char*)attr->children->content,"true") == 0) {
mustUnderstand = 1;
- } else if (strcmp(attr->children->content,"0") == 0 ||
- strcmp(attr->children->content,"false") == 0) {
+ } else if (strcmp((char*)attr->children->content,"0") == 0 ||
+ strcmp((char*)attr->children->content,"false") == 0) {
mustUnderstand = 0;
} else {
soap_server_fault("Client","mustUnderstand value is not boolean", NULL, NULL, NULL TSRMLS_CC);
smart_str key = {0};
if (hdr_func->ns) {
- smart_str_appends(&key, hdr_func->ns->href);
+ smart_str_appends(&key, (char*)hdr_func->ns->href);
smart_str_appendc(&key, ':');
}
smart_str_appendl(&key, Z_STRVAL(h->function_name), Z_STRLEN(h->function_name));
if (style == SOAP_RPC) {
ns = encode_add_ns(body, fnb->output.ns);
if (function->responseName) {
- method = xmlNewChild(body, ns, function->responseName, NULL);
+ method = xmlNewChild(body, ns, BAD_CAST(function->responseName), NULL);
} else if (function->responseParameters) {
- method = xmlNewChild(body, ns, function->functionName, NULL);
+ method = xmlNewChild(body, ns, BAD_CAST(function->functionName), NULL);
}
}
} else {
use = main?SOAP_ENCODED:SOAP_LITERAL;
if (style == SOAP_RPC) {
ns = encode_add_ns(body, uri);
- method = xmlNewChild(body, ns, function_name, NULL);
+ method = xmlNewChild(body, ns, BAD_CAST(function_name), NULL);
}
}
if (style == SOAP_RPC) {
xmlNode *rpc_result;
if (main && version == SOAP_1_2) {
- xmlNs *rpc_ns = xmlNewNs(body, RPC_SOAP12_NAMESPACE, RPC_SOAP12_NS_PREFIX);
- rpc_result = xmlNewChild(method, rpc_ns, "result", NULL);
+ xmlNs *rpc_ns = xmlNewNs(body, BAD_CAST(RPC_SOAP12_NAMESPACE), BAD_CAST(RPC_SOAP12_NS_PREFIX));
+ rpc_result = xmlNewChild(method, rpc_ns, BAD_CAST("result"), NULL);
param = serialize_parameter(parameter, ret, 0, "return", use, method TSRMLS_CC);
xmlNodeSetContent(rpc_result,param->name);
} else {
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
- xmlNodeSetName(param, parameter->element->name);
+ xmlNodeSetName(param, BAD_CAST(parameter->element->name));
xmlSetNs(param, ns);
}
- } else if (strcmp(param->name,"return") == 0) {
+ } else if (strcmp((char*)param->name,"return") == 0) {
ns = encode_add_ns(param, uri);
- xmlNodeSetName(param, function_name);
+ xmlNodeSetName(param, BAD_CAST(function_name));
xmlSetNs(param, ns);
}
}
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
- xmlNodeSetName(param, parameter->element->name);
+ xmlNodeSetName(param, BAD_CAST(parameter->element->name));
xmlSetNs(param, ns);
}
}
}
}
if (use == SOAP_ENCODED && version == SOAP_1_2 && method != NULL) {
- xmlSetNsProp(method, body->ns, "encodingStyle", SOAP_1_2_ENC_NAMESPACE);
+ xmlSetNsProp(method, body->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_2_ENC_NAMESPACE));
}
return use;
}
encode_reset_ns();
- doc = xmlNewDoc("1.0");
+ doc = xmlNewDoc(BAD_CAST("1.0"));
doc->charset = XML_CHAR_ENCODING_UTF8;
- doc->encoding = xmlStrdup((xmlChar*)"UTF-8");
+ doc->encoding = xmlCharStrdup("UTF-8");
if (version == SOAP_1_1) {
- envelope = xmlNewDocNode(doc, NULL, "Envelope", NULL);
- ns = xmlNewNs(envelope, SOAP_1_1_ENV_NAMESPACE, SOAP_1_1_ENV_NS_PREFIX);
+ envelope = xmlNewDocNode(doc, NULL, BAD_CAST("Envelope"), NULL);
+ ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_1_ENV_NAMESPACE), BAD_CAST(SOAP_1_1_ENV_NS_PREFIX));
xmlSetNs(envelope,ns);
} else if (version == SOAP_1_2) {
- envelope = xmlNewDocNode(doc, NULL, "Envelope", NULL);
- ns = xmlNewNs(envelope, SOAP_1_2_ENV_NAMESPACE, SOAP_1_2_ENV_NS_PREFIX);
+ envelope = xmlNewDocNode(doc, NULL, BAD_CAST("Envelope"), NULL);
+ ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENV_NAMESPACE), BAD_CAST(SOAP_1_2_ENV_NS_PREFIX));
xmlSetNs(envelope,ns);
} else {
soap_server_fault("Server", "Unknown SOAP version", NULL, NULL, NULL TSRMLS_CC);
char *hdr_ns = headers->hdr?headers->hdr->ns:NULL;
char *hdr_name = Z_STRVAL(headers->function_name);
- head = xmlNewChild(envelope, ns, "Header", NULL);
+ head = xmlNewChild(envelope, ns, BAD_CAST("Header"), NULL);
if (Z_TYPE_P(hdr_ret) == IS_OBJECT &&
instanceof_function(Z_OBJCE_P(hdr_ret), soap_header_class_entry TSRMLS_CC)) {
HashTable* ht = Z_OBJPROP_P(hdr_ret);
} else {
xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head);
if (hdr_name) {
- xmlNodeSetName(xmlHdr,hdr_name);
+ xmlNodeSetName(xmlHdr, BAD_CAST(hdr_name));
}
if (hdr_ns) {
- xmlNsPtr nsptr = encode_add_ns(xmlHdr,hdr_ns);
+ xmlNsPtr nsptr = encode_add_ns(xmlHdr, hdr_ns);
xmlSetNs(xmlHdr, nsptr);
}
}
}
- body = xmlNewChild(envelope, ns, "Body", NULL);
- param = xmlNewChild(body, ns, "Fault", NULL);
+ body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL);
+ param = xmlNewChild(body, ns, BAD_CAST("Fault"), NULL);
if (zend_hash_find(prop, "faultcodens", sizeof("faultcodens"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) {
fault_ns = Z_STRVAL_PP(tmp);
if (version == SOAP_1_1) {
if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) {
int new_len;
- xmlNodePtr node = xmlNewNode(NULL, "faultcode");
+ xmlNodePtr node = xmlNewNode(NULL, BAD_CAST("faultcode"));
char *str = php_escape_html_entities(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC);
xmlAddChild(param, node);
if (fault_ns) {
xmlNsPtr nsptr = encode_add_ns(node, fault_ns);
- xmlNodeSetContent(node, xmlBuildQName(str, nsptr->prefix, NULL, 0));
+ xmlNodeSetContent(node, xmlBuildQName(BAD_CAST(str), nsptr->prefix, NULL, 0));
} else {
- xmlNodeSetContentLen(node, str, new_len);
+ xmlNodeSetContentLen(node, BAD_CAST(str), new_len);
}
efree(str);
}
if (zend_hash_find(prop, "faultstring", sizeof("faultstring"), (void**)&tmp) == SUCCESS) {
xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), *tmp, SOAP_LITERAL, param);
- xmlNodeSetName(node, "faultstring");
+ xmlNodeSetName(node, BAD_CAST("faultstring"));
}
if (zend_hash_find(prop, "faultactor", sizeof("faultactor"), (void**)&tmp) == SUCCESS) {
xmlNodePtr node = master_to_xml(get_conversion(IS_STRING), *tmp, SOAP_LITERAL, param);
- xmlNodeSetName(node, "faultactor");
+ xmlNodeSetName(node, BAD_CAST("faultactor"));
}
detail_name = "detail";
} else {
if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) {
int new_len;
- xmlNodePtr node = xmlNewChild(param, ns, "Code", NULL);
+ xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("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, ns, "Value", NULL);
+ node = xmlNewChild(node, ns, BAD_CAST("Value"), NULL);
if (fault_ns) {
xmlNsPtr nsptr = encode_add_ns(node, fault_ns);
- xmlNodeSetContent(node, xmlBuildQName(str, nsptr->prefix, NULL, 0));
+ xmlNodeSetContent(node, xmlBuildQName(BAD_CAST(str), nsptr->prefix, NULL, 0));
} else {
- xmlNodeSetContentLen(node, str, new_len);
+ xmlNodeSetContentLen(node, BAD_CAST(str), new_len);
}
efree(str);
}
if (zend_hash_find(prop, "faultstring", sizeof("faultstring"), (void**)&tmp) == SUCCESS) {
- xmlNodePtr node = xmlNewChild(param, ns, "Reason", NULL);
+ xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Reason"), NULL);
node = master_to_xml(get_conversion(IS_STRING), *tmp, SOAP_LITERAL, node);
- xmlNodeSetName(node, "Text");
+ xmlNodeSetName(node, BAD_CAST("Text"));
xmlSetNs(node, ns);
}
detail_name = SOAP_1_2_ENV_NS_PREFIX":Detail";
Z_TYPE_PP(tmp) != IS_NULL) {
detail = *tmp;
}
- node = xmlNewNode(NULL, detail_name);
+ node = xmlNewNode(NULL, BAD_CAST(detail_name));
xmlAddChild(param, node);
zend_hash_internal_pointer_reset(fault->details);
} else {
if (sparam->element) {
xmlNsPtr ns = encode_add_ns(x, sparam->element->namens);
- xmlNodeSetName(x, sparam->element->name);
+ xmlNodeSetName(x, BAD_CAST(sparam->element->name));
xmlSetNs(x, ns);
}
}
}
if (use == SOAP_ENCODED && version == SOAP_1_2) {
- xmlSetNsProp(x, envelope->ns, "encodingStyle", SOAP_1_2_ENC_NAMESPACE);
+ xmlSetNsProp(x, envelope->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_2_ENC_NAMESPACE));
}
} else if (zend_hash_find(prop, "detail", sizeof("detail"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) != IS_NULL) {
if (headers) {
soapHeader *h;
- head = xmlNewChild(envelope, ns, "Header", NULL);
+ head = xmlNewChild(envelope, ns, BAD_CAST("Header"), NULL);
h = headers;
while (h != NULL) {
if (Z_TYPE(h->retval) != IS_NULL) {
} else {
xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head);
if (hdr_name) {
- xmlNodeSetName(xmlHdr,hdr_name);
+ xmlNodeSetName(xmlHdr, BAD_CAST(hdr_name));
}
if (hdr_ns) {
xmlNsPtr nsptr = encode_add_ns(xmlHdr,hdr_ns);
}
}
- body = xmlNewChild(envelope, ns, "Body", NULL);
+ body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL);
if (serialize_response_call2(body, function, function_name, uri, ret, version, 1 TSRMLS_CC) == SOAP_ENCODED) {
use = SOAP_ENCODED;
}
if (use == SOAP_ENCODED) {
- xmlNewNs(envelope, XSD_NAMESPACE, XSD_NS_PREFIX);
+ xmlNewNs(envelope, BAD_CAST(XSD_NAMESPACE), BAD_CAST(XSD_NS_PREFIX));
if (version == SOAP_1_1) {
- xmlNewNs(envelope, SOAP_1_1_ENC_NAMESPACE, SOAP_1_1_ENC_NS_PREFIX);
- xmlSetNsProp(envelope, envelope->ns, "encodingStyle", SOAP_1_1_ENC_NAMESPACE);
+ xmlNewNs(envelope, BAD_CAST(SOAP_1_1_ENC_NAMESPACE), BAD_CAST(SOAP_1_1_ENC_NS_PREFIX));
+ xmlSetNsProp(envelope, envelope->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_1_ENC_NAMESPACE));
} else if (version == SOAP_1_2) {
- xmlNewNs(envelope, SOAP_1_2_ENC_NAMESPACE, SOAP_1_2_ENC_NS_PREFIX);
+ xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENC_NAMESPACE), BAD_CAST(SOAP_1_2_ENC_NS_PREFIX));
}
}
encode_reset_ns();
- doc = xmlNewDoc("1.0");
- doc->encoding = xmlStrdup((xmlChar*)"UTF-8");
+ doc = xmlNewDoc(BAD_CAST("1.0"));
+ doc->encoding = xmlCharStrdup("UTF-8");
doc->charset = XML_CHAR_ENCODING_UTF8;
if (version == SOAP_1_1) {
- envelope = xmlNewDocNode(doc, NULL, "Envelope", NULL);
- ns = xmlNewNs(envelope, SOAP_1_1_ENV_NAMESPACE, SOAP_1_1_ENV_NS_PREFIX);
- xmlSetNs(envelope,ns);
+ envelope = xmlNewDocNode(doc, NULL, BAD_CAST("Envelope"), NULL);
+ ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_1_ENV_NAMESPACE), BAD_CAST(SOAP_1_1_ENV_NS_PREFIX));
+ xmlSetNs(envelope, ns);
} else if (version == SOAP_1_2) {
- envelope = xmlNewDocNode(doc, NULL, "Envelope", NULL);
- ns = xmlNewNs(envelope, SOAP_1_2_ENV_NAMESPACE, SOAP_1_2_ENV_NS_PREFIX);
- xmlSetNs(envelope,ns);
+ envelope = xmlNewDocNode(doc, NULL, BAD_CAST("Envelope"), NULL);
+ ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENV_NAMESPACE), BAD_CAST(SOAP_1_2_ENV_NS_PREFIX));
+ xmlSetNs(envelope, ns);
} else {
soap_error0(E_ERROR, "Unknown SOAP version");
}
xmlDocSetRootElement(doc, envelope);
if (soap_headers) {
- head = xmlNewChild(envelope, ns, "Header", NULL);
+ head = xmlNewChild(envelope, ns, BAD_CAST("Header"), NULL);
}
- body = xmlNewChild(envelope, ns, "Body", NULL);
+ body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL);
if (function && function->binding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes;
if (style == SOAP_RPC) {
ns = encode_add_ns(body, fnb->input.ns);
if (function->requestName) {
- method = xmlNewChild(body, ns, function->requestName, NULL);
+ method = xmlNewChild(body, ns, BAD_CAST(function->requestName), NULL);
} else {
- method = xmlNewChild(body, ns, function->functionName, NULL);
+ method = xmlNewChild(body, ns, BAD_CAST(function->functionName), NULL);
}
}
} else {
/*style = SOAP_RPC;*/
if (style == SOAP_RPC) {
ns = encode_add_ns(body, uri);
- method = xmlNewChild(body, ns, function_name, NULL);
+ method = xmlNewChild(body, ns, BAD_CAST(function_name), NULL);
}
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "use", sizeof("use"), (void **)&zuse) == SUCCESS &&
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
- xmlNodeSetName(param, parameter->element->name);
+ xmlNodeSetName(param, BAD_CAST(parameter->element->name));
xmlSetNs(param, ns);
}
}
if (function && function->binding->bindingType == BINDING_SOAP) {
if (parameter && parameter->element) {
ns = encode_add_ns(param, parameter->element->namens);
- xmlNodeSetName(param, parameter->element->name);
+ xmlNodeSetName(param, BAD_CAST(parameter->element->name));
xmlSetNs(param, ns);
}
}
if (zend_hash_find(ht, "data", sizeof("data"), (void**)&tmp) == SUCCESS) {
h = master_to_xml(enc, *tmp, hdr_use, head);
- xmlNodeSetName(h, Z_STRVAL_PP(name));
+ xmlNodeSetName(h, BAD_CAST(Z_STRVAL_PP(name)));
} else {
- h = xmlNewNode(NULL, Z_STRVAL_PP(name));
- xmlAddChild(head,h);
+ h = xmlNewNode(NULL, BAD_CAST(Z_STRVAL_PP(name)));
+ xmlAddChild(head, h);
}
- nsptr = encode_add_ns(h,Z_STRVAL_PP(ns));
+ nsptr = encode_add_ns(h, Z_STRVAL_PP(ns));
xmlSetNs(h, nsptr);
if (zend_hash_find(ht, "mustUnderstand", sizeof("mustUnderstand"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_BOOL && Z_LVAL_PP(tmp)) {
if (version == SOAP_1_1) {
- xmlSetProp(h, SOAP_1_1_ENV_NS_PREFIX":mustUnderstand","1");
+ xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("1"));
} else {
- xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":mustUnderstand","true");
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("true"));
}
}
if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS) {
if (Z_TYPE_PP(tmp) == IS_STRING) {
if (version == SOAP_1_1) {
- xmlSetProp(h, SOAP_1_1_ENV_NS_PREFIX":actor",Z_STRVAL_PP(tmp));
+ xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(Z_STRVAL_PP(tmp)));
} else {
- xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":role",Z_STRVAL_PP(tmp));
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(Z_STRVAL_PP(tmp)));
}
} else if (Z_TYPE_PP(tmp) == IS_LONG) {
if (version == SOAP_1_1) {
if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) {
- xmlSetProp(h, SOAP_1_1_ENV_NS_PREFIX":actor",SOAP_1_1_ACTOR_NEXT);
+ xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(SOAP_1_1_ACTOR_NEXT));
}
} else {
if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) {
- xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":role",SOAP_1_2_ACTOR_NEXT);
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NEXT));
} else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NONE) {
- xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":role",SOAP_1_2_ACTOR_NONE);
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NONE));
} else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_UNLIMATERECEIVER) {
- xmlSetProp(h, SOAP_1_2_ENV_NS_PREFIX":role",SOAP_1_2_ACTOR_UNLIMATERECEIVER);
+ xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_UNLIMATERECEIVER));
}
}
}
}
if (use == SOAP_ENCODED) {
- xmlNewNs(envelope, XSD_NAMESPACE, XSD_NS_PREFIX);
+ xmlNewNs(envelope, BAD_CAST(XSD_NAMESPACE), BAD_CAST(XSD_NS_PREFIX));
if (version == SOAP_1_1) {
- xmlNewNs(envelope, SOAP_1_1_ENC_NAMESPACE, SOAP_1_1_ENC_NS_PREFIX);
- xmlSetNsProp(envelope, envelope->ns, "encodingStyle", SOAP_1_1_ENC_NAMESPACE);
+ xmlNewNs(envelope, BAD_CAST(SOAP_1_1_ENC_NAMESPACE), BAD_CAST(SOAP_1_1_ENC_NS_PREFIX));
+ xmlSetNsProp(envelope, envelope->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_1_ENC_NAMESPACE));
} else if (version == SOAP_1_2) {
- xmlNewNs(envelope, SOAP_1_2_ENC_NAMESPACE, SOAP_1_2_ENC_NS_PREFIX);
+ xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENC_NAMESPACE), BAD_CAST(SOAP_1_2_ENC_NS_PREFIX));
if (method) {
- xmlSetNsProp(method, envelope->ns, "encodingStyle", SOAP_1_2_ENC_NAMESPACE);
+ xmlSetNsProp(method, envelope->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_2_ENC_NAMESPACE));
}
}
}
enc = NULL;
}
xmlParam = master_to_xml(enc, val, style, parent);
- if (!strcmp(xmlParam->name, "BOGUS")) {
- xmlNodeSetName(xmlParam, paramName);
+ if (!strcmp((char*)xmlParam->name, "BOGUS")) {
+ xmlNodeSetName(xmlParam, BAD_CAST(paramName));
}
return xmlParam;
}
zend_hash_internal_pointer_reset((*tmp)->requestParameters);
while (zend_hash_get_current_data((*tmp)->requestParameters, (void**)¶m) == SUCCESS) {
if ((*param)->element) {
- if (strcmp((*param)->element->name,node->name) != 0) {
+ if (strcmp((*param)->element->name, (char*)node->name) != 0) {
ok = 0;
break;
}
if ((*param)->element->namens != NULL && node->ns != NULL) {
- if (strcmp((*param)->element->namens,node->ns->href) != 0) {
+ if (strcmp((*param)->element->namens, (char*)node->ns->href) != 0) {
ok = 0;
break;
}
ok = 0;
break;
}
- } else if (strcmp((*param)->paramName,node->name) != 0) {
+ } else if (strcmp((*param)->paramName, (char*)node->name) != 0) {
ok = 0;
break;
}