0
votes

I have one site that uses an old WCF service environment and a new one that uses a newer environment.

When I say environments I mean WCF services dll that expose same contract and methods, yet they are implemented in a different manner.

It appears that I cannot use the same server (IIS) for this kind of setup, as trying to use the newer site produces errors and I've noticed that the traffic is being redirected to the old WCF environment. (I have checked my sites configuration and binding, it's all 100% good).

My question is whether this setup of 2 sites using the same named contact can be accomplished ? It appears to me that it doesn't, even though they are distinguished by the service address.

Server (old):

<service name="Services.API.AnonymousUserService" behaviorConfiguration="ProductionBehavior">
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://old.mysite.com:808/AnonymousUserService.svc" />
      </baseAddresses>
    </host>
    <endpoint name="tcp"
              address=""
              binding="netTcpBinding" bindingConfiguration="ProductionBinding"
              contract="Services.API.IAnonymousUserService" />
    <endpoint name="mex"
              address="mex"
              binding="mexTcpBinding"
              contract="IMetadataExchange" />

  </service>

Client (old)

<client>
    <endpoint name="tcp"
        address="net.tcp://old.mysite.com/AnonymousUserService.svc"
        binding="netTcpBinding" bindingConfiguration="ProductionBinding" 
        contract="ServiceAnonymousUser.IAnonymousUserService">
        <identity>
            <servicePrincipalName value="host/production01.local" />
        </identity>
    </endpoint> 
</client>

Server (new):

Same as Server (old), only the address is "net.tcp://new.mysite.com:808/AnonymousUserService.svc"

Client (new):

Same as Client (old), only the address is "net.tcp://new.mysite.com/AnonymousUserService.svc"

1
If it is on the same machine. You have to change the port number. they are both using the same port.Tan
Tan, I have tried what you suggested yet my new site is still using the old service, disregarding the difference in ports. My new service is down (both site and application pool), and my new site has a client configuration that refers to the new site. I'm totally clueless about this thing.Dror Weiss
Can you put up some code where you are using the service proxy ? maybe you are pointing to the old service in the setttings file.Tan
I'm using StructureMap to handle the instanciations. x.For<IAnonymousUserService>().Use(new AnonymousUserServiceClient()); If I remove the <client> tag from the web.config of the site, I get a StructureMap 202 error, which means it cannot instanciate it (which is fine).Dror Weiss
put a break point just before the client makes the service call, and check the endpoint address. If its a deployed env, use wiresharkDhawalk

1 Answers

0
votes

Ok, managed to finally solve it (after 8 freakin' hours).

This man's question has the answer!

If the link ever gets broken then the issue lies in the site's port binding for net.tcp: Instead of using "808:*" for the sites, use "808:www.site-a.com" and "808:www.site-b.com" for each.