VC6写的Web service客户端如何连接PHP服务器端 php soap 中有个register方法,用php访问时可以不用,但是不标准,其他语言访问不了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 顶一下,CSDN人气现在怎么也这么差啊 $server = new SoapServer('./wps.wsdl');$soap = new SoapClient('http://localhost/soap/wps.wsdl');这两个黑箱子 还真不知道是啥样的 读读代码吧 两个点之间通讯 需要个协议 例如HTTP协议 PHP应用大多是HTTP协议PHP也支持原生的TCP/IP协议 socket扩展 不过不是很底层 一般应用足够 你可以实现大多数应用 例如游戏外挂 也就是平常说的封包public function connectMaster() { if (@socket_connect($this->socket, $this->config->server->master_ip, $this->config->server->master_port) == false){ $this->log->setLog('ConnectMasterServerError', socket_strerror(socket_last_error())); $this->log->setError(); }else { $this->log->setLog('ConnectmasterServerOK'); } } public function masterLogin($user, $pass) { if ($this->config->server->type == 4) { }else { $msg = pack('v1', 0x64) . pack('V', $this->config->server->version); $msg .= pack('a24', $user) . pack('a24', $pass); $msg .= pack('C*', $this->config->server->master_version); } $this->send($msg); $this->log->setLog('setMasterServer', strlen($msg).'BIT</p>'); }protected function send($msg) { socket_write($this->socket, $msg, strlen($msg)); }RO脱机外挂 登录MAST协议:2位动作编号2位游戏版本号 24位用户名24位密码其余登录服务器版本号 不足用0补齐 $server = new SoapServer('./wps.wsdl'); $soap = new SoapClient('http://localhost/soap/wps.wsdl'); 上面这两个是PHP5内置的Soap类,可以直接用来创建soap服务器端和客户端,但是也正是PHP对soap这种奇怪的实现方法,让VC客户端(如一楼所示代码)无从解读,不是爆错误的编码格式就是直接运行时错误。 最后还是没有弄出来。感觉PHP的SOAP并不通用,无法跟Java里的Soap相比。Axis开发SOAP还是很快的。 个人觉得是structure的问题,我也遇到了这种情况,在php里面直接用字符串作为输入输出参数就可以,但是在vc或者.net生成的wsdl里面,参数进入和返回结果都是用特定的数据类型,在php里面表现为stdClass,你可以看看我写的两篇文章,希望能有帮助。我也因为这个东西折腾了好长事件。http://blog.csdn.net/flowerain/archive/2008/03/30/2229563.aspxhttp://blog.csdn.net/flowerain/archive/2008/05/27/2488213.aspx 新手请教 PhpNewnew 好久不见 请教上传超大附件的解决方法 一个关于传地址的奇怪问题 PHP文件中的<script src='..'> </scirpt>中内容不能显示 求大神指教 直接送打印的问题 存贮在mysql里面的文章如何才能按照原格式显示? PHP4.3.3发布 为什么在有些php文件尾使用exit?ob_start是什么意思? 图片删除之后,显示默认图片,而不是什么都不显示? 电脑断电重启后本地php环境无法运行
{
if (@socket_connect($this->socket, $this->config->server->master_ip, $this->config->server->master_port) == false){
$this->log->setLog('ConnectMasterServerError', socket_strerror(socket_last_error()));
$this->log->setError();
}else {
$this->log->setLog('ConnectmasterServerOK');
}
}
public function masterLogin($user, $pass)
{
if ($this->config->server->type == 4)
{
}else {
$msg = pack('v1', 0x64) . pack('V', $this->config->server->version);
$msg .= pack('a24', $user) . pack('a24', $pass);
$msg .= pack('C*', $this->config->server->master_version);
}
$this->send($msg);
$this->log->setLog('setMasterServer', strlen($msg).'BIT</p>');
}protected function send($msg)
{
socket_write($this->socket, $msg, strlen($msg));
}RO脱机外挂 登录MAST
协议:2位动作编号2位游戏版本号 24位用户名24位密码其余登录服务器版本号 不足用0补齐
$soap = new SoapClient('http://localhost/soap/wps.wsdl'); 上面这两个是PHP5内置的Soap类,可以直接用来创建soap服务器端和客户端,但是也正是PHP对soap这种奇怪的实现方法,让VC客户端(如一楼所示代码)无从解读,不是爆错误的编码格式就是直接运行时错误。
http://blog.csdn.net/flowerain/archive/2008/03/30/2229563.aspx
http://blog.csdn.net/flowerain/archive/2008/05/27/2488213.aspx