Solved

Soap <element maxOccurs="unbounded"> getting overridden

Posted on 2011-09-16
1
1,066 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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 …
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

758 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

20 Experts available now in Live!

Get 1:1 Help Now