如何在PHP中处理SOAP POST

时间:2019-03-31 14:14:14

标签: php post soap

我正在尝试构建一个系统,该系统在SOAP请求中接收另一台服务器发送的数据(可悲的是,它不提供https push)。因此,我创建了一个SOAP服务器,但是我不知道如何处理POST请求。 到目前为止,这是我的代码:

<?php
error_reporting(E_ALL);

$server = new SoapServer(null, array(
    'soap_version' => SOAP_1_2,
    'uri' => 'https://my_url'
));
$server->handle();
$postdata = file_get_contents("php://input");
file_put_contents('post.txt', $postdata);

我认为服务器正在接收POST数据,但是当我打开文件时,我只会变得乱七八糟(大概是二进制文件?)。我将如何从中提取XML数据,或者还有另一种方法来提取有效载荷?

0 个答案:

没有答案