Solved

New to soap, installing question

Posted on 2009-05-14
5
271 Views
Last Modified: 2013-12-13
Hi all,

I want to start using soap and I have certain problems with the installation.
My PHP version is 5.2.5 and I'm working on Windows. I've read that with this version number I don't need to install anything but the script below shows nothing, a blank page.

What do I have to do to get soap running?

Thanks a ton in advance!  
<?php 
 

   $client = new SoapClient

      ("http://www.xmethods.net/sd/2001/DemoTemperatureService.wsdl");

   echo("\nReturning value of getTemp() call: ".

      $client->getTemp("12345"));

?>

Open in new window

0
Comment
Question by:Dada44
  • 3
  • 2
5 Comments
 
LVL 39

Expert Comment

by:Roger Baklund
ID: 24386613
Are you sure that wsdl exists? I get this when I request it in the browser:

The requested URL /sd/2001/DemoTemperatureService.wsdl was not found on this server.
0
 
LVL 39

Expert Comment

by:Roger Baklund
ID: 24386864
When doing the call, fetch the result and use var_dump() to see the properties:

$res = $client->getTemp("12345");
var_dump($res);
0
 

Author Comment

by:Dada44
ID: 24387015
if I do:
$res = $client->getTemp("12345");
var_dump($res);
nothing shows, blank page again :(
Can you give me please a wsdl  that you know for sure it works? it's hard to tell when you're this newbie :)
Thanks!
0
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 500 total points
ID: 24387195
Here is one:
$wsdl = 'http://www.ecubicle.net/iptocountry.asmx?wsdl';

$client = new soapclient($wsdl);

$param = array('V4IPAddress'=>'64.156.132.140');

$res = $client->FindCountryAsString($param);

var_dump($res);

echo "<br />Country:".$res->FindCountryAsStringResult;

Open in new window

0
 

Author Closing Comment

by:Dada44
ID: 31581539
Thanks!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now