PHP to Perl to PHP
| From: | Rudi Starcevic | Date: | Thu, 12 Sep 2002 10:28:51 +0000 |
| Subject: | PHP to Perl to PHP | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-246@lists.php.net to get a copy of this message | ||
Hi Shane,
Thanks for your time,
I've got some more code for you to check out.
First is my PHP response code ( I've included the entire source ) :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
OUTGOING:
POST HTTP/1.0
User-Agent: PEAR-SOAP 0.6.2
Host: central
Content-Type: text/xml; charset=UTF-8
Content-Length: 452
SOAPAction: ""
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:data"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns4:sales/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
INCOMING
<br>soap_fault Object
(
[error_message_prefix] =>
[mode] =>
[level] => 1024
[code] => HTTP
[message] => Connect Error to central:10000
[userinfo] => 1024
[callback] =>
)
<br>
</body>
</html>
Here is my PHP source code again :
<?php
include("SOAP/Client.php");
$soapclient = new SOAP_Client("http://central:10000");
$namespace = 'urn:data';
$ret = $soapclient->call("sales",NULL,$namespace);
print $soapclient->wire;
echo "<br>";
print_r($ret);echo "<br>\n";
?>
My Perl SOAP server code :
#!/usr/bin/perl -w
use SOAP::Transport::HTTP;
# don't want to die on 'Broken pipe' or Ctrl-C
$SIG{PIPE} = $SIG{INT} = 'IGNORE';
my $daemon = SOAP::Transport::HTTP::Daemon
-> new (LocalPort => 10000 , Reuse => 1)
-> dispatch_to('/home/soaplite/modules')
;
In /home/soaplite/modules I have data.pm with this code:
package data;
sub sales {
return "sales data";
}
1;
Thanks I'm looking forward to getting this one up.
I know it's something small.
The correct output should simply be the string "sales data".
Cheers
Rudi.