php - Posting xml to SOAP service -
i'm new soap , php , i'm having troubles, hope here on stack overflow can me with.
i'm trying use code post xml file (retursvar.xml).
i'm using code post file:
<?php $url = "https://someserver/somefunction"; $options = array( 'login' => 'someusername', 'password' => 'somepassword', 'trace' => 1 ); $client = new soapclient($url.'?wsdl', $options); $document = file_get_contents('retursvar.xml'); $params = array('submitdocument' => $document); $response = $client->__soapcall('submitdocument', $params);
but error in apache error log:
php fatal error: uncaught soapfault exception: [bpws:forcedtermination] business exception in /var/www/html/soaptest.php:15\nstack trace:\n#0 /var/www/html/soaptest.php(15): soapclient->__soapcall('submitdocument', array)\n#1 {main}\n thrown in /var/www/html/soaptest.php on line 15
if call:
var_dump($client->__getfunctions());
immediately after:
$client = new soapclient($url.'?wsdl', $options);
i output:
array(1) { [0]=> string(62) "submitdocumentresponse submitdocument(submitdocument $payload)" }
what doing wrong?
it says haven't caught exception. try wrapping code inside try catch block.
Comments
Post a Comment