Solved

New to soap, installing question

Posted on 2009-05-14
5
280 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
[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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 look for a specific file type in a local or remote server directory using PHP.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

630 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