首页 > 其他 > 详细

解决SOAP错误[Client] looks like we got no XML document

时间:2014-07-22 08:24:04      阅读:450      评论:0      收藏:0      [点我收藏+]

由于服务器配置不规范等等原因都会导致此类错误,解决:

http://my.oschina.net/cart/

class SoapClientNew extends SoapClient  
{  
    public function __doRequest($request, $location, $action, $version, $one_way = 0)  
    {  
        $request = parent::__doRequest($request, $location, $action, $version, $one_way);  
        
        $start = strpos($request, ‘<soap‘);//根据实际情况做处理。。。,如果是<?xml开头,改成<?xml
        $end = strrpos($request, ‘>‘);  
        return substr($request, $start, $end-$start+1);  
    }  
}
调用:
$client = new SoapClientNew($url);



完美解决!

解决SOAP错误[Client] looks like we got no XML document,布布扣,bubuko.com

解决SOAP错误[Client] looks like we got no XML document

原文:http://my.oschina.net/cart/blog/289747

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!