SOAP API - "SOAP/Client.php"

60 Views Asked by At

I would like to send a fax using the API from simple-fax.de. The API documentation seems relatively simple. However, I am now encountering a problem. The example code states that the directory SOAP/Client.php is required. What does this Client.php look like and where do I get it from, or do I need to create it and what goes in there?

Url to API documentation: https://simple-fax.de/Downloads/SOAP-API-simplefax.pdf

Example code:

<?php
$fp = fopen("test.pdf", "r"); while(!feof($fp)) $data .= fread($fp,1024); $pdffile = base64_encode($data);
**require_once "SOAP/Client.php";**
$wsdl = new SOAP_WSDL("http://longisland.simple-fax.de/soap/index.php?wsdl"); $proxy = $wsdl->getProxy();
$response = $proxy->sendfax("e-mail", "password", "053149059001", $pdffile, "PDF", "Absender im Header", "http://your-domain.de/callback.php");
$response = preg_split("/;/", $response); if($response[0] == "success") {
$faxid = $response[1];
//FaxID in einer Tabelle speichern
}else{
}
?>

I have uploaded the example code to my web server with my access data. However, the client.php is missing. Where do I get this from? I expect the fax to be sent successfully.

1

There are 1 best solutions below

0
Seyed Mohammadreza On

you can use from SoapClient class that exists in php as a built-in library.

you can read more about that in

https://www.php.net/manual/en/class.soapclient.php