27

使用 file_get_contents 作为自定义 SOAP 实现的一部分来应用 SOAP 调用(我们尝试过的所有库都不会正确使用 SOAP 1.2 进行基于 SSL + 证书的身份验证)。然而,困难且几乎没有记录的 API 通常返回 500。响应正文中有错误详细信息,但 file_get_contents 似乎不允许访问它。fopen 似乎有同样的问题。

做什么?

由于大量使用流上下文来获得身份验证,因此不希望使用 cURL。

4

1 回答 1

65

您可能会考虑nusoap

不过,对于您的问题,如果您使用ignore_errors.

$context = stream_context_create(array(
    'http' => array(
        'ignore_errors' => true
     )
));

$contents = file_get_contents($url, false, $context);
于 2011-05-18T07:02:26.770 回答