I have to send a byte array (encoded photo) from my PHP client to the WCF host. when I do a var_dump() on my array in PHP I get an array[2839] which is ok but on the server
You should use strings in PHP to emulate byte arrays. You can even use the syntax $str[index] with strings. You have a HUGE overhead (4x or 8x depending on the int size the payload PLUS the hash table overhead) otherwise.
I'm not very familiar with the type conversions the SOAP extension does, but using a string instead will probably work.
EDIT: Just checked the sources:
if (Z_TYPE_P(data) == IS_STRING) {
str = php_base64_encode((unsigned char*)Z_STRVAL_P(data), Z_STRLEN_P(data), &str_len);
text = xmlNewTextLen(str, str_len);
xmlAddChild(ret, text);
efree(str);
}
So it already does the base 64 encoding for you.
EDIT2: [SPECULATION]
Your 5-byte long result is because of the conversion to string that follows the code above:
if (Z_TYPE_P(data) == IS_STRING) {
...
} else {
zval tmp = *data;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
str = php_base64_encode((unsigned char*)Z_STRVAL(tmp), Z_STRLEN(tmp), &str_len);
text = xmlNewTextLen(str, str_len);
xmlAddChild(ret, text);
efree(str);
zval_dtor(&tmp);
}
The conversion results in "Array", which is 5 bytes long.