Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How can we host a service on two different protocols on a single server
How can we host a service on two different protocols on a single server?
✍: Guest
Let’s first understand what this question actually means. Let’s say we have made a service
and we want to host this service using HTTP as well as TCP. You must be wondering why
to ever host services on two different types of protocol. When we host a service it’s
consumed by multiple types of client and it’s very much possible that they have there
own protocol of communication. A good service has the capability to downgrade or
upgrade its protocol according the client who is consuming him.
Let’s do a small sample in which we will host the ServiceGetCost on TCP and HTTP
protocol.
Below is the code snippet pasted from the same sample. As usual we have numbered
them and here is the explanation of the same:
1 and 2 -- As we are hosting the service on two protocols we need to create two objects
if the URI. You can also give the URI through config file. Pass these two objects of the
URI in the constructor parameter when creating the service host object.
Figure 15.21:- Server side code for Multi Protocol hosting
3 – In the config file we need to define two bindings and end point as we are hosting the
service in multiple protocols.
Once we are done the server side coding its time to see make a client by which we can
switch between the protocols and see the results. Below is the code snippet of the client
side for multi-protocol hosting.
2007-11-04, 5921👍, 0💬
Popular Posts:
Does .NET support UNICODE and how do you know it supports? Yes .NET definitely supports UNICODE. Try...
How To Control Table Widths? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells Usually, b...
Which bit wise operator is suitable for checking whether a particular bit is on or off? The bitwise ...
How To Set session.gc_divisor Properly? - PHP Script Tips - Understanding and Using Sessions As you ...
How To Manage Transaction Isolation Level? - Oracle DBA FAQ - Introduction to PL/SQL Transaction iso...