I am using this module (thanks!) for a SOAP endpoint that has some datatypes with no actual property info, but rather is referred to in another property type:
http://preview.mindbodyonline.com/api/0_5/FinderService.asmx?wsdl
for example, the 'Item' datatype here has no properties, but seems like a meta type for other datatypes :
<s:complexType name="Item"/>
<s:complexType name="Service">
<s:complexContent mixed="false">
<s:extension base="tns:Item">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Price" type="s:decimal"/>
<s:element minOccurs="0" maxOccurs="1" name="OnlinePrice" type="s:decimal"/>
<s:element minOccurs="0" maxOccurs="1" name="Action" type="tns:ActionCode"/>
<s:element minOccurs="0" maxOccurs="1" name="ID" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Name" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Count" nillable="true" type="s:int"/>
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>
With no valid property info, the rules.inc function wsclient_type_info_populate chokes on line 105:
$info['property info'] = $all_types[$type]['property info'];
This renders the entire site in an unusable state as rules module throws a bunch of errors continuously. Recommendations about handling this? Currently in the if block on line 102 I have changed this:
if (!isset($info['property info']) && isset($all_types[$type]) && !isset($recursion_stop[$type])) {
to this:
if (!isset($info['property info']) && isset($all_types[$type]['property info']) && !isset($recursion_stop[$type])) {
This stops the errors, but I was wondering if anyone knows what the consequences of this might be?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1213272-wsclient-soap-empty-types.patch | 637 bytes | klausi |
Comments
Comment #1
klausiThis WSDL contains complex data structures that have no properties, which is quite weird. Maybe they will be used later? However, here is a patch that initializes empty structures correctly. Please delete and re-add your service after applying the patch and report back
Comment #2
wesnick commentedThanks for the patch klausi, this indeed allows rules to process the datatype info now, the net result is the same as my little hack: this datatype appears in the datatypes set, but with no properties, as before. Since I most likely won't be using rules with this API, this solution will work.
Comment #3
klausiAnd committed to dev.