Soap Extension

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
paulholmes13
Forum Newbie
Posts: 2
Joined: Sat Nov 21, 2009 12:16 pm

Soap Extension

Post 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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Soap Extension

Post by requinix »

What's the spec for the policyAdditionalItem type?
paulholmes13
Forum Newbie
Posts: 2
Joined: Sat Nov 21, 2009 12:16 pm

Re: Soap Extension

Post 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.
Post Reply