Making SOAP call to a WSDL with PHP - php

https://www.ticimax.com/dokumanlar/webservis.pdf
Ticimax is an e-commerce software in Turkey. I'm trying to create products by using their webservice for one of my clients. I've used all of their webservice methods. But i'm stuck with their product creation method "SaveUrun". Because this method has only one thing different from other methods. This method accepts a parameter as ref
SaveUrun method is in the document from page 7 to page 9.
If you look at page 9, you will see this line at the end of the method definitions:
urunServis.SaveUrun("U15saQ48dW453X1cA", ref urunKartlari, ukAyar, varyasyonAyar);
urunKartlari is passed as ref.
What is ref? What is it stands for? What is the equivalent of it in PHP? How can i make my code work? Can you please help me?
This is what i get when i make the SOAP call:
Value cannot be null. Parameter name: source
Here is my example code:
<?php
$ticimax = new SoapClient("http://www.CLIENTDOMAIN.com/Servis/UrunServis.svc?wsdl");
$kategoriler = array();
$urunResimleri = array();
$varyasyonlar = array(
array(
"ID" => 0,
"Aktif" => false,
"AlisFiyati" => 10,
"Barkod" => "",
"Desi" => 1,
"KargoUcreti" => 0,
"KdvDahil" => true,
"KdvOrani" => 8,
"Ozellikler" => array(
array(
"Tanim" => "Numara",
"Deger" => 38
),
array(
"Tanim" => "Renk",
"Deger" => "Mavi"
)
),
"ParaBirimiID" => 1,
"Resimler" => array(),
"SatisFiyati" => 100,
"StokAdedi" => 15,
"StokKodu" => ""
),
array(
"ID" => 0,
"Aktif" => false,
"AlisFiyati" => 10,
"Barkod" => "",
"Desi" => 1,
"KargoUcreti" => 0,
"KdvDahil" => true,
"KdvOrani" => 8,
"Ozellikler" => array(
array(
"Tanim" => "Numara",
"Deger" => 40
),
array(
"Tanim" => "Renk",
"Deger" => "Mavi"
)
),
"ParaBirimiID" => 1,
"Resimler" => array(),
"SatisFiyati" => 100,
"StokAdedi" => 15,
"StokKodu" => ""
)
);
$urunKarti = array(
"ID" => 0,
"Aktif" => false,
"UrunAdi" => "Test ürün adı",
"Aciklama" => "Test ürün açıklama",
"AnaKategori" => "İç Giyim",
"AnaKategoriID" => 1,
"Kategoriler" => $kategoriler,
"MarkaID" => 1,
"TedarikciID" => 1,
"Resimler" => $urunResimleri,
"SatisBirimi" => "Adet",
"UcretsizKargo" => false,
"OnYazi" => "Test ürün önyazı",
"PuanDeger" => 12,
"SeoAnahtarKelime" => "",
"SeoSayfaAciklama" => "",
"SeoSayfaBaslik" => "",
"Varyasyonlar" => $varyasyonlar,
"Vitrin" => false,
"YeniUrun" => false
);
$params = array(
array(
"UyeKodu" => WEBSERVICE_PASSWORD,
"UrunKartlari" => $urunKarti,
"ukAyar" => array(
"AciklamaGuncelle" => true,
"AktifGuncelle" => true,
"FBStoreGosterGuncelle" => false,
"FirsatUrunuGuncelle" => true,
"KategoriGuncelle" => false,
"MaksTaksitSayisiGuncelle" => false,
"MarkaGuncelle" => false,
"OnYaziGuncelle" => false,
"ParaPuanGuncelle" => true,
"SatisBirimiGuncelle" => false,
"SeoAnahtarKelimeGuncelle" => false,
"SeoSayfaAciklamaGuncelle" => false,
"SeoSayfaBaslikGuncelle" => false,
"TedarikciGuncelle" => false,
"UcretsizKargoGuncelle" => true,
"UrunAdiGuncelle" => true,
"UrunResimGuncelle" => false,
"VitrinGuncelle" => false,
"YeniUrunGuncelle" => true
),
"vAyar" => array(
"AktifGuncelle" => false,
"AlisFiyatiGuncelle" => true,
"BarkodGuncelle" => false,
"IndirimliFiyatiGuncelle" => true,
"KargoUcretiGuncelle" => false,
"KargoAgirligiGuncelle" => true,
"ParaBirimiGuncelle" => false,
"PiyasaFiyatiGuncelle" => true,
"SatisFiyatiGuncelle" => false,
"StokAdediGuncelle" => true,
"UyeTipiFiyat1Guncelle" => false,
"UyeTipiFiyat2Guncelle" => true,
"UyeTipiFiyat3Guncelle" => false,
"UyeTipiFiyat4Guncelle" => true,
"UyeTipiFiyat5Guncelle" => false,
"TedarikciKodunaGoreGuncelle" => false
)
)
);
try{
print_r($ticimax->__soapCall("SaveUrun", $params));
}
catch(Exception $e){
echo $e->getMessage();
}
?>
Can you please fix my code?

UyeKodu UrunKartlari fields in Params array must be uyeKodu urunKartlari

Related

phpexcel - add new row in existing excel file using phpexcel

All data in array like this
<?php
$sub_arr = array();
$sub_arr[] = array(
'sr_nm' => 1,
'recept_number' => 3019,
'adm_number' => 3434,
'student_name' => 'amit',
'class' => 'LKG',
'pay' => 'online',
'cheq_nm' => '',
'adm_fee' => '',
'consolidated' => '',
'sec.fee' => '',
'dev.charge' => 5000,
'school_fee' => 1300,
'subling' => '-3400',
'transport' => 2300,
'late_fee' =>'total' => 35006
);
$sub_arr[] = array('sr_nm' => 1,
'recept_number' => 3019,
'adm_number' => 3434,
'student_name' => 'amit',
'class' => 'LKG',
'pay' => 'online',
'cheq_nm' => '',
'adm_fee' => '',
'consolidated' => '',
'sec.fee' => '',
'dev.charge' => 5000,
'school_fee' => 1300,
'subling' => '-3400',
'transport' => 2300,
'late_fee' => '',
'total' => 35006
);
And my excel file:
I want to insert new data from A4 shell after loading the file.

Responsive File Manager Memory Limit Error

i am having trouble uploading large files with Responsive File Manager, it shows Not enough memory limit error.
i tried changing limits in php.ini
upload limit to 100MB
post max size to 100MB
script memory limit to 300MB
max execution time to 300
i also changed the limit in config.php
'MaxSizeUpload' => 100
But still the same error.
now even few 100 kb is not uploading.
what may be the problem?
Edit 1:
i use the default upload.php from responsive file manager for uploading my files
at line 157 the memory error is checked
default upload.php
my config.php
<?php
if (session_id() == '') session_start();
mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');
mb_http_input('UTF-8');
mb_language('uni');
mb_regex_encoding('UTF-8');
ob_start('mb_output_handler');
date_default_timezone_set('Asia/Kolkata');
define('USE_ACCESS_KEYS', false); // TRUE or FALSE
define('DEBUG_ERROR_MESSAGE', true); // TRUE or FALSE
$config = array(
'base_url' => ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && ! in_array(strtolower($_SERVER['HTTPS']), array( 'off', 'no' ))) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'],
'upload_dir' => '/photos/original/',
'current_path' => '../photos/original/',
'thumbs_base_path' => '../cache/',
'ftp_host' => false,
'ftp_user' => "user",
'ftp_pass' => "pass",
'ftp_base_folder' => "base_folder",
'ftp_base_url' => "http://site to ftp root",
'ftp_thumbs_dir' => '/thumbs/',
'ftp_ssl' => false,
'ftp_port' => 21,
'access_keys' => array(),
'MaxSizeTotal' => false,
'MaxSizeUpload' => 100,
'fileFolderPermission' => 0755,
'default_language' => "en_EN",
'icon_theme' => "ico",
'show_total_size' => false,
'show_folder_size' => false,
'show_sorting_bar' => true,
'show_filter_buttons' => true,
'show_language_selection' => false,
'transliteration' => false,
'convert_spaces' => false,
'replace_with' => "_",
'lower_case' => false,
'add_time_to_img' => false,
'lazy_loading_file_number_threshold' => 0,
'image_max_width' => 0,
'image_max_height' => 0,
'image_max_mode' => 'auto',
'image_resizing' => false,
'image_resizing_width' => 0,
'image_resizing_height' => 0,
'image_resizing_mode' => 'auto',
'image_resizing_override' => false,
'image_watermark' => false,
'image_watermark_position' => 'br',
'image_watermark_padding' => 0,
'default_view' => 0,
'ellipsis_title_after_first_row' => true,
'delete_files' => true,
'create_folders' => false,
'delete_folders' => false,
'upload_files' => true,
'rename_files' => true,
'rename_folders' => false,
'duplicate_files' => false,
'copy_cut_files' => true, // for copy/cut files
'copy_cut_dirs' => false, // for copy/cut directories
'chmod_files' => false, // change file permissions
'chmod_dirs' => false, // change folder permissions
'preview_text_files' => false, // eg.: txt, log etc.
'edit_text_files' => false, // eg.: txt, log etc.
'create_text_files' => false, // only create files with exts. defined in $editable_text_file_exts
'previewable_text_file_exts' => array( "bsh", "c","css", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html", "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh", "xhtml", "xml","xsl" ),
'previewable_text_file_exts_no_prettify' => array( 'txt', 'log' ),
'editable_text_file_exts' => array( 'txt', 'log', 'xml', 'html', 'css', 'htm', 'js' ),
'googledoc_enabled' => true,
'googledoc_file_exts' => array( 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx' ),
'viewerjs_enabled' => true,
'viewerjs_file_exts' => array( 'pdf', 'odt', 'odp', 'ods' ),
'copy_cut_max_size' => 100,
'copy_cut_max_count' => 200,
'ext_img' => array( 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg' ), //Images
'ext_file' => array(), //Files
'ext_video' => array(), //Video
'ext_music' => array(), //Audio
'ext_misc' => array(), //Archives
'aviary_active' => false,
'aviary_apiKey' => "2444282ef4344e3dacdedc7a78f8877d",
'aviary_language' => "en",
'aviary_theme' => "light",
'aviary_tools' => "all",
'aviary_maxSize' => "1400",
'file_number_limit_js' => 500,
'hidden_folders' => array(),
'hidden_files' => array( 'config.php' ),
'url_upload' => false,
'java_upload' => false,
'JAVAMaxSizeUpload' => 200, //Gb
'fixed_image_creation' => false,
'fixed_path_from_filemanager' => array( '../images/thumbs2/', '../test1/' ),
'fixed_image_creation_name_to_prepend' => array( 'thumb_', 'test_' ),
'fixed_image_creation_to_append' => array( '', '' ),
'fixed_image_creation_width' => array( 300, 400 ),
'fixed_image_creation_height' => array( 200, '' ),
'fixed_image_creation_option' => array( 'auto', 'auto' ),
'relative_image_creation' => true,
'relative_path_from_current_pos' => array( '../hd', '../fullhd','../thumbs' ),
'relative_image_creation_name_to_prepend' => array( '', '' , ''),
'relative_image_creation_name_to_append' => array( '', '',''),
'relative_image_creation_width' => array( 1280, 1920 , 200),
'relative_image_creation_height' => array( 720, 1080, 200 ),
'relative_image_creation_option' => array( 'auto', 'auto', 'auto' ),
'remember_text_filter' => false,
);
return array_merge(
$config,
array(
'MaxSizeUpload' => ((int)(ini_get('post_max_size')) < $config['MaxSizeUpload'])
? (int)(ini_get('post_max_size')) : $config['MaxSizeUpload'],
'ext'=> array_merge(
$config['ext_img'],
$config['ext_file'],
$config['ext_misc'],
$config['ext_video'],
$config['ext_music']
),
'aviary_defaults_config' => array(
'apiKey' => $config['aviary_apiKey'],
'language' => $config['aviary_language'],
'theme' => $config['aviary_theme'],
'tools' => $config['aviary_tools'],
'maxSize' => $config['aviary_maxSize']
),
)
);
?>
error screenshot
If you are using NGINX you should check configured maximum post entity size. In my default configuration it was less than PHP post file limit.

Wordpress WP_editor() HTML formatting

I'm working today on an Wordpress plugin with the beautiful WP_Editor()
But this editor doesn't format their HTML, every time i add some html text with the editor and save it correctly as an posts in the database, is everything fine. but when i post this html string data to my WP_Editor() it messed it up.
Is their an solution to get the right format to view html in the wp_editor?
thanks a lot!
P.s. my code:
$settings_desc = array(
'textarea_name' => 'description',
'mode' => 'specific_textareas',
'editor_selector' => 'theEditor',
'width' => '100%',
'theme' => 'advanced',
'skin' => 'wp_theme',
'theme_advanced_buttons1' => 'bold,italic,strikethrough,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,|,link,unlink,wp_more,|,spellchecker,fullscreen,wp_adv',
'theme_advanced_buttons2' => 'formatselect,underline,justifyfull,forecolor,|,pastetext,pasteword,removeformat,|,media,charmap,|,outdent,indent,|,undo,redo,wp_help',
'theme_advanced_buttons3' => '',
'theme_advanced_buttons4' => '',
'language' => 'de',
'spellchecker_languages' => 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,+German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv',
'theme_advanced_toolbar_location' => 'top',
'theme_advanced_toolbar_align' => 'left',
'theme_advanced_statusbar_location' => 'bottom',
'theme_advanced_resizing' => true,
'theme_advanced_resize_horizontal' => false,
'dialog_type' => 'modal',
'relative_urls' => false,
'remove_script_host' => false,
'convert_urls' => false,
'apply_source_formatting' => false,
'remove_linebreaks' => true,
'gecko_spellcheck' => true,
'entities' => '38,amp,60,lt,62,gt',
'accessibility_focus' => true,
'tabfocus_elements' => 'major-publishing-actions',
'media_strict' => false,
'paste_remove_styles' => true,
'paste_remove_spans' => true,
'paste_strip_class_attributes' => 'all',
'wpeditimage_disable_captions' => false,
'plugins' => 'safari,inlinepopups,spellchecker,paste,wordpress,media,fullscreen,wpeditimage,wpgallery,tabfocus',
);

dataTableBundle - turn on 'individual_filtering' for specific columns only

I'm using stwe/datataTablebundle for my symfony application. I'd like to have individual column filters on some specific columns, but setting 'individual_filterting' => true turns on the filter for every column. How to I specify columns? Currently I am hiding unwanted columns using css.
$this->options->set(array(
'display_start' => 0,
'defer_loading' => -1,
'dom' => 'lfiprtip',
'length_menu' => array(20, 50, 100, 1000, 10000, '"All"'),
'order_classes' => true,
'order' => array(array(0, 'asc')),
'order_multi' => true,
'page_length' => 50,
'paging_type' => Style::FULL_NUMBERS_PAGINATION,
'renderer' => '',
'scroll_collapse' => false,
'search_delay' => 0,
'state_duration' => 7200,
'stripe_classes' => array(),
'class' => Style::BOOTSTRAP_3_STYLE . ' table-condensed',
'individual_filtering' =>false,
'individual_filtering_position' => 'head',
'use_integration_options' => true,
'force_dom' => true,
));

ZF2 Add custom attribute to option in a select form element

I would like to add a custom HTML attribute to an option of a select in a Zend Framework 2 Form.
This is my (partial) code from my Form class:
$this->add(array(
'name' => 'lieuRemplissage',
'type' => 'Select',
'attributes' => array(
'class' => 'form-control',
),
'options' => array(
'label' => _('Lieu pré-enregistré'),
),
));
I populate my options values in my controller like this :
$form = new \Vente\Form\Vente;
foreach($this->getAdminLieuDeVenteTable()->fetchAll() as $lieu) {
$optionsLieu[$lieu->getId()] = $lieu->getNom();
}
$form->get('lieuRemplissage')->setValueOptions($optionsLieu);
But now, for each option I want to add an html attribute to all select options but with a different value for each one.
Is there a way do achieve that in ZF2 ?
Thanks.
Yes this is possible with ZF2
You pass in the attributes within the option value. The value should be in array format:
//example in view:
$select=new \Zend\Form\Element\Select('test');
$select->setValueOptions(
[
['attributes'=>['data-key'=>'value'],'value'=>'myValue','label'=>'myLabel']
]
);
echo $this->formselect($select);
prints:
<select name="test"><option value="myValue" data-key="value">myLabel</option></select>
EDIT:
The attributes you provide must be valid HTML attributes you cannot put any random key/value pairs.
For example data-* is fine as are the following :
protected $validGlobalAttributes = array(
'accesskey' => true,
'class' => true,
'contenteditable' => true,
'contextmenu' => true,
'dir' => true,
'draggable' => true,
'dropzone' => true,
'hidden' => true,
'id' => true,
'lang' => true,
'onabort' => true,
'onblur' => true,
'oncanplay' => true,
'oncanplaythrough' => true,
'onchange' => true,
'onclick' => true,
'oncontextmenu' => true,
'ondblclick' => true,
'ondrag' => true,
'ondragend' => true,
'ondragenter' => true,
'ondragleave' => true,
'ondragover' => true,
'ondragstart' => true,
'ondrop' => true,
'ondurationchange' => true,
'onemptied' => true,
'onended' => true,
'onerror' => true,
'onfocus' => true,
'oninput' => true,
'oninvalid' => true,
'onkeydown' => true,
'onkeypress' => true,
'onkeyup' => true,
'onload' => true,
'onloadeddata' => true,
'onloadedmetadata' => true,
'onloadstart' => true,
'onmousedown' => true,
'onmousemove' => true,
'onmouseout' => true,
'onmouseover' => true,
'onmouseup' => true,
'onmousewheel' => true,
'onpause' => true,
'onplay' => true,
'onplaying' => true,
'onprogress' => true,
'onratechange' => true,
'onreadystatechange' => true,
'onreset' => true,
'onscroll' => true,
'onseeked' => true,
'onseeking' => true,
'onselect' => true,
'onshow' => true,
'onstalled' => true,
'onsubmit' => true,
'onsuspend' => true,
'ontimeupdate' => true,
'onvolumechange' => true,
'onwaiting' => true,
'role' => true,
'aria-labelled-by' => true,
'aria-described-by' => true,
'spellcheck' => true,
'style' => true,
'tabindex' => true,
'title' => true,
'xml:base' => true,
'xml:lang' => true,
'xml:space' => true,
);
I just figured this out and wanted to share here since I saw this question while I was searching for the same question. Should give the same result with the suggested way but directly using options' attributes in form class; especially useful if passing data object to form construct to populate options like me.
$this->add(array(
'name' => 'lieuRemplissage',
'type' => 'Select',
'attributes' => array(
'class' => 'form-control',
),
'options' => array(
'label' => _('Lieu pré-enregistré'),
'value' => 123
'attributes' => array(
'data-key' => 'value_for_data_attribute_goes_here',
),
),
));

Categories