3

If one needs to expose multiple endpoints (e.g., one with basicHttpBinding, and another with netTcpBinding) for a single contract in a heterogeneous environment, on a WAS-hosted service, how does one do it?

Everything I've read about WAS configuration of endpoints indicates that endpoint addresses and host base addresses should be left blank, because WAS is supposed to automatically resolve addresses via the path to the .svc file and the protocol.

However, it seems impossible to define an HTTP endpoint and a TCP endpoint for the same contract without explicating the addresses. Every attempt of mine thus far has netted me the coveted "a binding instance has already been associated to listen uri" error.

Ideas?

Thanks

user364825
  • 235
  • 1
  • 2
  • 11
  • It should not show that error if you specify a different base url for each endpoint. Can you post your config file code here? – decyclone Jun 23 '10 at 19:05
  • @decyclone: From what I've read on MSDN, base addresses are not supposed to be specified with WAS. WAS is supposed to resolve the address via the protocol and the path to the .svc file. Since the two endpoints use different protocols, each should resolve uniquely. Thanks – user364825 Jun 23 '10 at 19:14

2 Answers2

1

See if this works for you http://knowledgebaseworld.blogspot.com/2010/06/domain-name-replaced-with-machine-name.html I was hainvg same issue of "a binding instance has already been associated to listen uri" which get fixed by adding httpGetUrl along with binding address

IBhadelia
  • 291
  • 1
  • 5
0

As far as I understand, the *.svc file is only viable for HTTP protocols, e.g. you can use it for your basicHttpBinding connection. In that case, you're absolutely right - the service's base address and the endpoint's address attribute are ignored - the service URI is defined by server name, optionally port, the virtual directory where the SVC file resides, and the name and extension of the SVC file itself.

So as long as you don't need multiple different HTTP-like protocols and endpoints, that one SVC file should take care of the HTTP traffic.

However, these options do not apply to non-http protocols, like netTcpBinding. In that case, you need to define an endpoint address (possibly as a relative path off an appropriate base address) in your web.config.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Thanks for responding. If I do not specify the host base address, and configure the endpoint address for the netTcpBinding endpoint in the WAS config file as only "/tcp" and send a request to net.tcp://localhost/MyService/Service.svc/tcp, the request appears to be routed correctly. Also, if I generate a proxy from that configuration, the client address is generated as net.tcp://localhost/MyService/Service.svc/tcp (same addr as before). Those two factors seem to imply that WAS resolves the base address using the protocol and path to the SVC file for TCP bindings. – user364825 Jun 23 '10 at 19:49
  • @User364825: it is my understanding that you need to have an **complete** address in your endpoint, or if you want to use a relative address like "/tcp", you **must** have a base address – marc_s Jun 24 '10 at 05:00