Silverlight 4 - relative web service address support

Author: Sergey Sorokin

Published: 2010-06-25 16:59:00

Last update: 2013-09-18 01:56:05

Tags: m2m
hmi
scada
web
csworks
silverlight
web service
xap

Slug: Silverlight-4-relative-web-service-address-support

Silverlight 4 supports the resolution of relative service addresses. Provided the Silverlight XAP package is hosted at http://somesite.com/application/ClientBin/Application.xap, the following address resolve as indicated:

"../Service1/Service.asmx" resolves to “http://somesite.com/application/Service1/Service.asmx”

For you, CSWorks users out there, it means one good thing: no more ServiceReferences.ClientConfig hassle, see Running CSWorks demo applications from remote clients post for details. Now you can simply specify relative service addres as follows:

<endpoint address="../LiveDataWebService/Service.asmx" ...>

and your CSWorks application will work from any website you deploy it to. Switching to Silverlight 4 pays off!