Hi,
I try to developp a php SOAP client write with php 5. I use an axis 2 as WS provider.
To test I use Axis 2 sgccalculator sample and try to call AddService::add methode.
I generated the wsdl file for AddService with Axis 2 Eclipse Wizzard (Java2WSDL) and I introducted it in META-IN directory of the sgccalculator Axis Archive. I deployed the Service with the Axis 2 administration pages.
Now I can access to the wsdl file with this url : http://localhost:8080/axis2/services/AddService?wsdl .
So I write a php client test page like this :
---------------------------------------------------------------------
<?php
$client = new SoapClient(" http://localhost:9393/axis2/services/AddService?wsdl ");
print_r($client);
echo "<br>";
echo "<br>";
var_dump($client->__getFunctions());
echo "<br>";
echo "<br>";
var_dump($client->__getTypes());
echo "<br>";
echo "<br>";
echo "<br>";
$a = 10000;
$b = 20000;
try {
$result = $client->add($a, $b);
}
catch (SoapFault $exception) {
echo "ERROR !!! <br>";
echo $exception;
}
?>
----------------------------------------------------------------
I write you because I add the followind error, and I can't resolve it :
----------------------------------------------------------------
SoapClient Object ( [_soap_version] => 1 [sdl] => Resource id #3 )
array(6) { [0]=> string(51) "addPreviousResponse addPrevious(addPrevious $part1)" [1]=> string(27) "addResponse add(add $part1)" [2]=> string(51) "addPreviousResponse addPrevious(addPrevious $part1)" [3]=> string(27) "addResponse add(add $part1)" [4]=> string(51) "addPreviousResponse addPrevious(addPrevious $part1)" [5]=> string(27) "addResponse add(add $part1)" }
array(4) { [0]=> string(29) "struct add { anyType elem; }" [1]=> string(39) "struct addResponse { anyType return; }" [2]=> string(37) "struct addPrevious { anyType elem; }" [3]=> string(47) "struct addPreviousResponse { anyType return; }" }
ERROR !!!
SoapFault exception: [soapenv:Client] unknown in W:\www\index.php:60 Stack trace: #0 [internal function]: SoapClient->__call('add', Array) #1 W:\www\index.php(60): SoapClient->add(10000, 20000) #2 {main}
----------------------------------------------------------------
Thanks for help ;)
--
Benoit
- Axis 2 Java WS provider + PHP Client problem sentenza
- Re: Axis 2 Java WS provider + PHP Client problem sentenza
- Re: Axis 2 Java WS provider + PHP Client probl... sentenza
- Re: Axis 2 Java WS provider + PHP Client probl... Manuel Ernstberger
- Re: Axis 2 Java WS provider + PHP Client probl... Thilina Gunarathne
