how to call dotnet webservice in php

php web service authentication  php web service file transfer


What is web service ?
 For web service you need to know what is xml ? because all communication is go through the xml.

What is XML ?
Xml is a subset of Standard Generalized markup Language (SGML) Its design goal is to be as powerful and flexible as SGML with less complexity.

Web Service:
According to the W3c, Web services "provide a standard means of inter-operating between different software applications,running on variety of platforms and frameworks".  

SOAP : 
SOAP acronym that stood for Simple Object Access Protocol .SOAP is powerful tool for comminication between different different operating system and frameworks.SOAP is tied to xml b'cause all messages sent to and from a soap server are sent in soap envelope that is xml.

Here we are calling dot net web service in php.For that you must know how to create a web service in dot net.I am not big fan of not net but I manage to create a simple  dot net  web service that is called in php.This web service simple return factorial of given number.

VB Dot Net Code for Web Service Factorial Method :

 Imports System.Web
  
 Imports System.Web.Services
  
 Imports System.Web.Services.Protocols
  
 ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
  
 ' <System.Web.Script.Services.ScriptService()> _
  
 <WebService(Namespace:="http://tempuri.org/")> _
  
 <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
  
 <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
  
 Public Class Service
  
    Inherits System.Web.Services.WebService
  
   <WebMethod()> _
  
   Public Function factorial(ByVal number As Long) As String
  
     Dim result As Long = 1
  
     If number > 0 Then
  
       Dim i As Integer
  
       For i = 1 To number
  
         result = result * i
  
       Next i
  
     End If
  
     Return result
  
   End Function
  
 End Class
  

PHP Web Service client


Note:PHP Web services required NuSoap Library Download it from  

Download Nusoap Lib

PHP Web service code:
  
 <?php
  
  // includes nusoap class
  
 require_once('../lib/nusoap.php');
  
 // Create object
  
 $client = new nusoap_client('http://localhost:1587/sampledotnetWebService/Service.asmx?wsdl', true);//set your dot net web service url
  
 $err = $client->getError();
  
 if ($err) {
  
   // error if any
  
   echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
  
 }
  
 // Call mathod
  
 $result = $client->call('factorial', array('number' => '5'));
  
 // fault if any
  
 if ($client->fault) {
  
   echo '<h2>Fault</h2><pre>';
  
   print_r($result);
  
   echo '</pre>';
  
 } else {
  
   // Check for errors
  
   $err = $client->getError();
  
   if ($err) {
  
     // Display the error
  
     echo '<h2>Error</h2><pre>' . $err . '</pre>';
  
   } else {
  
     // Display the result
  
     echo '<h2>Result</h2><pre>';
  
     echo "factorial for 5 = ".$result['factorialResult'];
  
   echo '</pre>';
  
   }
  
 }
  
  //Display the request and response
  
 ?>
  

Buy Me a Beer-If you are like this post

 If you does not have paypal account create free account create account

android anti theft | protect your mobile


Anti Theft Mobile: Anti theft mobile is mobile tracking software that track your mobile.When your mobile is lost or stolen then anti theft application will send sms alert.Some anti theft tracking software also track mobile using gps system.

Some of features of anti theft application:
  • Sms alert
  • protected folder.
  • delete contacts.
  • send sms when sim change. 
  •  mobile gps tracking.
  • Get IMEI
  • Get mobile location.



Some of Anti Theft Application for Android  

Theft Aware 2.0 :

 
Control and find your phone in the event of loss or theft. REAL INVISIBILITY!

Test Theft Aware 2.0 Phone Anti-Theft, the number #1 anti theft tool - RECOMMENDED BY T-MOBILE AND BY DEUTSCHE TELEKOM AG:

Control & find phone if it is lost or stolen.
Control and find your phone in the event of loss or theft. REAL INVISIBILITY!

Test Theft Aware 2.0 Phone Anti-Theft, the number #1 anti theft tool - RECOMMENDED BY T-MOBILE AND BY DEUTSCHE TELEKOM AG:



Download app


MYAndroid Protection 2 :



 All-in-one Android security for maximum protection

* Antivirus & Malware protection
* Backup & Data recovery
* Protection against theft & losses
* Credit card & Identity theft protection





Download App

    Buy Me a Beer-If you are like this post

     If you does not have paypal account create free account create account

    How to submit form using Jquery


    Here you will find a  free php scripts, php resources, php tutorials, web resources , jquery

    <?php print "welcome to source world-php jquery script"; ?>

    WHAT IS JQUERY?

    JQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.jQuery is designed to change the way that you write JavaScript.

    If you want to do some kind of Submit Form you can done using Jquery .submit().
     
    example Jquery Submit Form

    <script language="javascript" type="text/javascript">
         var $rn = jQuery.noConflict(); //Jquery no conflict 
         $rn('#btnsubmit').click(function()  {  
          alert('Submit form using Jquery')   
          $rn('#submitFrom').submit();
    
    });
    
       </script>  
     
       
    Download full example


    Download

    Buy Me a Beer-If you are like this post

     If you does not have paypal account create free account create account

    how to reset form using Jquery


    Here you will find a  free php scripts, php resources, php tutorials, web resources , jquery

    <?php print "welcome to source world-php jquery script"; ?>

    WHAT IS JQUERY?

    JQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.jQuery is designed to change the way that you write JavaScript.

    If you want to do some kind of Reset Form you can done using Jquery Reset Selctor.
     
    example Jquery Reset Form

    <script language="javascript" type="text/javascript">
         var $rn = jQuery.noConflict(); //Jquery no conflict 
         $rn('#btnReset').click(function()  {  
         $rn('#rstform')[0].reset();
    });
    
       </script>  
     
       
    Download Full Example


    Download

    Buy Me a Beer-If you are like this post

     If you does not have paypal account create free account create account

    Jquery how to find and replace content


    Here you will find a  free php scripts, php resources, php tutorials, web resources , jquery

    <?php print "welcome to source world-php jquery script"; ?>

    WHAT IS JQUERY?

    JQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.jQuery is designed to change the way that you write JavaScript.

    If you want to do some kind of find and replace html content then here is example. 
    For example if you want to search for string "joomla" in any table in your html and want to replace it with "wordpress".So what you have to do is first find all table tr which contains string "joomla".Now suppose you know that the string is in 0 column of table then replace it with "wordpress"
     
    example find and replace with jquery

    <script language="javascript" type="text/javascript">
         var $rn = jQuery.noConflict(); //Jquery no conflict 
         $rn('#replacecont').click(function()  {  
         var obj  =$rn(" table tr:contains('Joomla')");       
          $rn(obj).find("td").eq(0).html("<b>Wordpress</b>");
    });
    
       </script>  
     
    
    Download full example


    Download

    Buy Me a Beer-If you are like this post

     If you does not have paypal account create free account create account

    how to get full folder path php

    Thare are two ways to get current working foldr(directory) in php




    1.getcwd() — Gets the current working directory.


    In php you can easily get current script working folder using getcwd().


    On some Unix variants, getcwd() will return FALSE if any one of the parent directories does not have the readable or search mode set, even if the current directory does.


    ex- echo getcwd();


    will return c:\apache\htdocs\phpproject\example


    2. Using dirname()
        
    example : echo dirname(__FILE__);
      
         __FILE__ in PHP will retuen current executing script and dirname() strips scriptname and result will be current working directory

    Buy Me a Beer-If you are like this post

     If you does not have paypal account create free account create account

    how to install pear in winndows easy

    What is PEAR?

    PEAR is short for "PHP Extension and Application Repository" and is pronounced just like the fruit. The purpose of PEAR is to provide: PEAR's mission is to provide reusable components, lead innovation in PHP, provide best practices for PHP development and educate developers.

    How to install pear easily :





















    • Now settings up configuration options opened with your browser.
    • If you are using proxy internet then setup proxy field in configuration options.
    • click on install your pear will be installed within some minutes.

    Buy Me a Beer-If you are like this post

     If you does not have paypal account create free account create account