Your script as posted above works for me, but with a connection refused for the resource URL.
if you call phpinfo(); do you get a "soap" section that shows client and server enabled?
Your script as posted above works for me, but with a connection refused for the resource URL.
if you call phpinfo(); do you get a "soap" section that shows client and server enabled?
you can also get nuSoap, ( just google it for a download ), if you don't want to recompile PHP to enable SOAP support.
Hi!
"
Error
no transport found, or selected transport is not yet supported!
Request
Response
Debug
2007-10-16 20:15:45.417776 soapclient2: call: operation=ManufacturerSearchRequest, namespace=http://soap.amazon.com, soapAction=http://soap.amazon.com, rpcParams=, style=rpc, use=encoded, endpointType=
params=array(7) {
["manufacturer"]=>
string(8) "O'Reilly"
["page"]=>
string(1) "1"
["mode"]=>
string(5) "books"
["tag"]=>
string(15) "trachtenberg-20"
["type"]=>
string(4) "lite"
["devtag"]=>
string(14) "D35PWRR0R0URC3"
["sort"]=>
string(6) "+title"
}
headers=bool(false)
2007-10-16 20:15:45.477325 soap ................
etc.............
My example script was (a fragment of it):
"
<?php
/*
$Id: client1.php,v 1.1 2004/01/09 03:23:42 snichol Exp $
*
Client sample that should get a fault response.
*
Service: SOAP endpoint
Payload: rpc/encoded
Transport: http
Authentication: none
*/
require_once('../lib/nusoap.php');
$proxyhost = isset($POST['proxyhost']) ? $POST['proxyhost'] : '';
$proxyport = isset($POST['proxyport']) ? $POST['proxyport'] : '';
$proxyusername = isset($POST['proxyusername']) ? $POST['proxyusername'] : '';
$proxypassword = isset($POST['proxypassword']) ? $POST['proxypassword'] : '';
$client = new soapclient2("http://soap.amazon.com/onca/soap2", false,
$proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}...........
"
regards
francisco
Hi!
it seams that client/server attributes are enabled, please have a look:
========================================================
"phpinfo()
PHP Version => 5.1.2
System => Linux violinux2 2.6.16.27-0.9-default #1 Tue Feb 13 09:35:18 UTC 2007 i686
Build Date => Jul 30 2007 14:58:06
Configure Command => '../configure' '--prefix=/usr' '--datadir=/usr/share/php5' '--mandir=/usr/share/man' '--bindir=/usr/bin' '--with-libdir=lib' '--includedir=/usr/include' '--sysconfdir=/etc/php5/cli' '--with-config-file-path=/etc/php5/cli' '--with-config-file-scan-dir=/etc/php5/conf.d' '--with-exec-dir=/usr/lib/php5/bin' '--enable-magic-quotes' '--enable-libxml' '--enable-session' '--with-mm' '--with-pcre-regex' '--enable-xml' '--enable-simplexml' '--enable-spl' '--enable-safe-mode' '--disable-debug' '--enable-memory-limit' '--enable-inline-optimization' '--enable-zend-multibyte' '--disable-rpath' '--enable-cli' '--with-pear=/usr/share/php5/PEAR' '--enable-bcmath=shared' '--enable-calendar=shared' '--enable-ctype=shared' '--enable-dbase=shared' '--enable-dom=shared' '--enable-exif=shared' '--enable-filepro=shared' '--enable-ftp=shared' '--enable-mbstring=shared' '--enable-mbregex' '--enable-pcntl=shared' '--enable-posix=shared' '--enable-shmop=shared' '--enable-ucd-snmp-hack' '--enable-soap=shared' '--enable-socke...
" ( look at the last line)
and
"soap
Soap Client => enabled
Soap Server => enabled
"
but this was under the command 'php5 -i'
other way , using the command phpinfo() in the script I had:
"
../configure' '--prefix=/usr' '--datadir=/usr/share/php5' '--mandir=/usr/share/man' '--bindir=/usr/bin' '--with-libdir=lib' '--includedir=/usr/include' '--sysconfdir=/etc/php5/apache2' '--with-config-file-path=/etc/php5/apache2' '--with-config-file-scan-dir=/etc/php5/conf.d' '--with-exec-dir=/usr/lib/php5/bin' '--enable-magic-quotes' '--enable-libxml' '--enable-session' '--with-mm' '--with-pcre-regex' '--enable-xml' '--enable-simplexml' '--enable-spl' '--enable-safe-mode' '--disable-debug' '--enable-memory-limit' '--enable-inline-optimization' '--enable-zend-multibyte' '--disable-rpath' '--with-apxs2=/usr/sbin/apxs2' '--disable-all' '--disable-cli'
"
where we can not see the soap enabled (?!) and at the same I can not see the attributes
soap server or client enable
regards
francisco
troybtj wrote:Your script as posted above works for me, but with a connection refused for the resource URL.
if you call phpinfo(); do you get a "soap" section that shows client and server enabled?
Hi!
it seams that client/server attributes are enabled, please have a look:
========================================================
"phpinfo()
PHP Version => 5.1.2
System => Linux violinux2 2.6.16.27-0.9-default #1 Tue Feb 13 09:35:18 UTC 2007 i686
Build Date => Jul 30 2007 14:58:06
Configure Command => '../configure' '--prefix=/usr' '--datadir=/usr/share/php5' '--mandir=/usr/share/man' '--bindir=/usr/bin' '--with-libdir=lib' '--includedir=/usr/include' '--sysconfdir=/etc/php5/cli' '--with-config-file-path=/etc/php5/cli' '--with-config-file-scan-dir=/etc/php5/conf.d' '--with-exec-dir=/usr/lib/php5/bin' '--enable-magic-quotes' '--enable-libxml' '--enable-session' '--with-mm' '--with-pcre-regex' '--enable-xml' '--enable-simplexml' '--enable-spl' '--enable-safe-mode' '--disable-debug' '--enable-memory-limit' '--enable-inline-optimization' '--enable-zend-multibyte' '--disable-rpath' '--enable-cli' '--with-pear=/usr/share/php5/PEAR' '--enable-bcmath=shared' '--enable-calendar=shared' '--enable-ctype=shared' '--enable-dbase=shared' '--enable-dom=shared' '--enable-exif=shared' '--enable-filepro=shared' '--enable-ftp=shared' '--enable-mbstring=shared' '--enable-mbregex' '--enable-pcntl=shared' '--enable-posix=shared' '--enable-shmop=shared' '--enable-ucd-snmp-hack' '--enable-soap=shared' '--enable-socke...
" ( look at the last line)
and
"soap
Soap Client => enabled
Soap Server => enabled
but this was under the command 'php5 -i'
other way , using the command phpinfo() in the script I had:
"
../configure' '--prefix=/usr' '--datadir=/usr/share/php5' '--mandir=/usr/share/man' '--bindir=/usr/bin' '--with-libdir=lib' '--includedir=/usr/include' '--sysconfdir=/etc/php5/apache2' '--with-config-file-path=/etc/php5/apache2' '--with-config-file-scan-dir=/etc/php5/conf.d' '--with-exec-dir=/usr/lib/php5/bin' '--enable-magic-quotes' '--enable-libxml' '--enable-session' '--with-mm' '--with-pcre-regex' '--enable-xml' '--enable-simplexml' '--enable-spl' '--enable-safe-mode' '--disable-debug' '--enable-memory-limit' '--enable-inline-optimization' '--enable-zend-multibyte' '--disable-rpath' '--with-apxs2=/usr/sbin/apxs2' '--disable-all' '--disable-cli'
"
where we can not see the soap enabled (?!) and at the same I can not see the attributes
soap server or client enable
so the problem is : how to enable soap extension without reinstall php5?
regards
francisco
Are you trying to run this from the command line?
See which php binary is used by your webserver setup, then use which php5
(on a *nix system) to make sure you are calling the same binary. Sounds like you might have 2 versions installed, one in your shell path, and one for your webserver.
Or, if this is a shell application (CLI), you might need to tweak the php.ini for the CLI (path shown below as /etc/php5/cli/php.ini) on a Debian Etch system.
php5 --info
phpinfo()
PHP Version => 5.2.0-8+etch7
System => Linux mail 2.6.18 #1 SMP Tue Jun 26 03:29:13 CDT 2007 i686
Build Date => Jul 2 2007 21:44:16
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php5/cli/php.ini
Scan this dir for additional .ini files => /etc/php5/cli/conf.d
additional .ini files parsed => /etc/php5/cli/conf.d/mysql.ini,
/etc/php5/cli/conf.d/mysqli.ini,
/etc/php5/cli/conf.d/odbc.ini,
/etc/php5/cli/conf.d/pdo.ini,
/etc/php5/cli/conf.d/pdo_mysql.ini,
/etc/php5/cli/conf.d/pdo_odbc.ini,
/etc/php5/cli/conf.d/pdo_pgsql.ini,
/etc/php5/cli/conf.d/pgsql.ini,
/etc/php5/cli/conf.d/sybase_ct.ini,
/etc/php5/cli/conf.d/tidy.ini,
/etc/php5/cli/conf.d/xmlrpc.ini
......
soap
Soap Client => enabled
Soap Server => enabled
Directive => Local Value => Master Value
soap.wsdl_cache => 1 => 1
soap.wsdl_cache_dir => /tmp => /tmp
soap.wsdl_cache_enabled => 1 => 1
soap.wsdl_cache_limit => 5 => 5
soap.wsdl_cache_ttl => 86400 => 86400
Hi Troybtj!
you are right, there were two different versions, but I applied an upgrade to the php5 for the webserver and the things start to go on; the 'SoapServer' and 'SoapClient' classes are now recognized and I'm trying to put the server 'Hello' example in a good way, but it seams that this time the problem is in the ' ...wsdl' file;
To demonstrate to you that the things are in a better way now, I submitted a client example to the GoogleSearch (a Google soap server) and it worked well;
I will test a little more my server example and then, if you want, I could report to you the difficulty.
regards
francisco
What is the full error message with the WDSL?
--EDIT: If you installed nuSoap, make sure to remove it if using the native SOAP.
Hi Troybtj!
I'm trying to post the scripts to you but I think they are too long and the reply system don't accept it, what could I do?
francisco
the reply error:
"
You have included 14 images in your message. You are limited to using 5 images so please go back and correct the problem and then continue again.
Images include use of smilies, the vB code [img] tag and HTML <img> tags. The use of these is all subject to them being enabled by the administrator.
"
here a slice of my reply :
I've just arrived to a good result for a first 'greet' example (listed below as 'Number one')
But I still have a problem with a second example (I'll try to send the 'Number two' in another reply - here I had overflow.); If you could analyse
and give me a help I would be grateful
regards francisco
======================================================
'Number one' (ok) : adding a function 'greet'
..................
it runs ok
the scripts are:
CLIENT - TopXMLCLT3.php
------
<?php
try
{
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient('hello4.wsdl');
$result = $client->soapCall('greet', array(array('name' => 'Chicao313')));
echo "Result = ". $result->greetReturn;
//printf("Result = %s\n", $result->greetReturn);
}
catch (Exception $e)
{
echo "Error message = ".$e->toString();
//printf("Message = %s\n",$e->__toString());
}
?>
SERVER - TopXMLSRV3.php
------
<?php
function greet($param)
{
$retval = 'Hello11 '.$param->name;
$result = array('greetReturn' => $retval);
return $result;
}
$server = new SoapServer('hello4.wsdl'); //not sure of this
$server->addFunction('greet');
$server->handle();
?>
WSDL
-----
<?xml version='1.0' ?>
<wsdl:definitions
xmlns:impl='helloService'
xmlns:intf='helloService'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns:wsdlsoap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
targetNamespace='helloService'>
etc etc ...
I can not post the two scripts, maybe because the text become too long, what could I do?
francisco
How many lines of code are there in the two scripts?
Not sure why you'd be getting the image warning posting code.
To make sure I understand, the core client/server are working now (using a known working test script), but your code isn't?
Troybtj I've just uploaded a text file containing the two examples (the first one that worked in my server, and the second one that has still not worked; I am not sure if you can access this text file uploaded ( named 'number12'), can you?
I can not see it in my account panel, so I am not sure if the upload transfert worked well (?!).
If it is ok you will find there, everything to analyse them.
francisco