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

前端之家收集整理的这篇文章主要介绍了解决SOAP错误[Client] looks like we got no XML document前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

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

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

猜你在找的XML相关文章