1
votes

I am trying to host my WCF 4 web service in WAS and IIS for http and net.tcp. Is it possible to remove the .svc extension for net.tcp binding ??

If I do the following I get an error

There was no endpoint listening at net.tcp://myserver.com/service/TestService that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

 <system.serviceModel>
      <serviceHostingEnvironment multipleSiteBindingsEnabled="true">
          <serviceActivations>
              <add relativeAddress="TestService.svc" service="Web.TestService"/>
          </serviceActivations>   
      </serviceHostingEnvironment>     




      <services>
          <service name="Web.TestService" behaviorConfiguration="WebService">
              <host>
                  <baseAddresses>
                      <add baseAddress="http://myserver.com/service/" />

                  </baseAddresses>

              </host>
              <endpoint address=""  contract="Web.ITestService" binding="basicHttpBinding"></endpoint>
              <endpoint address="net.tcp://myserver.com:808/service/TestService" contract="Web.ITestService" binding="netTcpBinding"></endpoint>
              <endpoint address="net.tcp://myserver.com:808/service/TestService/mex"  binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange"></endpoint>
          </service>
      </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WebService">                       
          <serviceMetadata httpGetEnabled="true"/>            
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>   
  </system.serviceModel>
1

1 Answers

0
votes

Nazaf theses lines cause error because your adress is incorrect, you have two protocols.

baseAddress="http://myserver.com/service/"
+
<endpoint address="net.tcp://myserver.com:808/service/TestService" contract="Web.ITestService" binding="netTcpBinding"></endpoint>

You have two protocols in your adress, delete base adress and set the differents values

You can read this article about adressing it's very interessant : http://msdn.microsoft.com/en-us/magazine/cc163412.aspx