Jump to content

PhilAJ52

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by PhilAJ52

  1. Hi there

     

    I'm an intermediate user of PHP, but have never needed to connect to a webservice before, and am having some problems. Hope someone can help

     

    I have the following code to test connecting to the service;

     

    $soapURL = 'http://xxx.xxx.xx.xx4/wsdl/wsdl' ;

    $soapParameters = Array('login' => "xxx", 'password' => "1234") ;

    $client = new SoapClient($soapURL, $soapParameters);

    var_dump($client->__getFunctions());

     

     

    Which works fine and give me back the following;

     

    array(6) { [0]=> string(35) "CallResponse Call(Call $parameters)" [1]=> string(59) "FieldManagerResponse FieldManager(FieldManager $parameters)" [2]=> string(56) "FixScheduleResponse FixSchedule(FixSchedule $parameters)" [3]=> string(44) "GeocodeResponse Geocode(Geocode $parameters)" [4]=> string(59) "ShowCallInfoResponse ShowCallInfo(ShowCallInfo $parameters)" [5]=> string(59) "WorkScheduleResponse WorkSchedule(WorkSchedule $parameters)" }

     

    I now want to call the ShowCallinfo function which has 2 parameters, an integer 0, and a string 'CA12345' - and should return a set of data;

     

    I have tried so many combinations I am going dizzy, and just can't get anything to work.

     

    latest I have tried (immediately after the other code) are;

     

    $result = $client->ShowCallInfo(0,'CA212345');

    Which results in a SoapFault exception: [HTTP] Not Found in

     

    Please can someone help??

     

    Phil

  2. Request URL:http://streetbyz.co.uk/SBPostPost.phpRequest Method:POSTStatus Code:200 OKRequest HeadersProvisional headers are shownContent-Type:multipart/form-dataOrigin:http://127.0.0.1:58889Referer:http://127.0.0.1:58889/http-services/emulator-webserver/ripple/userapp/x/C/Users/Phils/AppData/Local/XDK/xdk-scratchdir/e14eb410-7cf2-4bed-ba25-515e6df98e8c/platforms/ios/www/index.htmlUser-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4X-DevTools-Emulate-Network-Conditions-Client-Id:2F78D5C0-6229-4DE8-8288-5262CF3BFECERequest Payload------WebKitFormBoundaryylWwxRTQ6W9dBHqAContent-Disposition: form-data; name="SBP_Details"[object HTMLTextAreaElement]------WebKitFormBoundaryylWwxRTQ6W9dBHqA--Response HeadersContent-Encoding:gzipContent-Length:287Content-Type:text/htmlDate:Mon, 21 Sep 2015 21:13:25 GMTServer:Microsoft-IIS/8.5Vary:Accept-Encoding

    Thanks 'more Human than Human' - I checked the console and I get the following; Not sure if this looks right or not - and how to get at it thru PHP

  3. <script>            function sendData(form)             {                       var postform = new FormData();             var fileselect = document.getElementById('mypic');            var files = fileselect.files;                postform.append('SBP_Details', document.getElementById('Details'));            // Loop through each of the selected files.            for (var i = 0; i < files.length; i++) {                var file = files[i];                // Check the file type.                if (!file.type.match('image.*')) {                    continue;                }                // Add the file to the request.                postform.append('upload_file[]', file, file.name);            }        //        postform.append('upload_file', document.getElementById('mypic'));      var xmlhttp = new XHRObject();                                          xmlhttp.onreadystatechange=function()             {                if (xmlhttp.readyState==4 && xmlhttp.status==200)                {                                    //xmlhttp.responsetext will have what is sent back - use Print_R in php                                   }             }                                         xmlhttp.open("POST","http://stxxx.co.uk/SBPostPost.php", false);                          xmlhttp.setRequestHeader('Content-Type','multipart/form-data');                          xmlhttp.send(postform);                            }             </script> 

    Getting very confused by all the options available - could someone please help.

     

    I'm developing a hybrid HTML5/JS App in XDK that sends form data and a picture file to a php server. I can get the data fields but struggling with a file.

     

    The JS that sends is as above.; When debugging the console looks as thou it's sent ok but the PHP that echoes $_POST and $_FILES just shows an empty array ...

     

    Can Anyone point me to a tutorial that shows bot sides (JS and PHP ) please

     

     

×
×
  • Create New...