Page 1 of 1

Soap Extension

Posted: Sat Nov 21, 2009 12:31 pm
by paulholmes13
Hi,

I am having trouble with the PHP SOAP Extension in that it does not seem to parse a complexType

For Example: The WSDL (part of)

Code: Select all

 
- <s:complexType name="ArrayOfpolicyAdditionalItem">
- <s:sequence>
  <s:element minOccurs="0" maxOccurs="unbounded" name="policyAdditionalItem" type="tns:policyAdditionalItem" /> 
  </s:sequence>
</s:complexType>
 
<s:complexType name="ArrayOfdynamicQuestion">
- <s:sequence>
  <s:element minOccurs="1" maxOccurs="1" name="KeyType" type="s:int" /> 
  <s:element minOccurs="1" maxOccurs="1" name="KeyValue" type="s:string" /> 
  <s:element minOccurs="1" maxOccurs="1" name="Description" type="s:string" /> 
  <s:element minOccurs="0" maxOccurs="unbounded" name="dynamicQuestion" type="tns:dynamicQuestion" /> 
  </s:sequence>
</s:complexType>
- <s:complexType name="dynamicQuestion">
- <s:sequence>
  <s:element minOccurs="1" maxOccurs="1" name="QuestionNumber" type="s:int" /> 
  <s:element minOccurs="1" maxOccurs="1" name="Prompt" type="s:string" /> 
  <s:element minOccurs="1" maxOccurs="1" name="InputType" type="tns:inputType" /> 
  <s:element minOccurs="1" maxOccurs="1" name="Mandatory" type="s:boolean" /> 
  <s:element minOccurs="0" maxOccurs="1" name="PossibleAnswers" type="tns:possibleAnswers" /> 
  <s:element minOccurs="0" maxOccurs="1" name="Answer" type="s:string" /> 
  <s:element minOccurs="1" maxOccurs="1" name="Audit" type="tns:audit" /> 
  </s:sequence>
  </s:complexType>
 
When I get the response the parsed code looks like this (ArrayOfdynamicQuestion is empty when in fact the soap response contains data):

Code: Select all

 
                  [88]=>
                  object(policyAdditionalItem)#2261 (5) {
                    ["Key"]=>
                    string(10) "TRADEGROUP"
                    ["Value"]=>
                    object(ArrayOfdynamicQuestion)#2262 (0) {
                    }
                    ["ValueList"]=>
                    object(valueList)#2263 (0) {
                    }
                    ["LinkedItem"]=>
                    string(0) ""
                    ["LinkedField"]=>
                    string(0) ""
                  }
 
I'm not 100% sure if this is a good enough example, my apologies if not but it seems to only fail (not parse back) when a value within a complextype points to another complextype (I think)?

Hope someone can help.

P

Re: Soap Extension

Posted: Sat Nov 21, 2009 3:06 pm
by requinix
What's the spec for the policyAdditionalItem type?

Re: Soap Extension

Posted: Wed Nov 25, 2009 2:12 pm
by paulholmes13
Thanks for the reply tasairis. It turns out that the TP WSDL was incorrect after them denying it.

This line:

<s:element minOccurs="0" maxOccurs="unbounded" name="dynamicQuestion" type="tns:dynamicQuestion" />

Should have read:

<s:element minOccurs="0" maxOccurs="unbounded" name="dynamicQuestionSet" type="tns:dynamicQuestionSet" />

All working as it should be.