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

  • SEARCH
  • Home
  • 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 9281383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:06:23+00:00 2026-06-18T18:06:23+00:00

I am learning about SOAP for a project and I now understand the basics

  • 0

I am learning about SOAP for a project and I now understand the basics of it. Can’t believe I’ve never tried using this before. It’s great. But anyway, to my problem.

I have managed to successfully print the response of my request to the web browser but I cannot seem to convert this response into an STD object.

I’ve been following a tutorial and adapting it to a different WDSL file to fully understand what I’m doing.

This is my PHP file.

<?

//////////////////////////////////////
//
//  ABOUT:      This file will send a request to the WSDL file and return a result in the browser window
//  AUTHOR:     Brad Bird
//  DATE:       07/02/2013
//
//////////////////////////////////////

// Setup the SOAP Client options
$wsdl = "http://www.mobilefish.com/services/web_service/countries.php?wsdl";
$options = array(
    "trace" => 1,
    "exception" => 0
);

// Creates new instance of the SOAP Client
$client = new SoapClient($wsdl, $options);

// Return a set of information using one function
$countryCode = "af";
$values = $client->countryInfoByIana($countryCode);

// Prints the details of the request and response to the browser
print "<h2>SOAP Details</h2>";
print "<pre>";
print "<h3>Request</h3> " . htmlspecialchars($client->__getLastRequest()) . "<br />";
print "<h3>Response</h3> " . htmlspecialchars($client->__getLastResponse());
print "</pre>";

// Prints the request in XML format
$xml = $values->countryInfoByIanaResponse;

print "<h2>stdClass Object</h2>";
print "<pre>";
print_r($xml);
print "</pre>";

And this WSDL file I’m trying to get request from is here.
http://www.mobilefish.com/services/web_service/countries.php?wsdl

For some reason the STD Object section is showing nothing. Any ideas?

  • 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-06-18T18:06:24+00:00Added an answer on June 18, 2026 at 6:06 pm

    Well, $xml is not an object of stdClass, but null. $values however is. $values->countryInfoByIanaResponse does not exist. All you have in $values is

    : object(stdClass) = 
      ianacode: string = "af"
      countryname: string = "Afghanistan"
      latitude: double = 33.93911
      longitude: double = 67.709953
    

    Not sure what exactly what you are trying to do – maybe call a method on the $client rather than on your result?
    Also, check the PHP manual on error_reporting, you would then have stumbled across this Notice: Undefined property: stdClass::$countryInfoByIanaResponse in the print_r line.

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

Sidebar

Related Questions

Just learning about with statements especially from this article question is, can I pass
Just learning about State monad from this excellent tutorial . However, when I tried
I am learning about raw sockets. I heard that ping utility is using raw
I've been learning about divs over the past few months, and am now able
I'm currently learning about cube mapping, I found this tutorial: http://www.keithlantz.net/2011/10/lighting-and-environment-mapping-with-glsl/ He transform normal
Just started learning about SQL, and doing very basic stuff using SQLPlus. I've literally
Just learning about sql joins and things, and I have a question. Can you
While learning about python, I came upon this code, which takes a text file,
I'm currently learning about concurrency in C++ and came across using a vector of
So been a few days now learning about web references within my projects I

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.