<?php 

	/****************************************************/
	// 
	//  PrestaShop2e5crm WSDL v1.0
	//
	//**************************************************/
	//  
	//  Usługa wymiany danych pomiedzy sklepem a CRM
	//  Author: Michał Rygielski 
	//  Date: 2013-09-19
	//
	/****************************************************/	

	
	require('WSDL/inc.variables.php'); 
	require('WSDL/inc.mysqli.config.php'); 
	//require('include/inc.mysqli.php'); 
	require('WSDL/pdo.db.php'); 
	//$db = new Database(MYSQL_API_HOST, MYSQL_API_USER, MYSQL_API_PASSWORD, MYSQL_API_PORT, MYSQL_API_DATABASE, MYSQL_API_COLLATE);        
 
	
	//require('include/pdo.db.php'); 
	require('WSDL/inc.functions.php');      
//	require('include/inc.ws.types.php'); 
 
    define("sugarEntry", "true");

require_once('include/entryPoint.php');
require_once('include/utils/file_utils.php');
ob_start();

require_once('soap/SoapError.php');
require_once('nusoap/nusoap.php');
require_once('modules/Contacts/Contact.php');
require_once('modules/Accounts/Account.php');
require_once('modules/Opportunities/Opportunity.php');
require_once('modules/Cases/Case.php');


//ignore notices
error_reporting(E_ALL ^ E_NOTICE);	
	
	
    $namespace = full_url()."?wsdl";
    
	$server = new soap_server();
    $server->configureWSDL("WSDL");
    $server->soap_defencoding = 'utf-8'; 
    $server->soap_http_encoding = 'utf-8'; 
    $server->xml_excoding = 'utf-8'; 
    $server->decode_utf8 = false;
    
	require('WSDL/inc.ws.methods.php'); 
	
  //  Register_Types($server);
// echo "TEST";exit;
    //Register_Methods($server, $namespace);
        
    $server->service(isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : '');
    exit();    
    
?> 