Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4545970
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:53:17+00:00 2026-05-21T15:53:17+00:00

I am using PHP 5.2.10 and I am trying to consume a webservice which

  • 0

I am using PHP 5.2.10 and I am trying to consume a webservice which returns complex data types using the standard SOAP extension.

The problem is that SoapClient does not populate objects which are nested into other objects / array of objects. A simplified example of what I get when I call the getUtente method, specifying “my_unique_id” as a parameter is:

stdClass Object
(
    [getUtenteReturn] => stdClass Object
        (
            [userName] => my_unique_id
            [fieldOne] => ...
            [fieldTwo] => ...
            [utilizzatore] => stdClass Object
                ( // This is EMPTY instead of containing a series of userName's
                )

        )

)

The relevant part of the WDSL description is:

<element name="getUtenteResponse">
  <complexType>
    <sequence>
      <element name="getUtenteReturn" type="tns1:Cliente"/>
    </sequence>
  </complexType>
</element>
...
<complexType name="Utilizzatore">
  <sequence>
    <element name="userName" nillable="true" type="xsd:string"/>
  </sequence>
</complexType>
...
<complexType name="Cliente">
  <complexContent>
    <extension base="tns1:Utilizzatore">
      <sequence> 
        <element name="fieldOne" nillable="true" type="xsd:string"/>
        <element name="fieldTwo" nillable="true" type="xsd:string"/>
        <element name="utilizzatore" nillable="true" type="impl:ArrayOf_tns1_Utilizzatore"/>
      </sequence>
    </extension>
  </complexContent>
</complexType>

What I found I am not the only one experiencing this problem. In particular I found this comment in the PHP official documentation and this other forum entry to give two different ideas on how to approach the problem, but I have not been able to turn any of those two ideas into a working solution: I seem not to completely understand the logic behind the examples given.

I would be grateful if anybody could guide me in this: some working code on another webservice would be welcome, but what I am primarily after is really understanding the problem and the logic of the solutions proposed (the fish lane, not the fish!). 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T15:53:18+00:00Added an answer on May 21, 2026 at 3:53 pm

    Old question, no answer. I recently stumbled on this post, that explains the problem and gives a solution: Consuming SOAP complexType webservice with PHP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a stateful web service in PHP using the SOAP extension.
I'm trying to consume a hello world AXIS2 SOAP web service using a PHP
I'm using PHP 4.3.9, Apache/2.0.52 I'm trying to get a login system working that
I'm trying to call a php webservice using WCF. I googled some public php
So, I'm trying to consume a webservice using something like this: $client = new
Using php, I'm trying to create a script which will search within a text
Using PHP and MySQL, I have a forum system I'm trying to build. What
I'm trying to scrape a price from a web page using PHP and Regexes.
I'm trying to write someting into the DB using PHP but if I try
I am trying to call a COM object from PHP using the COM interop

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.