我的server 端 :(只是结构,具体方法没实现呢)
<?phpclass clientsoap{
public function Login($id) {
$fp=fopen("1.txt", "a");
fwrite($fp, $id."\n");
fclose($fp);
return 30;
}
public function Logout($id) {
return 0;
}
public function Register($id) {
}
public function Unregister($id) {
}
public function Report($id, $headers, $content) {
}
public function UpdataStatus($id) {
}}
$server=new SoapServer("client.wsdl",array('soap_version'=>SOAP_1_2));
$server->setClass('clientsoap');
$server->handle();?>请问我应该如何修改wsdl 以适用于我的server端呢? 我的server端只是方法没实现,接口跟wsdl给的几乎差不多~
<?phpclass clientsoap{
public function Login($id) {
$fp=fopen("1.txt", "a");
fwrite($fp, $id."\n");
fclose($fp);
return 30;
}
public function Logout($id) {
return 0;
}
public function Register($id) {
}
public function Unregister($id) {
}
public function Report($id, $headers, $content) {
}
public function UpdataStatus($id) {
}}
$server=new SoapServer("client.wsdl",array('soap_version'=>SOAP_1_2));
$server->setClass('clientsoap');
$server->handle();?>请问我应该如何修改wsdl 以适用于我的server端呢? 我的server端只是方法没实现,接口跟wsdl给的几乎差不多~
主要给我说说需要改什么地方就好了啊~ 谢谢各位啦~~
大侠帮帮我呗~~
Debug Warning: /services/testClient.php line 2 - SoapClient::SoapClient(http://192.168.0.251/services/client.asmx?WSDL) [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Service ErrorDebug Warning: /services/testClient.php line 2 - SoapClient::SoapClient() [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: I/O warning : failed to load external entity "http://192.168.0.251/services/client.asmx?WSDL"
Debug Error: /services/testClient.php line 2 - SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://192.168.0.251/services/client.asmx?WSDL' : failed to load external entity "http://192.168.0.251/services/client.asmx?WSDL"Debug Error: /services/testClient.php line 2 - Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://192.168.0.251/services/client.asmx?WSDL' : failed to load external entity "http://192.168.0.251/services/client.asmx?WSDL"
in D:\PHPWeb\services\testClient.php:2
Stack trace:
#0 D:\PHPWeb\services\testClient.php(2): SoapClient->SoapClient('http://192.168....')
#1 C:\Users\Echo\AppData\Local\Temp\dummy.php(1): include('D:\PHPWeb\servi...')
#2 {main}
thrown
这是我写的客户端:<?php
$client= new SoapClient("http://192.168.0.251/services/client.asmx?WSDL");
/*$client= new SoapClient("http://219.238.45.138/services/client.asmx?WSDL");*/
var_dump($client->__getFunctions(),"<br><br><br>",$client->__getTypes());
echo "<br><br><br><br>";
$a=$client->Login("D200F1E2-C364-16CB-A0CF-CC59E7380E45");
var_dump($a);
/*$client->Unregister("FABD9CF5-5F0C-88FA -68FF-7BAC89260335");*/
/*echo "D200F1E2-C364-16CB-A0CF-CC59E7380E45";*/
echo "<br><br><br>";
var_dump($client->__getLastRequest());
echo "<br>";
var_dump($client->__getLastRequestHeaders());
?>