Solved

Soap <element maxOccurs="unbounded"> getting overridden

Posted on 2011-09-16
1
1,075 Views
Last Modified: 2012-08-14
I have a very complex structure to build via PHP and SOAP. I am using an stdObject to build the complex params and then pass them on to the Soap call. Everything was working fine until I needed to add multiple elements of the same complex type. This is giving me problems as they are being overridden.

Complex Type :-

<element name="numDettagliBonusSaldo" type="byte"/>
<element maxOccurs="unbounded" minOccurs="0" name="dettaglioBonusSaldo" type="tns:DettaglioBonus"/>

where DettaglioBonus is :-

<complexType name="DettaglioBonus">
      <sequence>
            <element name="famigliaGioco" type="byte"/>
            <element name="tipoGioco" type="byte"/>
            <element name="importo" type="int"/>
      </sequence>
</complexType>

The problem is when I first create the complex type using e.g. :-

$complex_type->famigliaGioco = 1;
$complex_type->tipoGioco= 1;
$complex_type->importo= 1;

Then I go to include the complex type to the rest of the elements and the second complex type replaces the first one.

$tmp->dettaglioBonusSaldo = $complex_type;

Could you kindly help? I am really stuck.

Modification of the xsd is not possible as I need to follow a very strict protocol.
0
Comment
Question by:drinu78
1 Comment
 

Accepted Solution

by:
drinu78 earned 0 total points
ID: 36548186
I found the solution :-

I had to do :-

$tmp->dettaglioBonusSaldo[0] = $complex_type;
$tmp->dettaglioBonusSaldo[1] = $complex_type;
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Online collaboration is quickly becoming embedded in the workplace, and its benefits are tangible. See what the current landscape looks like and what the future holds for collaboration tools and the future of work.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now