使用file_get_contents作为自定义SOAP实现的一部分来应用SOAP调用(我们尝试的所有库都无法正确地使用SOAP 1.2进行基于SSL +证书的身份验证).但是,困难且几乎没有文档记录的API通常返回500.响应正文中有错误详细信息,但file_get_contents似乎不允许访问它. fopen似乎有同样的问题.
Using file_get_contents as part of custom SOAP implementation to apply SOAP calls (ALL libraries that we tried would not do SSL + certificate based authentication with SOAP 1.2 correctly). However difficult and barely-documented API often returns 500. There are error details in response body, but file_get_contents doesn't appear to allow access to it. fopen seems to have the same issue.
怎么办?
由于大量使用流上下文来使身份验证正常工作,因此最好不要使用cURL.
Prefer not to go to cURL due to heavy use of stream contexts to get authentication working.
推荐答案您可以考虑 nusoap .
但是对于您的问题,如果您使用ignore_errors,它就可以解决问题.
For your question though, it works if you use ignore_errors.
$context = stream_context_create(array( 'http' => array( 'ignore_errors' => true ) )); $contents = file_get_contents($url, false, $context);更多推荐
需要带有file
发布评论