Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


WCF:Do we have to use the relative addresses when hosting
in the IIS or the absolute addresses? Why?



WCF:Do we have to use the relative addresses when hosting in the IIS or the absolute addresses? Wh..

Answer / jt

IIS Addressing Considerations

When hosting in IIS, you don’t have to worry about creating
or managing the ServiceHost instance. IIS takes care of
this for you behind the scenes. You simply map a .svc
endpoint to your service class, configure the service
endpoints and behaviors in web.config, and let Windows
Communication Foundation manage the process of creating and
configuring the ServiceHost instance at runtime.

In this hosting scenario, the base HTTP address is
determined by the IIS virtual directory housing the service
along with the name of the .svc file. You, as the
developer, really have nothing to say about the base
address since it’s fully controlled by the IIS addressing
scheme.

As a result, Windows Communication Foundation happily
ignores any base addresses you may specify in web.config in
this scenario. If you want to change the base address for
your endpoints, you’ll need to move the service to a
different IIS virtual directory.

Not only does IIS control the base address, it forces all
of your endpoints to actually use the same base address
(unlike self-hosting). This means that if you do specify an
absolute address for a particular endpoint, it must start
with the base address corresponding to the virtual
directory or you’ll get an exception. As a result, it
really only makes sense to use relative addresses when
hosting in IIS.

You will need to use relative addresses when exposing more
than one endpoint for a particular .svc service (we’ll
discuss why you’d want to do this shortly).
Let’s take a look at an example. Suppose you have a file
named calc.svc and you place it in a virtual directory that
corresponds to http://localhost:8080/calcservice. The base
address for this service will be
http://localhost:8080/calcservice/calc.svc. Assuming you’ve
enabled HTTP GET metadata retrieval, the help page will be
exposed at that same address, which you can simply browse
to in Internet Explorer....
Please see the url http://msdn.microsoft.com/en-
us/magazine/cc163412.aspx#S3

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More WCF Interview Questions

Explain service contracts?

0 Answers  


What is difference between WCF service application and WCF service Library?

0 Answers   Petranics Solutions, Viscus Infotech,


explain what is transport and message reliability? : Wcf data services

0 Answers  


What is service proxy in wcf?

0 Answers  


What are the different wcf binding available?

0 Answers  


Explain the wcf ria?

0 Answers  


What are the endpoints in wcf? Or explain abcs of endpoint?

0 Answers  


What is endpoint in wcf?

0 Answers  


WCF:What is it the Dead-letter queue and the Poison queue? What is the difference?

1 Answers  


What are the protocols supported by wcf hosting environment?

0 Answers  


List the principle constituents of wcf?

0 Answers  


WCF:Do we have to use the relative addresses when hosting in the IIS or the absolute addresses? Why?

1 Answers  


Categories