码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2014-07-22 08:28:34      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:http   os   io   art   cti   re   

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

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   os   io   art   cti   re   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!