如何在PHP中通过soap发送xml请求?当前没有wsdl文件,只是发送xml请求

时间:2019-11-10 08:21:38

标签: php xml soap soap-client

我要发送包含pem文件的xml请求wia soap客户端。

PHP 7.0

$xmlReq = 'my xml string'; // xml

$location_URL="https://server.com/raws";
        $certificate = 'path/to/file.pem';
        $password = '123456';

        $client = new SoapClient(null, array(
            'location' => $location_URL,
            'uri'      => $location_URL,
            'trace'    => true,
            'exceptions'=> true,
            'keep_alive'    => true,
            'cache_wsdl' => WSDL_CACHE_NONE,
            'encoding' => 'utf-8',
            'local_cert'    => $certificate,
            'passphrase'    => $password
        ));

$search_result = $client->__doRequest($xmlReq, $location_URL, $location_URL, SOAP_1_2);

请告诉我如何发送带有pem文件的请求(原始xml)。

0 个答案:

没有答案