php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43868 PHP SOAP - Error when parsing (valid) wsdl file..
Submitted: 2008-01-16 16:42 UTC Modified: 2008-11-28 14:40 UTC
Votes:6
Avg. Score:4.5 ± 0.8
Reproduced:6 of 6 (100.0%)
Same Version:5 (83.3%)
Same OS:5 (83.3%)
From: Michael at Sohmen dot de Assigned: dmitry (profile)
Status: Not a bug Package: SOAP related
PHP Version: 5.2.5 OS: Linux / PHP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Michael at Sohmen dot de
New email:
PHP Version: OS:

 

 [2008-01-16 16:42 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-29 11:46 UTC] 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-29 12:35 UTC] Michael at Sohmen dot de
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.
 [2008-11-28 14:40 UTC] dmitry@php.net
Duplicate of bug #31248
 [2013-10-15 18:26 UTC] wal3 at mindspring dot com
This problem makes the PHP SoapClient useless for my situation. I need function number 2...
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Jan 18 07:06:35 2022 UTC