Search for:
Jump to: 
Your Ad Here
Post new topic Reply to topic
Author Message
 Post subject: Web Services
PostPosted: Fri Jan 23, 2009 12:50 pm 
Offline

Joined: Mon May 12, 2008 11:43 am
Posts: 307
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].


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 12:49 pm 
Offline

Joined: Mon Nov 12, 2007 10:12 am
Posts: 357
hi ,
Topic was explained in details and very helpful for the beginners of web services....

Rating : 4


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 12:52 pm 
Offline

Joined: Mon May 12, 2008 12:20 pm
Posts: 179
RATING : 4


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 12:57 pm 
Offline

Joined: Tue May 13, 2008 3:43 am
Posts: 214
hi venkat,

your web services example is very help ful to me .

RATING:3


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 1:05 pm 
Offline

Joined: Mon May 12, 2008 2:52 am
Posts: 39
Location: Kakinada
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.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2009 1:05 pm 
Offline

Joined: Fri May 09, 2008 4:10 am
Posts: 229
Rating : 4


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic    [ 6 posts ] 

1, 2, 3, 4, 5 ... 481
Recent topics  Replies   Views   Last post 
No new posts Application Maintenance

by vibrantinfo07 » Thu May 17, 2012 1:03 pm in Others(phpBB, phpfox, etc..)

0

12

Thu May 17, 2012 1:03 pm

vibrantinfo07 View the latest post

No new posts How to recover lost data for Mac OS.

by vickywujiaqi » Wed Jan 12, 2011 3:01 pm in Others(phpBB, phpfox, etc..)

6

2011

Thu May 17, 2012 12:57 pm

vibrantinfo07 View the latest post

No new posts Email marketing is efficient to get traffic!

by ElaineWang » Thu May 17, 2012 2:57 am in HTML

0

18

Thu May 17, 2012 2:57 am

ElaineWang View the latest post

No new posts Set Up Helpdesk System With Cloud Based Helpdesk Software

by ElaineWang » Thu May 17, 2012 2:55 am in Other Webserver Softwares

0

16

Thu May 17, 2012 2:55 am

ElaineWang View the latest post

No new posts Need Help with PHP in Dreamweaver

by kartune » Wed Mar 21, 2012 7:31 am in Macromedia Dreamweaver

1

323

Tue May 15, 2012 5:43 pm

MyronDsouza View the latest post


Your Ad Here