Senior & Expert PHP Developers Discussion Forum by Nyros Technologies

HIRE PHP Expert Developers Programmers Coders From India
PHP .Net Ruby on Rails Developers Community, Nyros Technologies, Kakinada
 
Log in  or IF not a member please REGISTER
Username:
Password:   


Keyword
Log in | Profile 

Web Services

 
Post new topic   Reply to topic    Senior & Expert PHP Developers Discussion Forum by Nyros Technologies Index -> In & Arround PHP
View previous topic :: View next topic  
Author Message
venkatadapa



Joined: 12 May 2008
Posts: 307

PostPosted: Fri Jan 23, 2009 12:50 pm    Post subject: Web Services Reply with quote

Web Services – Web server’s Methods

Web services are the services managed by web server. Web services allow us to share logic (or data) across many platforms and hardware configurations. For example, you can create a Java web service and someone else can consume it using a PHP client without having to learn single line of Java code. So web services are platform independent and language independent.

Web pages developed for end users and Web services developed for Programmers.

There are many available scripting languages that support web services. PHP is one such language, with a powerful open source functions and tools.

Uses:

Assume you have two websites; one is developed with ASP.NET and another with PHP. And you have good script (or logic) available in PHP for currency conversion or temperature converter etc., that is not available in .NET. But you want the same functionality in both the websites. Now you should create one service in PHP website, Web service is nothing but a function. So you can register one function with necessary parameters for currency conversion or temperature conversion etc., and uploaded in your PHP hosting server.

Now the .NET client can call that particular function with passing the necessary parameters. The Web service which resides in PHP hosting server would receive the request and process the request and send the output to the .NET client. Finally the .NET application will get the output.

Here .NET application uses the PHP Application Logic. The same logic should be used by any of programming language which supports web services. There are many available scripting languages that support web services. PHP is one such language, with a powerful open source functions and tools.

You can rise one question here i.e what is the matter if any unknown person knows your webservice means what type of security available to restrict your webservice access by unknown persons. The solution is there are some security procedures available to prevent your webservice from unauthorised access. The most used security procedures are

Domain name restriction
IPAddress restriction

So you can allow only some IPAddresses or domains to access your webservice. Ex: Deny all, allow 192.168.0.100 and Deny all, allow inkakinada.com,nyros.com etc.,


Roles of SOAP and XML:

Web services send and receive data in the form of Extensible Markup Language (XML), which travel via Simple Object Access Protocol (SOAP).

Web services uses the language XML to encode and decode your data and used the transport protocol SOAP to transport xml data between client and server.

XML [Extensible markup language] is a language which can be used for share information between different applications irrespective of platforms [windows / Linux etc] and languages [JAVA / PHP / .NET / ROR etc]. Hence XML is platform independent and language independent.

SOAP [Simple Object Access Protocol]: It a transport protocol for the client request to the web service and response to the client from web service.

SOAP Message Structure for request and response for webservice which calculates sum of two numbers:

Request from client to webservice

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:header>
----
</soap:header>
<soap:body>
<sum>
<a>10</a>
<b>20</b>
</sum>
</soap:body>
</soap:Envelope>

Soap header will contain any additional information to be send along with method call, like authentication information, security info etc, soap body will contain actual web service method call information with necessary parameters or result of method execution
soap fault will contain error info

Response from web service to client request

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:header>
----
</soap:header>
<soap:body>
<response>
<output>30</output>
</response>
</soap:body>
</soap:Envelope>

Examples:

IP2Location

Remote database accessing etc.,

Alternatives:

We can use XMLRPC [XML Remote Procedure Call] for remote data processing [or accessing].
Back to top
View user's profile Send private message
samir



Joined: 12 Nov 2007
Posts: 271

PostPosted: Thu Jan 29, 2009 12:49 pm    Post subject: Reply with quote

hi ,
Topic was explained in details and very helpful for the beginners of web services....

Rating : 4
Back to top
View user's profile Send private message
vani



Joined: 12 May 2008
Posts: 179

PostPosted: Thu Jan 29, 2009 12:52 pm    Post subject: Reply with quote

RATING : 4
Back to top
View user's profile Send private message
rajkumar



Joined: 13 May 2008
Posts: 163

PostPosted: Thu Jan 29, 2009 12:57 pm    Post subject: Reply with quote

hi venkat,

your web services example is very help ful to me .

RATING:3
Back to top
View user's profile Send private message
gopal



Joined: 12 May 2008
Posts: 39
Location: Kakinada

PostPosted: Thu Jan 29, 2009 1:05 pm    Post subject: Reply with quote

Hai Venkat

You explained very well how the web services are used in websites.

RANKING: 4

Thank You
_________________
Gopal


Last edited by gopal on Thu Jan 29, 2009 1:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
AnilKumar



Joined: 09 May 2008
Posts: 197

PostPosted: Thu Jan 29, 2009 1:05 pm    Post subject: Reply with quote

Rating : 4
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Senior & Expert PHP Developers Discussion Forum by Nyros Technologies Index -> In & Arround PHP
Page 1 of 1

 latest topics 
 Topics   Replies   Author   Views   Last Post 
No new posts how to delete plugins in openinviter
2 aababu 233 Wed Sep 01, 2010 7:27 am
aartylamba View latest post
No new posts ERROR IN PAYPAL PRO
0 tapati 20 Tue Aug 31, 2010 12:35 pm
tapati View latest post
No new posts file_exists always return false
0 orenk 114 Mon Aug 16, 2010 9:49 pm
orenk View latest post
No new posts problem with include fuction
0 bluearrow 117 Mon Aug 16, 2010 1:02 pm
bluearrow View latest post
No new posts Javascript not working in smarty .tpl files
1 samir 107 Mon Aug 16, 2010 5:42 am
venkatadapa View latest post
No new posts Add slashes automatically to all post params
0 samir 111 Mon Aug 16, 2010 5:18 am
samir View latest post
No new posts SMTP server settings when send mails through phpmailer class
0 venkatadapa 96 Mon Aug 16, 2010 4:49 am
venkatadapa View latest post
No new posts Parse the xml string content and display in browser using JS
0 venkatadapa 114 Mon Aug 09, 2010 1:22 pm
venkatadapa View latest post
No new posts Parse the xml file content and display in browser using JS
0 venkatadapa 119 Mon Aug 09, 2010 1:18 pm
venkatadapa View latest post
No new posts hipay
1 hassene003 142 Mon Aug 09, 2010 12:35 pm
aababu View latest post





Hire an expert PHP developer / coder / programmer or development team from India now!!

Other Forums : Ruby on Rails   ::   .Net   |   Free unlimited HTML CSS Joomla Wordpress Drupal templates download

Nyros Technologies   |   Developers Blog   |   Kakinada City Portal   |   About PHP Experts   |   More