Witam,
Mam prosty serwer SOAP w PHP:
<?php
ini_set("soap.wsdl_cache_enabled", "0");
require_once("Zend/Soap/Server.php");
require_once("Zend/Soap/AutoDiscover.php");
class SoapTracker {
/**
* Returns Hello World.
*
* @param string $name
* @return string
*/
public function SayHello($name) {
return 'Hello' . $name . "!";
}
/**
* Jakas dziwna funkcja testowa.
*
* @return int
*/
public function SayCokolwiek() {
return 28;
}
}
class SoapTracker_LiteralDocumentProxy {
public function __call($methodName, $args) {
$soapClass = new SoapTracker();
$result = call_user_func_array(array($soapClass, $methodName), $args[0]);
return array($methodName . 'Result' => $result);
}
}
if (isset($_GET['wsdl'])) {
$wsdl = new Zend_Soap_AutoDiscover(); // It generates the WSDL
$wsdl->setOperationBodyStyle(array(
'use' => 'literal'
));
$wsdl->setBindingStyle(array(
'style' => 'document'
));
$wsdl->setClass('SoapTracker');
$wsdl->handle();
} else {
$server = new Zend_Soap_Server('http://localhost:8888/SoapTrackerServer/server.php?wsdl');
$server->setClass('SoapTracker_LiteralDocumentProxy');
$server->handle();
}
?>
(kod z manuala)
A klienta chcę napisać w javie. Wszystko jest ok, poza tym, że w kliencie zawsze dostaję null zamiast tekstu/int czy czegokolwiek.
Wie ktoś jak rozwiązać ten problem?