Notifications
Clear all
Combu Server/Client
2
Posts
2
Users
0
Reactions
911
Views
Topic starter
hi guys
first sorry for my bad English
i have problem in test my web service with post man
this is my script
<?php include_once './../../lib/api.php'; use Combu\GameSetting; use Combu\Utils; /** * Verify the Webservice action */ if (isset($WS_REQUEST["action"])) { switch ($WS_REQUEST["action"]) { case "GetAllStep": wsAllStep(); break; } } $Database->CloseConnection(); exit(); function wsAllStep () { return 'Everything is OK'; }
and this is post man image (return empty)
Please Help Me To Slove This Problem
Thanks
This topic was modified 6 years ago 2 times by Nemesis
Posted : 27/08/2018 12:14 am
The parameters of the services must be encrypted, you cannot call directly the PHP file with the GET parameters sent like "action=XXX".
The way to debug your webservice is activate Log Debug Info in the inspector of CombuManager component and copy&paste the URL with the parameters already encrypted (but as POST data, see screenshot attached), for example:
public static void List(Action<YourStepClass[]> callback) { CombuForm form = new CombuForm(); form.AddField("action", "GetAllStep"); CombuManager.instance.CallWebservice("addons/gameSetting/wsServices.php", form, (string text, string error) => { List<YourStepClass> results = new List<YourStepClass>(); if (string.IsNullOrEmpty(error) && !string.IsNullOrEmpty(text)) { Hashtable response = text.hashtableFromJson(); if (response != null && response.ContainsKey("results")) { ArrayList list = (ArrayList)response["results"]; if (list != null) { foreach (Hashtable data in list) { // Create a new object from the result YourStepClass record = new YourStepClass(data); // Add to the list results.Add(record); } } } } if (callback != null) callback(results.ToArray()); }); }
FRANCESCO CROCETTI @ SKARED CREATIONS
Posted : 27/08/2018 6:56 pm