Same s:complexType and s:element name

84 views
Skip to first unread message

jan....@ui42.com

unread,
Sep 11, 2015, 3:44:39 AM9/11/15
to wsdl2phpgenerator
Hello,

in provided WSDL I get the same name for s:complexType and s:element
<s:complexType name="Zajezd">
<s:element name="Zajezd">

According to http://stackoverflow.com/questions/11981855/element-name-and-complex-type-name-are-same there is no problem with xsd definition, but wsdl2phpgenerator doesn't generate proper PHP classes, it only generates class Zajezd for s:complexType, so there is no way I can use s:element Zajezd class

Is this a bug, or am I missing something?

Thanks in advance

lae...@googlemail.com

unread,
Sep 28, 2015, 3:38:08 AM9/28/15
to wsdl2phpgenerator, jan....@ui42.com
In general there should be no need to generate any class for "elements" what is your use case? Keep in Mind that PHP does not care much about the xsd structure but only transforms PHP-Objects into XML, so your object must represent all data of the TYPE of an element and not the element itself.

Jan Vallo

unread,
Oct 12, 2015, 3:15:59 AM10/12/15
to lae...@googlemail.com, wsdl2phpgenerator
Greetings,

in my case wsdl contains method Hotel(), which uses input element Hotel. Result of this method contains array of output complexType Hotel, this complex type is different from the input element.
In our client's wsdl, this is common case, there are more methods which use input element with the same name as output complexType.
Problematic part is class generation, in some cases only the input class is generated, in other cases only the output class is generated. Here comes the real problem, when the output class is generated, f.e. Hotel class, I cannot call webservice, because php method Hotel requires input class Hotel via typehinting, I cannot create new Hotel class, because it's already in use as output class. VIce-versa, when the input object is created and I call webservice, it returns input object, which couldn't be populated with request data so it seems empty.
It's quite unhappy solution to name input and output objects the same, but we cannot do anything with the wsdl provided, and it's valid schema.

Best Regards
Jan Vallo

Kasper Garnæs

unread,
Oct 19, 2015, 10:52:33 AM10/19/15
to wsdl2phpgenerator, lae...@googlemail.com, jan....@ui42.sk
This sounds like a bug to me.

Is it possible to get one of you to create an issue for this on GitHub and attach an example WSDL which documents the problem?

Thanks in advance.

Christoph Läubrich

unread,
Oct 19, 2015, 11:01:47 AM10/19/15
to wsdl2phpgenerator
Hi,

so you have two ComplexTypes with the same name but in different Namespaces correct?
I have also facing this issue and was hopping that the latest version of WSDL Generator with namspace support fixes this problem. Sadly there is atm no cli version avaiable so I have not tested it yet.

Beside this I'm not sure if the PHP Soap implementation can handle this at all because afaik the classmap does not support (xml) namespacing so even if the WSDL Generator would generate two classes (in different php namespaces) there would be a name clash.

There might be a kind of workaround to prefer Input-Types over output types then but this might be out of the current scope of WSDL Generator. At least the Generator should spitt out some kind of warning if it encounters a name-clash.
Reply all
Reply to author
Forward
0 new messages