Jump to content


Photo

PHP5 Native SOAP


  • Please log in to reply
1 reply to this topic

#1 gmwebs

gmwebs
  • Members
  • PipPipPip
  • Advanced Member
  • 174 posts
  • LocationLondon

Posted 13 June 2006 - 11:35 PM

I think I have followed every tutorial on the internet at this point, and I am just not getting anywhere. Granted, it may be an issue on my servers, but I don't see how this could be.

I am running Fedora Core 5, Apache 2.x, PHP 5.1.4 (with SOAP extension enabled). This is all confirmed when looking at output from phpinfo().

I have created the most simple of SOAP clients, and tried to connect to the most simple of SOAP servers, but nothing. I get no response returned from the SOAP server at all.

soapclient.php

<?php
$echo = $_GET['input'];

print "<h2>Echo Web Service</h2>";
print "<form action='soapclient.php' method='GET'/>";
print "<input name='input' value='$echo'/><br/>";
print "<input type='Submit' name='submit' value='GO'/>";
print "</form>";

$client = new SoapClient(null, array('location' => "soapserver.php",'uri' => "urn://tyler/req"));

$result = $client->__soapCall("echoo",array($echo));

print $result;
print "<pre>\n";
print "Request :\n".htmlspecialchars($client->__getLastRequest()) ."\n";
print "Response:\n".htmlspecialchars($client->__getLastResponse())."\n";
print "</pre>";

?>


soapserver.php

<?php 

function echoo($echo){
return "ECHO: ".$echo;
}

$server = new SoapServer(null, array('uri' => "urn://tyler/res"));
$server->addFunction('echoo');
$server->handle();

?>

You enter something in the text box, press submit, and it should show what you typed in the text box which is returned by the SOAP server. Well I get nothing back.

These scripts are on the same server for now, in the same folder as each other. What I was trying to replicate, is a webserver and a soapserver, where the webserver hosts the web application, and the soapserver hosts the web services. I couldn't get that far, as I can't even get it to work on one server let alone 2!

If anybody can help me out it would be great. Otherwise, if anyone knows of a *definitive* guide to using PHP5 *native* SOAP extensions, then please point me there. I have spent hours on this, have been through countless code snippets including WSDL ones, and have created ones from scratch by following the php manual.

Thanks...

#2 gmwebs

gmwebs
  • Members
  • PipPipPip
  • Advanced Member
  • 174 posts
  • LocationLondon

Posted 14 June 2006 - 09:40 PM

Ok well I solved it... SELinux was getting in the way. Hours and hours of time wasted...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users