PHP when using the SOAP protocol interface, often encounter the following problems, not unsuccessful, but occasionally unsuccessful, it is puzzling!
err:soap-error:parsing wsdl:couldn ' t load from ' HTTP://WWW.XXXXX.COM/MEMBER/MEMBER_SYNC.PHP?WSDL ': Failed to load Exte rnal entity "HTTP://WWW.XXXXX.COM/MEMBER/MEMBER_SYNC.PHP?WSDL"
Find Log Discovery:
Notic: [2] Soapclient::soapclient (): I/O warning:failed to load external entity "Http://www.xxxxx.com/member/member_syn C.PHP?WSDL "/home/wwwroot/default/xxxxx.com/app/modules/admin/action/orderaction.class.php line 112th.
Find a lot of information on the web, have to open selinux, turn off the soap cache, open OpenSSL and so on, but after the attempt is unsatisfactory, the ultimate solution:
Just change the WSDL mode of PHP client soapclient to NON-WSDL mode, you can solve it!
WSDL mode:
<?php
$url = "HTTP://XXXXX.ORG/MEMBER/MEMBER_SYNC.PHP?WSDL";
$client = new SoapClient ($url);
$arr = Array (
' Username ' = ' test123 ',
' Company ' = ' Shenzhen XXXXX Technology Co., Ltd. ',
' Password ' = MD5 (MD5 ("test123")),
' Encrypt_code ' = ' thisisencryptcode '); To encrypt a string, you must
$result = $client->common_func (' Sync_member ', Json_encode ($arr));
Var_dump ($result);
?>
NON-WSDL mode:
<?php
$client = new SoapClient (Null,array (' location ' = ' http://www.zgzszj.com/member/member_sync.php ', Uri = ' Member _sync.php '));
$arr = Array (
' Username ' = ' test123 ',
' Company ' = ' Shenzhen XXXXX Technology Co., Ltd. ',
' Password ' = MD5 (MD5 ("test123")),
' Encrypt_code ' = ' thisisencryptcode '); To encrypt a string, you must
$result = $client->common_func (' Sync_member ', Json_encode ($arr));
Var_dump ($result);
?>