Php SoapFault异常:[HTTP]未知协议。只允许http和https

Php SoapFault异常:[HTTP]未知协议。只允许http和https,php,soap,axis2,Php,Soap,Axis2,我不熟悉axis2和php。 我需要实现client.php,它将基于端口8282上的中间件执行一些操作。我的问题是我的本地主机是8080,我无法访问中间件。代码如下: <?php class ScriptSoapClient extends SoapClient { public function __doRequest($request,$location,$action,$version,$one_way=0) { $response=parent::__do

我不熟悉axis2和php。 我需要实现client.php,它将基于端口8282上的中间件执行一些操作。我的问题是我的本地主机是8080,我无法访问中间件。代码如下:

<?php
class ScriptSoapClient extends SoapClient {
    public function __doRequest($request,$location,$action,$version,$one_way=0) {
        $response=parent::__doRequest($request,$location,$action,$version,$one_way);
        $response=preg_replace('#^.*(<\?xml.*>)[^>]*$#s','$1',$response);
        return $response;
    }
}
// | is used as splitting char for arrays
function runService() {
    //global $KERNELURL;
    $KERNELURL="127.0.0.1:8282/axis2/services/MiddleService?wsdl"; $num=func_num_args();
    if ($num < 2) return;

    $service=new ScriptSoapClient(null, array("location"=> $KERNELURL,"uri"=>"http://ws.apache.org/axis2","trace"=>true));
    $p[0]=new SoapParam((string)func_get_arg(0),"p1");
    $p[1]=new SoapParam((string)func_get_arg(1),"p2");
    for ($i=2; $i < $num-1;$i++) {
        $param=func_get_arg($i);
        if (is_array($param)) {
            $data="||ARR||".implode("|",$param);
        } else {
            $data=$param;
        }
        $p[$i]=new SoapParam((string)$data,"p3");
    }
    $p[$num-1]=new SoapParam((string)func_get_arg($num-1),"p4");
    try {
        $result=$service->__soapCall("run",$p);
    } catch (SoapFault $e) {
        echo $e;
        return "error";
    }
    unset($service);
    if (is_array($result)) {
        return $result["return"];
    } else {
        return $result;
    }
}
$res2=runService("Service_addCostume","addCostume","costum1");
?> 

在$KERNELURL

之前添加一个http://尝试在
$KERNELURL
之前添加一个
http://
SoapFault exception: [HTTP] Unknown protocol. Only http and https are allowed. in C:\xampp\htdocs\Client_addCostume.php:4 Stack trace: 
    #0 C:\xampp\htdocs\Client_addCostume.php(4): SoapClient->__doRequest('__doRequest('__soapCall('run', Array) 
    #3 C:\xampp\htdocs\Client_addCostume.php(41): runService('Service_addCost...', 'addCostume', 'costum1') 
    #4 {main}