Jump to content

Search the Community

Showing results for tags 'webservice'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 7 results

  1. I have a server script with which i have allowed the user to mark any item as favorite, but i also want another script through which the user can unfavorite the same item if they want and that item should be deleted from their favorite list. I have kept the same table for both favorite and unfavorite code, therefore i have used update query to update the details. For this purpose i have a code, but its not working, as i am new in the programming field would appreciate if someone could provide the correct codes <?php require_once('config.php'); $favorite = $_REQUEST['favorite']; $unfavorite = $_REQUEST['unfavorite']; $id=$_REQUEST['id']; $unfavoritedeal=mysql_query("SELECT * FROM favoritedeals where id='".$id."'"); //favoritedeals is the name of the table if($row=mysql_fetch_array($unfavoritedeal)) { $favorite=$row['favorite']; $unfavorite=$row['unfavorite']; } $myfavorite=(isset($_REQUEST['favorite'])?$_REQUEST['favorite']:$favorite); $myunfavorite=(isset($_REQUEST['unfavorite'])?$_REQUEST['unfavorite']:$unfavorite); $update = mysql_query("update favoritedeals set favorite = '".$myfavorite."', unfavorite = 1 where id = '".$id."'"); if(unfavorite="1" where id='".$id."') { "delete from favoritedeals WHERE id= '".$id."'"; } $posts[0]['message'] = 'favorite list updated'; $selectt = mysql_query("select * from favoritedeals where id = '".$id."'"); $results = mysql_fetch_assoc($selectt); $posts[0]['detail'] = $results; header('Content-type: application/json'); echo json_encode($posts); ?>
  2. Hello, I'm hoping someone may be able to help me. I have a php shopping cart (zen cart to be exact) and I have a web service that someone helped me write to allow retrieval of data from the MYSQL database to be used by an external website built in .net (I am a .net developer). Anyway, the current web service only allows "reading" of data which is working fine, however now I would like to add an extra function that would allow the external site to update the stock levels in the Zen Cart's mysql database via a web service call. This is what I have curently : <?php require 'includes/configure.php'; error_reporting(0); class stephin { function __construct($hostname,$dbuser,$dbpass,$dbname) { global $config; if(!$this->dblink) { if($this->dblink=mysql_connect($hostname,$dbuser,$dbpass)){ if(mysql_select_db($dbname,$this->dblink)){ return $this->dblink; }else{ die("Database cant be selected."); return false; } } else{ die("No database connection"); return $this->dblink; } } else{ return $this->dblink; } } function select($query){ $result2=mysql_query($query,$this->dblink); $result3=mysql_num_rows($result2); if($result3 > 0){ while($row=mysql_fetch_object($result2)){ if($row){ $result[] = $row; } } return $result; } return false; } } $db = new stephin(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD,DB_DATABASE); $id=$_GET[id]; $action=$_GET[action]; if($action=="GetProductDetails") { $data=$db->select("select zen_products_description.products_id,zen_products.products_model,zen_products_description.products_name,zen_products.products_status,zen_products.products_price,zen_products.products_quantity,zen_products.products_weight,zen_products.product_is_always_free_shipping as free_shipping,zen_products.products_sort_order as sort_order,zen_products.master_categories_id as categories_id,zen_products_description.products_description,zen_products.products_image from zen_products_description inner join zen_products on zen_products.products_id= zen_products_description.products_id where zen_products.products_id=$id"); } if($action=="GetProductList") { $data=$db->select("select zen_products_description.products_id,zen_products.products_model,zen_products_description.products_name,zen_products.products_status,zen_products.products_quantity,zen_products.products_price,zen_products.products_weight,zen_products.products_sort_order as sort_order,zen_products.master_categories_id as categories_id from zen_products_description inner join zen_products on zen_products.products_id= zen_products_description.products_id order by zen_products_description.products_id"); } echo json_encode($data); ?> I have figured out that I will need something like this: $prod_id = $_GET['prod_id']; $prod_qty = $_GET['prod_qty']; $sql = "UPDATE zen_products SET products_quantity = $prod_qty WHERE products_id = $prod_id" ; mysql_select_db('test_db'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not update data: ' . mysql_error()); } echo "Updated data successfully\n"; mysql_close($conn); } But I am just not sure how to glue it together with the existing code I have. In addition I would also like to make sure that the quantity cannot be updated to a value less than zero. Obviously I also have security issues to consider but I will worry about that once I can get this working. Thanks in advance.
  3. I have written the following code as a client on Linux in an attempt to understand how a webservice running on a Windows 7 PC works. <?php $client = new SoapClient(""); $result = $client->GetSequenceNo(array()); $response_arr = objectToArray($result); // print_r($response_arr); var_dump($response_arr); // $arrlength=count($response_arr); // echo $arrlength; function objectToArray($d) { // var_dump($d); if (is_object($d)) { $d = get_object_vars($d); } var_dump($d); if (is_array($d)) { return array_map(__FUNCTION__, $d); } else { return $d; } } ?> I get the following returned and displayed via the two var_dump() calls. array(6) { ["iServerNo"]=> int(0) ["iClientNo"]=> int(0) ["bNoLimitDownload"]=> bool(false) ["dtStartDate"]=> string(19) "0001-01-01T00:00:00" ["dtEndDate"]=> string(19) "0001-01-01T00:00:00" ["dtServerTime"]=> string(19) "0001-01-01T00:00:00" } int(0) int(0) bool(false) string(19) "0001-01-01T00:00:00" string(19) "0001-01-01T00:00:00" string(19) "0001-01-01T00:00:00" array(1) { ["GetSequenceNoResult"]=> array(6) { ["iServerNo"]=> int(0) ["iClientNo"]=> int(0) ["bNoLimitDownload"]=> bool(false) ["dtStartDate"]=> string(19) "0001-01-01T00:00:00" ["dtEndDate"]=> string(19) "0001-01-01T00:00:00" ["dtServerTime"]=> string(19) "0001-01-01T00:00:00" } } I suspect that I need to extract the value of iServerNo and iClientNo from either the returned object or the array created by my copied code. My question is how do I get these values into individual variables? In other words I would like to populate $iServerNo and $iClientNo but do not understand how.
  4. hi we've two kinds of clients, web client and an application which works as a client. now our application simulates web requests by calling index.php as the web client does. we want to change it to calling web services via nusoap. but there's a problem. web services are session-less. for example, a web service is called to authenticate. the second service when called has no sense about the authentication and it's completely a separate call. someone told me that i may put something eg. a hash code in http headers to include the data provided via authentication so that the next web services read the data from header and realize the call has been for what session. this way something like session simulation occurs. i'm not so familiar with 'http headers'. i don't know how can i do that. in the whole, i like to know what may be the best solution and whether nusoap keeps something internally like sessions so that i may read the in web services? what's your suggestion? thx
  5. Hello. My mission is to develop a client to a third party's webservice, which server machine and source codes I can't access or handle. All I have is the API specifications and the addresses. The program works fine on DevelopEnvironment without authentication, but at ProductionEnvironment it requires basic http authentication plus certificate, and then I can't even receive any answer. They said me that I could use a self-signed certificate, so I've created one in my Server ( CentOS Apache2+PHP5.3.3 ). The company sent me a functional DotNetServiceClient piece of code, which includes the app.config which follows bellow. I need some example of how to send this authentication and more the certificate in PHP SoapClient or CURL. Here is the C# application's app.config, with fake IP and certificate: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.net> <settings> <servicePointManager expect100Continue="false" /> </settings> </system.net> <system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_ISyasAutoServices"> <security> <message clientCredentialType="UserName" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISyasAutoServices" contract="ServiceReference1.ISyasAutoServices" name="WSHttpBinding_ISyasAutoServices"> <identity> <certificate encodedValue="AwAAAAEAAAAUAAAAmqc2gWanBIqn7sbzoxWEw==" /> </identity> </endpoint> </client> <behaviors> <endpointBehaviors> <behavior> <clientCredentials> <serviceCertificate> <authentication certificateValidationMode="None" revocationMode="NoCheck"/> </serviceCertificate> </clientCredentials> </behavior> </endpointBehaviors> </behaviors> </system.serviceModel> </configuration> And here is my current client code: /* PHP WebService Client */ $connectionParameters = array( 'login' => 'login' ,'password' => 'password' ,'trace' => TRUE ,'encoding' => 'UTF-8' ,'exceptions' => TRUE ,'cache_wsdl' => WSDL_CACHE_NONE ,'soap_version' => SOAP_1_2 ,'local_cert' => file_get_contents('/my/certificate/directory/selfsignedcertificate/thatwebservice.pem') ,'passphrase' => 'd3e343der434wds' ); $theClient = new SoapClient($serverWSDLURL, $connectionParameters); $r = $theClient->GetBasicWorkData(); The answer: No answer! Only timeOut. Any example or tip? Thank you very much.
  6. Hi! I have a webservice in asp.net that return Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/20...chema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/20...soap-envelope"> <soap12:Body> <CalculadoraResponse xmlns="http://tempuri.org/"> <CalculadoraResult> <xsd:schema>schema</xsd:schema>xml</CalculadoraResult> </CalculadoraResponse> </soap12:Body> </soap12:Envelope> I call the webservice: <?php $client = new SoapClient("webserviceaddress"); $result = $client->Calculadora(array('Param1'=>'1')); $simpleresult = $result->CalculadoraResult; ?> How can i read the result? I have another function in that webservice that return a string and everything its ok, but with this function i dont know how to read the result
  7. Hello Everyone, I am stuck in a task to change byteArray to Video in php. I am creating a webservice in php. This service will receive video in byteArray format from iphone and need to convert it back to original video. I mean, webservice will receive byte array from POST. I could not find any way of converting byteArray into video. byteArray datatype does not seem to be supported by php. Any help would be appreciated.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.