>  기사  >  백엔드 개발  >  php5.5.12에서 SOAP 오류 메시지 디버깅

php5.5.12에서 SOAP 오류 메시지 디버깅

不言
不言원래의
2018-04-28 09:03:352038검색

이 글의 내용은 php5.5.12에서 SOAP 오류 메시지를 디버깅하는 내용입니다. 특정 참조 값이 있습니다. 이제 모든 사람과 공유합니다. 도움이 필요한 친구들이 참조할 수 있습니다.

오늘 비누 디버깅을 사용했을 때 다음과 같은 오류가 발생했습니다. 나옴

{
    "respcode": 202,
    "respmsg": "looks like we got no XML document",
    "data": ""
}

다양한 방법을 찾았지만 해결하지 못했습니다. 제 코드는 다음과 같습니다:

서버 측:

function __construct()
    {
        parent::__construct();
        $this->load->model('baogaolist');
        $this->server = new SoapServer(null, ['uri' => '']);
    }

    function checkreport()
    {
        $this->load->model('baogaolist');
        $this->server->setObject($this->baogaolist);
        $this->server->handle();
    }

클라이언트 측 호출:

$url = $this->config->item('car_battery_check_url');

        //获取信息地址
        try {
            $a = new SoapClient(null, [
                'location' => $url . '/report/checkreport',
                'uri' => ''
            ]);

            $detail = $a->get_detail($this->storeid, $check_id);

        } catch (SoapFault $e) {
            resp_msg(202,$e->getMessage());
        }

데이터는 php5.4.44에서 성공적으로 얻을 수 있습니다. 환경인데 php5.5.12에서는 작동하지 않습니다. 오류를 계속 보고합니다

마지막으로 php5.5.12 환경에서 구성 uri를 완성하고 문제를 해결하세요

function __construct()
    {
        parent::__construct();
        $this->load->model('baogaolist');
        $this->server = new SoapServer(null, ['uri' => 'http://172.16.4.29:8000/index.php/report/checkreport']);
    }
try {
            $a = new SoapClient(null, [
                'location' => $url . '/report/checkreport',
                'uri' => 'http://172.16.4.29:8000/index.php/report/checkreport'
            ]);

            $detail = $a->get_detail($this->storeid, $check_id);

        } catch (SoapFault $e) {
            resp_msg(202,$e->getMessage());
        }

클라이언트와 서버 모두에 특정 주소만 추가하세요

관련 권장사항:

PHP는 SOAP를 통해 WebService를 구현합니다



위 내용은 php5.5.12에서 SOAP 오류 메시지 디버깅의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.