}
}
- if (cptype) {efree(cptype);}
+ efree(cptype);
if (ns) {efree(ns);}
}
return ret;
if (!tmp) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing message attribute for <header>");
}
- parse_namespace(tmp->children->content, &ctype, &ns);
+
+ ctype = strrchr(tmp->children->content,':');
+ if (ctype == NULL) {
+ ctype = tmp->children->content;
+ } else {
+ ++ctype;
+ }
if (zend_hash_find(&ctx->messages, ctype, strlen(ctype)+1, (void**)&message) != SUCCESS) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing <message> with name '%s'", tmp->children->content);
}
- if (ctype) {efree(ctype);}
- if (ns) {efree(ns);}
tmp = get_attribute(header->properties, "part");
if (!tmp) {
HashTable* parameters = NULL;
char *ns, *ctype;
- parse_namespace(message_name, &ctype, &ns);
+ ctype = strrchr(message_name,':');
+ if (ctype == NULL) {
+ ctype = message_name;
+ } else {
+ ++ctype;
+ }
if (zend_hash_find(&ctx->messages, ctype, strlen(ctype)+1, (void**)&tmp) != SUCCESS) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing <message> with name '%s'", message->children->content);
}
message = *tmp;
- if (ctype) {efree(ctype);}
- if (ns) {efree(ns);}
parameters = sdl_malloc(sizeof(HashTable));
zend_hash_init(parameters, 0, NULL, delete_paramater, SDL_PERSISTENT);
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Unknown binding type");
}
- parse_namespace(bindingAttr->children->content, &ctype, &ns);
+ ctype = strrchr(bindingAttr->children->content,':');
+ if (ctype == NULL) {
+ ctype = bindingAttr->children->content;
+ } else {
+ ++ctype;
+ }
if (zend_hash_find(&ctx.bindings, ctype, strlen(ctype)+1, (void*)&tmp) != SUCCESS) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: No <binding> element with name '%s'", ctype);
}
binding = *tmp;
- if (ns) {efree(ns);}
- if (ctype) {efree(ctype);}
-
if (tmpbinding->bindingType == BINDING_SOAP) {
sdlSoapBindingPtr soapBinding;
xmlNodePtr soapBindingNode;
if (type == NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing 'type' attribute for <binding>");
}
- parse_namespace(type->children->content, &ctype, &ns);
+ ctype = strrchr(type->children->content,':');
+ if (ctype == NULL) {
+ ctype = type->children->content;
+ } else {
+ ++ctype;
+ }
if (zend_hash_find(&ctx.portTypes, ctype, strlen(ctype)+1, (void**)&tmp) != SUCCESS) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Missing <portType> with name '%s'", name->children->content);
}
portType = *tmp;
- if (ctype) {efree(ctype);}
- if (ns) {efree(ns);}
-
trav2 = binding->children;
FOREACHNODE(trav2, "operation", operation) {
sdlFunctionPtr function;
} else if (input == NULL) {
function->responseName = sdl_strdup(function->functionName);
} else {
- function->responseName = sdl_malloc(strlen(function->functionName) + sizeof("Response"));
- sprintf(function->responseName, "%sResponse", function->functionName);
+ int len = strlen(function->functionName);
+ function->responseName = sdl_malloc(len + sizeof("Response"));
+ memcpy(function->responseName, function->functionName, len);
+ memcpy(function->responseName+len, "Response", sizeof("Response"));
}
if (tmpbinding->bindingType == BINDING_SOAP) {
response_name = estrdup(function->responseName);
} else {
response_name = emalloc(Z_STRLEN(function_name) + sizeof("Response"));
- sprintf(response_name,"%sResponse",Z_STRVAL(function_name));
+ memcpy(response_name,Z_STRVAL(function_name),Z_STRLEN(function_name));
+ memcpy(response_name+Z_STRLEN(function_name),"Response",sizeof("Response"));
}
SOAP_GLOBAL(overrides) = service->mapping;
doc_return = seralize_response_call(function, response_name, service->uri, &retval, soap_headers, soap_version TSRMLS_CC);
php_error(E_ERROR, "Can't create SoapClient. 'location' option is requred in nonWSDL mode.");
return;
}
-
+
if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_STRING) {
add_property_stringl(this_ptr, "uri", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1);
php_error(E_ERROR, "Can't create SoapClient. 'uri' option is requred in nonWSDL mode.");
return;
}
-
+
if (zend_hash_find(ht, "style", sizeof("style"), (void**)&tmp) == SUCCESS &&
- Z_TYPE_PP(tmp) == IS_LONG &&
+ Z_TYPE_PP(tmp) == IS_LONG &&
(Z_LVAL_PP(tmp) == SOAP_RPC || Z_LVAL_PP(tmp) == SOAP_DOCUMENT)) {
add_property_long(this_ptr, "style", Z_LVAL_PP(tmp));
}
if (zend_hash_find(ht, "use", sizeof("use"), (void**)&tmp) == SUCCESS &&
- Z_TYPE_PP(tmp) == IS_LONG &&
+ Z_TYPE_PP(tmp) == IS_LONG &&
(Z_LVAL_PP(tmp) == SOAP_LITERAL || Z_LVAL_PP(tmp) == SOAP_ENCODED)) {
add_property_long(this_ptr, "use", Z_LVAL_PP(tmp));
}
}
}
if (zend_hash_find(ht, "trace", sizeof("trace"), (void**)&tmp) == SUCCESS &&
- (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) &&
+ (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) &&
Z_LVAL_PP(tmp) == 1) {
add_property_long(this_ptr, "trace", 1);
}
}
if (options) {
- if (Z_TYPE_P(options) == IS_ARRAY) {
+ if (Z_TYPE_P(options) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(options);
zval **tmp;
Z_TYPE_PP(tmp) == IS_STRING) {
soap_action = Z_STRVAL_PP(tmp);
}
- } else if (Z_TYPE_P(options) != IS_NULL) {
+ } else if (Z_TYPE_P(options) != IS_NULL) {
php_error(E_ERROR, "Invalid arguments to SoapClient->__call");
}
}