Since he stated SOAP simple extend the soap client
1st establish a connection to the SOAP
$soapCon = new Utils_SoapClient("http://www.clients-domain.com/erpsync/erp_sync.asmx", array());
$soapCon->setCredentialsHeader(User, Password);
Create a struct to pass variables
$struct = new stdClass();
$struct->item1 = $item1;
Call functions that client gives you with passed parameters / variables
GetAllItemData - Will return all the items selected for web, with their price
$result = $soapCon->GetAllItemData(new SoapVar($struct, SOAP_ENC_OBJECT));
GetItemDataByDate - Will return all the items updated between a specific date
$result = $soapCon->GetItemDataByDate(new SoapVar($struct, SOAP_ENC_OBJECT));
GetAllItemStock - Will return updated stock of all items for website
$result = $soapCon->GetAllItemStock(new SoapVar($struct, SOAP_ENC_OBJECT));
GetStockByItem - Will return stock of single Item.
$result = $soapCon->GetStockByItem(new SoapVar($struct, SOAP_ENC_OBJECT));
Soap Client Class
class Utils_SoapClient extends SoapClient {
protected $_targetNamespace;
public function __construct($wsdl, $options){
parent::__construct($wsdl, $options);
// detect target namespace
$xml = simplexml_load_file($wsdl);
$this->_targetNamespace = (string) $xml['targetNamespace'];
}
public function setCredentialsHeader($login, $password) {
$header = new SoapHeader($this->_targetNamespace,
'CredentialsSoapHeader',
new SoapVar(
array(
'Login' => $login,
'Password' => $password,
),
SOAP_ENC_OBJECT,
'CredentialsSoapHeader',
$this->_targetNamespace
)
);
$this->__setSoapHeaders(array($header));
}
}