#43868 [Asn]: PHP SOAP - Error when parsing (valid) wsdl file..

From: Date: Tue, 29 Jan 2008 12:35:07 +0000
Subject: #43868 [Asn]: PHP SOAP - Error when parsing (valid) wsdl file..
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121727@lists.php.net to get a copy of this message
ID: 43868 User updated by: Michael at Sohmen dot de Reported By: Michael at Sohmen dot de Status: Assigned Bug Type: SOAP related Operating System: Linux / PHP PHP Version: 5.2.5 Assigned To: dmitry New Comment: The point is, PHP SOAP parser should at last allow duplicate function definitions - because wsdl files use this way to serve i.e. overloaded java functions. But stops parsing with error messages 'function already defined'.. Overloading emulation in PHP is not a big problem.. or works fine without if it's just integer / float. Previous Comments: ------------------------------------------------------------------------ [2008-01-29 11:46:23] dmitry@php.net Sorry, but PHP doesn't support overloaded functions and ext/soap is not going to support them too (at least in nearest future). You can emulate overloaded functions using doc/lit encoding. ------------------------------------------------------------------------ [2008-01-16 16:42:09] Michael at Sohmen dot de Description: ------------ Hi, when parsing a wsdl file with _duplicate_ functions defined by <operation name..>, PHP SOAP parser stops with following error message: "Parsing WSDL: <functionname> already defined" The Problem is - duplicate functions are used with function overloading - and o.k. for the Java SOAP interface.. Other way, by automated file generation the following code would produce duplicate function definitions in wsdl, one with 1, second with 2 Params: function foofunction($a, $optional_b = null) I append a bit of wsdl-code which dousn't work as expected as an example; in php_sdl.c I found some lines where most probably the error message is generated, and zend_hash_add(..) fails. Greetings, Michael Reproduce code: --------------- // wdsl example - Problem: [snip] <message name="foofunction"> <part name="a" type="xsd:int"/> <part name="optional_b" type="xsd:int"/> </message> <message name="foofunction"> <part name="a" type="xsd:int"/> </message> operation name="foofunction"> <input message="tns:foofunctionRequest"/> <output message="tns:foofunctionResponse"/> </operation> [snip] // extract from Source php_sdl.c static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include TSRMLS_DC) { [snip] } 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, (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); [snip] Actual result: -------------- Parsing WSDL: <functionname> already defined ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43868&edit=1

« previous php.bugs (#121727) next »