?
Solved

Soap <element maxOccurs="unbounded"> getting overridden

Posted on 2011-09-16
1
Medium Priority
?
1,100 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

777 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