有人知道如何在服务器窗口中显示从客户端收到的消息吗
不幸的是,我在任何地方都找不到示例,当我使用print函数时,不幸的是它不起作用
服务器代码:
#===================================================================
{
function strToHex($string){
$hex = '';
for ($i=0; $i<strlen($string); $i++){
$ord = ord($string[$i]);
$hexCode = dechex($ord);
$hex .= substr('0'.$hexCode, -2);
}
return strToUpper($hex);
}
$str = '';
class PPRSrv {
public function simpleService($str){
$str = (strToHex($str));
print$str;
}
}
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
session_start();
$opt = array( 'uri' => 'http://10.0.2.15/SOAP/PHP2/srv.php' );
$srv = new SoapServer( NULL, $opt );
$srv->setClass('PPRSrv');
while(1 == True){
$srv->handle();
}
}
#===================================================================
?>
客户端代码:
from suds.client import Client
url = 'http://localhost/SOAP/PHP2/srv.wsdl'
client = Client(url)
print(client)
print("Podaj argument, ktory chcesz wyslac do serwera : ")
par1 = input()
result = client.service.simpleService(par1)
print("Wynik : ")
print(result)
目前没有回答
相关问题 更多 >
编程相关推荐