web config - WCF: relativeAddress,baseAddress and binding -



web config - WCF: relativeAddress,baseAddress and binding -

i new in wcf , start expirience simple file-less application part of (web.config) can see below:

<servicehostingenvironment multiplesitebindingsenabled="true"> <serviceactivations> <add factory="system.servicemodel.activation.servicehostfactory" relativeaddress="./relativeaddress.svc" service="wcf_transactions.myservice1"/> </serviceactivations> </servicehostingenvironment>

now can access service at

http://localhost:18148/relativeaddress.svc

then add together next lines:

<services> <service name="wcf_transactions.myservice1" behaviorconfiguration="mybehavior1"> <host> <baseaddresses> <add baseaddress="http://localhost:18148/" /> </baseaddresses> </host> <endpoint address="/relativeaddressx.svc" binding="basichttpbinding" contract="wcf_transactions.iservice1"></endpoint> </service> </services> <behaviors> <servicebehaviors> <behavior name="mybehavior1"> <servicemetadata httpgetenabled="true" /> </behavior> </servicebehaviors> </behaviors>

so expect service accessible through next address:

http://localhost:18148/relativeaddressx.svc

but cant this. have misunderstood?

msdn http://msdn.microsoft.com/en-us/library/ms733749.aspx: *

there 2 ways specify endpoint addresses service in wcf. can specify absolute address each endpoint associated service or can provide base of operations address servicehost of service , specify address each endpoint associated service defined relative base of operations address. can utilize each of these procedures specify endpoint addresses service in either configuration or code. if not specify relative address, service uses base of operations address.

* according illustration have base of operations adress

http://localhost:18148/

and combined relativeaddress.svc, name of svc file. , seek combine string /relativeaddressx.svc part of endpoint adress. have

http://localhost:18148/relativeaddress.svc/relativeaddressx.svc.

your endpoint must not specify path svc in iis. should containg logical adress, assosiated point. seek alter endpoint following:

<endpoint address="addressx" binding="basichttpbinding" contract="wcf_transactions.iservice1"></endpoint>

and should accessible path

http://localhost:18148/relativeaddress.svc/addressx

wcf web-config wcf-binding

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -