binding->name = sdl_deserialize_string(&in);
binding->location = sdl_deserialize_string(&in);
WSDL_CACHE_GET_1(binding->bindingType,sdlBindingType,&in);
- if (binding->bindingType == BINDING_SOAP) {
- if (*in != 0) {
- sdlSoapBindingPtr soap_binding = binding->bindingAttributes = emalloc(sizeof(sdlSoapBinding));
- WSDL_CACHE_GET_1(soap_binding->style,sdlEncodingStyle,&in);
- WSDL_CACHE_GET_1(soap_binding->transport,sdlTransport,&in);
- } else {
- WSDL_CACHE_SKIP(1,&in);
- }
+ if (binding->bindingType == BINDING_SOAP && *in != 0) {
+ sdlSoapBindingPtr soap_binding = binding->bindingAttributes = emalloc(sizeof(sdlSoapBinding));
+ WSDL_CACHE_GET_1(soap_binding->style,sdlEncodingStyle,&in);
+ WSDL_CACHE_GET_1(soap_binding->transport,sdlTransport,&in);
+ } else {
+ WSDL_CACHE_SKIP(1,&in);
}
bindings[i] = binding;
}
} else {
func->binding = bindings[binding_num-1];
}
- if (func->binding && func->binding->bindingType == BINDING_SOAP) {
- if (*in != 0) {
- sdlSoapBindingFunctionPtr binding = func->bindingAttributes = emalloc(sizeof(sdlSoapBindingFunction));
- memset(binding, 0, sizeof(sdlSoapBindingFunction));
- WSDL_CACHE_GET_1(binding->style,sdlEncodingStyle,&in);
- binding->soapAction = sdl_deserialize_string(&in);
- sdl_deserialize_soap_body(&binding->input, encoders, types, &in);
- sdl_deserialize_soap_body(&binding->output, encoders, types, &in);
- } else {
- WSDL_CACHE_SKIP(1, &in);
- func->bindingAttributes = NULL;
- }
+ if (func->binding && func->binding->bindingType == BINDING_SOAP && *in != 0) {
+ sdlSoapBindingFunctionPtr binding = func->bindingAttributes = emalloc(sizeof(sdlSoapBindingFunction));
+ memset(binding, 0, sizeof(sdlSoapBindingFunction));
+ WSDL_CACHE_GET_1(binding->style,sdlEncodingStyle,&in);
+ binding->soapAction = sdl_deserialize_string(&in);
+ sdl_deserialize_soap_body(&binding->input, encoders, types, &in);
+ sdl_deserialize_soap_body(&binding->output, encoders, types, &in);
+ } else {
+ WSDL_CACHE_SKIP(1, &in);
+ func->bindingAttributes = NULL;
}
func->requestParameters = sdl_deserialize_parameters(encoders, types, &in);
INIT_ZVAL(readfile_ret);
MAKE_STD_ZVAL(param);
- sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\""), 1);
+ sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\"")-1, 1);
ZVAL_STRING(param, service->sdl->source, 1);
ZVAL_STRING(&readfile, "readfile", 1);
if (call_user_function(EG(function_table), NULL, &readfile, &readfile_ret, 1, ¶m TSRMLS_CC) == FAILURE) {
}
sprintf(cont_len, "Content-Length: %d", size);
- sapi_add_header(cont_len, strlen(cont_len) + 1, 1);
+ sapi_add_header(cont_len, strlen(cont_len), 1);
if (soap_version == SOAP_1_2) {
- sapi_add_header("Content-Type: application/soap+xml; charset=\"utf-8\"", sizeof("Content-Type: application/soap+xml; charset=\"utf-8\""), 1);
+ sapi_add_header("Content-Type: application/soap+xml; charset=\"utf-8\"", sizeof("Content-Type: application/soap+xml; charset=\"utf-8\"")-1, 1);
} else {
- sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\""), 1);
+ sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\"")-1, 1);
}
xmlFreeDoc(doc_return);
Want to return HTTP 500 but apache wants to over write
our fault code with their own handling... Figure this out later
*/
- sapi_add_header("HTTP/1.1 500 Internal Service Error", sizeof("HTTP/1.1 500 Internal Service Error"), 1);
+ sapi_add_header("HTTP/1.1 500 Internal Service Error", sizeof("HTTP/1.1 500 Internal Service Error")-1, 1);
sprintf(cont_len,"Content-Length: %d", size);
- sapi_add_header(cont_len, strlen(cont_len) + 1, 1);
+ sapi_add_header(cont_len, strlen(cont_len), 1);
if (soap_version == SOAP_1_2) {
- sapi_add_header("Content-Type: application/soap+xml; charset=\"utf-8\"", sizeof("Content-Type: application/soap+xml; charset=\"utf-8\""), 1);
+ sapi_add_header("Content-Type: application/soap+xml; charset=\"utf-8\"", sizeof("Content-Type: application/soap+xml; charset=\"utf-8\"")-1, 1);
} else {
- sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\""), 1);
+ sapi_add_header("Content-Type: text/xml; charset=\"utf-8\"", sizeof("Content-Type: text/xml; charset=\"utf-8\"")-1, 1);
}
php_write(buf, size TSRMLS_CC);
ZVAL_STRINGL(params[0], buf, buf_size, 0);
INIT_ZVAL(param1);
params[1] = ¶m1;
- ZVAL_STRING(params[1], location, 0);
+ if (location == NULL) {
+ ZVAL_NULL(params[1]);
+ } else {
+ ZVAL_STRING(params[1], location, 0);
+ }
INIT_ZVAL(param2);
params[2] = ¶m2;
- ZVAL_STRING(params[2], action, 0);
+ if (action == NULL) {
+ ZVAL_NULL(params[2]);
+ } else {
+ ZVAL_STRING(params[2], action, 0);
+ }
INIT_ZVAL(param3);
params[3] = ¶m3;
ZVAL_LONG(params[3], version);
sdlPtr old_sdl = NULL;
sdlFunctionPtr fn;
xmlDocPtr request = NULL;
- char *buffer;
- int len;
int ret = FALSE;
int soap_version;
zval response;
xmlAttrPtr attr;
sdlFunctionPtr function;
- ZVAL_EMPTY_STRING(function_name);
-
/* Get <Envelope> element */
env = NULL;
trav = request->children;
case XSD_TYPEKIND_SIMPLE:
case XSD_TYPEKIND_LIST:
case XSD_TYPEKIND_UNION:
- smart_str_appendl(buf, type->encode->details.type_str, strlen(type->encode->details.type_str));
- smart_str_appendc(buf, ' ');
+ if (type->encode) {
+ smart_str_appendl(buf, type->encode->details.type_str, strlen(type->encode->details.type_str));
+ smart_str_appendc(buf, ' ');
+ } else {
+ smart_str_appendl(buf, "anyType ", sizeof("anyType ")-1);
+ }
smart_str_appendl(buf, type->name, strlen(type->name));
break;
case XSD_TYPEKIND_COMPLEX:
len = end-(*ext)->val;
}
if (len == 0) {
- smart_str_appendl(buf, "anyType", 7);
+ smart_str_appendl(buf, "anyType", sizeof("anyType")-1);
} else {
smart_str_appendl(buf, (*ext)->val, len);
}