Microsoft

You find here some of the most recent Microsoft news that I find  interesting…

Share it with your freinds on Facebook Tweet it to your freinds on Twitter Myspace Friendfeed Technorati del.icio.us Digg Google Yahoo Buzz StumbleUpon

Jul
21

How to make a connection with a mySql database by using PHP?

To make a connection with a mySql database :

  1. Use wamp server, to download it click here. Install it.
  2. Start it, left click on the icon in the task bar ( I say left click ;) )  
  3. PHP > PHP Extensions > select php_mysql
  4. In your php page or classe use this code :// mySql connection
    $login_mysqlServer=USER; // your connection user
    $pwd_mysqlServer=PWD’; // password connection user
    $chaine_connexion_mysqlServer = IP_SERVER; // Name or IP of the databasse server
    $bd_mysqlServer=DB_NAME; // Database name
    $con_mysqlServer = mysql_connect($chaine_connexion_mysqlServer, $login_mysqlServer, $pwd_mysqlServer) or die(“Impossible to make connection with  mySQL Server “);
    $selected = mysql_select_db($bd_mysqlServer, $con_mysqlServer) or die(“Impossible to make connection with  mySQL Server “);
  5. Congratulation… You made a connection with your mySql database by using PHP.

 

See also :

 

 

 

Jul
20

How to make a connection with a sqlServer database by using PHP?

To make a connection with a mySql database :

  1. Use wamp server, to download it click here. Install it.
  2. Start it, left click on the icon in the task bar ( I say left click ;) )  
  3. PHP > PHP Extensions > select php_mssql
  4. In your php page or classe use this code :// sqlServer connection
    $login_sqlServer=USER; // your connection user
    $pwd_sqlServer=PWD’; // password connection user
    $chaine_connexion_sqlServer = IP_SERVER; // Name or IP of the databasse server
    $bd_sqlServer=DB_NAME; // Database name
    $con_sqlServer = mssql_connect($chaine_connexion_sqlServer, $login_sqlServer, $pwd_sqlServer) or die(“Impossible to make connection with  SQL Server “);
    $selected = mssql_select_db($bd_sqlServer, $con_sqlServer) or die(“Impossible to make connection with  SQL Server “);
  5. Congratulation… You made a connection with your sqlServer database by using php.

 

See also :

 

 

 

Jul
20

How to create a web service SOAP?

One of the useful solutions is to use the JAX-WS API. To do this, I suppose that you have:

  • IDE: Eclipse
  • JDK: 6
  • Tomcat 6 installed and configured to run under Eclipse, if it’s not the case, don’t be worry and click here to now how to do this.
  • JAX-WS.jar downloaded in your machine, because the jars of this API are not all delivered with the JDK. If it is not the case, click here to do it.

To create a web service SOAP with JAX-WS, we should have the following components:

  • The SOAP (Simple Object Access Protocol) as protocol to exchange XML data
  • A WSDL file (Web Service Description Language) to describe how to communicate with the web service
  • In the server side, a Java program should be deployed as a web service to use.
  • A Java program client to consume the web service.

To illustrate this, we try to implement a simple web service that gets the name of the user as an Input parameter and guesses his lucky number as an Output result.

Let’s go:

  1. Create a dynamic web project under Eclipse, rename it luckyNumber, if you don’t know how to do this, click here and execute the steeps from 6. to 10. . The default output folder is build\classes
  2. Download the tow following files and past them in the com.workspace.luckynumber (to create) :

    Many annotations are used:

    • XMLElement : to sepecify the name element in the schema of the XML file that will be generated later
    • @WebService : to specify the web service name
    • @WebMethod : to specify the method name that will be used in the web service
    • @Param : to specify the sent parameter name
    • @Result : to specify the name of  the result (Output of the web service)
  3. Create the SOAP envelope: run the console and go the default output folder to execute the following command: YOUR_WORKSPACE\luckyNumber\build\classes>wsgen -cp . com.workspace.luckynumber.LuckyNumberService -s ../../src
  4. As a result, two java classes should be generated in com.workspace.luckynumber.jaxws
    • GetLuckyNumber
    • GetLuckyNumberResponse
  5. To test this, you create a simple jsp page or you download the mine from here, and you put it in the webContent folder of your project.
  6. You have to configure your project and your web service, so download the following files and put them in the META-INF folder of your project (Right click > Save as…):
    • web.xml :  to configure the deployment of your project
    • sun-jaxws.xml : to configure the deployment of your web service
  7. You remember the famous jax-ws.jar that I ask you to download it in the beginning? No. Ok, do it please by clicking here, unzip it and copy/paste all the jars in CATALINA_HOME/lib. At this step, you should have something like this
  8. Clean your project, deploy it in your tomcat server and start the server.
  9. To test this application click here or tape the following URL in your browser (http://localhost:8080/luckyNumber/)
    Congratulations, you know now how to make a web service SAOP by using JAX-WS API.

 

See also :

Jul
19

How to send and receive parameters in PHP?


Fatal error: Call to undefined function wp_kses_attr_parse() in /home/jalalmj1/public_html/wp-includes/shortcodes.php on line 326