[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Soap <element maxOccurs="unbounded"> getting overridden

Posted on 2011-09-16
1
Medium Priority
?
1,109 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

When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot has fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

649 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