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 688129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:11:53+00:00 2026-05-14T02:11:53+00:00

Given the following code $c= new SoapClient(‘http://www.webservicex.net/CurrencyConvertor.asmx?WSDL’); $usa = USD; $eng = GBP; doing

  • 0

Given the following code

$c= new SoapClient('http://www.webservicex.net/CurrencyConvertor.asmx?WSDL');

$usa = "USD";
$eng = "GBP";

doing a __getTypes on the client gives me

Array ( [0] => struct ConversionRate { Currency FromCurrency; Currency ToCurrency; } [1] => string Currency [2] => struct ConversionRateResponse { double ConversionRateResult; } )

if i then do

$calculation = $c->ConversionRate($usa, $eng);

and print calculation i get an error about

Catchable fatal error: Object of class stdClass could not be converted to string

Is there a specific way i should be printing this out, or i it a bug, from researching / googling many people seem to have a problem but i cant find a suitbale solution, other than downgrading php, which isnt a solution for me as i am doing this as homework and its running off of a college server

  • 1 1 Answer
  • 2 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-14T02:11:53+00:00Added an answer on May 14, 2026 at 2:11 am

    I’m guessing the return type from that function is not a string (or anything with __toString defined). Normally instances of stdClass will have one or more properties which will be of use to you.

    Try doing something like:

    print_r($calculation)
    

    That should tell you what the object has on it, and what it is you might want to do with it. I’d guess you’d want to be printing some property off there along the lines of (example):

    echo $calculation->result;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following example code: somefile = new URL(http://somefile.rar); ReadableByteChannel rbc = Channels.newChannel(somefile.openStream()); FileOutputStream
Given the following code: Hashtable main = new Hashtable(); Hashtable inner = new Hashtable();
Given the following code. EventLoopScheduler scheduler = new EventLoopScheduler(ts => new Thread(ts)); BehaviorSubject<int> subject
Given the following C# code: var product = new List<int>(); for (int n1 =
Given the following example code: new Thread(() => { for(int i = 0; i
Given the following Code. [TestMethod] public void CanResolveILoggerTest() { var Container = new Castle.Windsor.WindsorContainer();
given the following code? final Map<String, List<E>> map = new HashMap<String, List<E>>(); List<E> list
Given the following code: String tmp = new String(\\u0068\\u0065\\u006c\\u006c\\u006f\\u000a); String result = convertToEffectiveString(tmp); //
Given the following code: using Aspose.Cells // {...} Workbook workbook = new Workbook(); Worksheet
So, given the following code: public MyInterface getMyInterface() { return new MyInterface() { public

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.