Hi,
I’m having great difficulty getting a simple net.tcp,
n-tier deployment working on IIS.
What I have done:
·
IIS 7.0 is installed & the “Windows
Communication Foundation Non-HTTP Activation” feature is enabled.
·
Windows Process Activation, Net.Tcp Port Sharing
& Net.Tcp Listener Adapter Services are Automatic & started.
·
For IIS in the “Site Bindings” I have set
net.tcp to 12345:* and for the BOS Web Application I have set “Enabled
Protocols” to http,net.tcp
·
The Application Pool is .NET 4, Integrated
I have successfully implemented a standard WCF Duplex
Service over TCP so I’m pretty sure all of this is setup correctly.
The Web.Config contains the following:
<ideablade.configuration version="6.00" xmlns="http://schemas.ideablade.com/2010/IdeaBladeConfig">
<logging logFile="log\DebugLog.xml" />
</ideablade.configuration>
<system.serviceModel>
<services>
<service name="EntityService" >
<endpoint address=""
binding="netTcpBinding"
bindingConfiguration="InsecureTcp"
contract="IdeaBlade.EntityModel.IEntityServiceContract" />
</service>
<service name="EntityServer">
<endpoint address=""
binding="netTcpBinding"
bindingConfiguration="InsecureTcp"
contract="IdeaBlade.EntityModel.IEntityServerContract" />
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="InsecureTcp" portSharingEnabled="true">
<security mode="None"/>
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>
And the App.Config:
<ideablade.configuration version="6.00" xmlns="http://schemas.ideablade.com/2010/IdeaBladeConfig">
<logging logFile="DebugLog.xml"/>
<objectServer>
<clientSettings isDistributed="true" />
</objectServer>
</ideablade.configuration>
<system.serviceModel>
<client>
<endpoint name="EntityService"
address="net.tcp://localhost:12345/WpfApplication1Web/EntityService.svc"
binding="netTcpBinding"
bindingConfiguration="BasicTcp"
contract="IdeaBlade.EntityModel.IEntityServiceContract"/>
<endpoint name="EntityServer"
address="net.tcp://localhost:12345/WpfApplication1Web/EntityServer.svc"
binding="netTcpBinding"
bindingConfiguration="BasicTcp"
contract="IdeaBlade.EntityModel.IEntityServerContract"/>
</client>
<bindings>
<netTcpBinding>
<binding name="BasicTcp">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>
When I run the application I get the following error: Cannot
find ObjectServer or default ServiceKey
When looking in the Client log file there is this message:
There was no endpoint listening at net.tcp://localhost:12345/WpfApplication1Web/EntityService.svc
that could accept the message. This is often caused by an incorrect address or
SOAP action. See InnerException, if present, for more details.
The weird thing is that if I open the EntityService in
a web browser (http://localhost/WpfApplication1Web/EntityService.svc )and then run the application, everything works. It
seems to me that the Activation of the TCP endpoint is not working unless the
http endpoint is activated first.
Another option I tried was to explicitly create the EntityServer.svc
& EntityService.svc file and comment out the RegisterVirtualPathProvider in
the Global.asax.
When running the application I get the same error as above,
but in the Event View there is this:
WebHost failed to process a request.
Sender Information:
System.ServiceModel.ServiceHostingEnvironment+HostingManager/21967170
Exception:
System.ServiceModel.ServiceActivationException: The service
'/WpfApplication1Web/EntityService.svc' cannot be activated due to an exception
during compilation. The exception
message is: The type initializer for 'IdeaBlade.Core.TraceFns' threw an
exception.. ---> System.TypeInitializationException: The type initializer
for 'IdeaBlade.Core.TraceFns' threw an exception. --->
System.NullReferenceException: Object reference not set to an instance of an
object.
at IdeaBlade.Core.TracePublisher.Subscribe(Guid pKey,
ITraceSubscriberCallback pSubscriber)
at IdeaBlade.Core.TraceSubscriber.StartSubscription()
at IdeaBlade.Core.DefaultSubscriber.StartSubscribing()
at IdeaBlade.Core.TraceFns.Initialize()
at IdeaBlade.Core.TraceFns..cctor()
--- End of inner exception stack trace ---
at IdeaBlade.Core.TraceFns.WriteLine(Object value)
at IdeaBlade.Core.IdeaBladeConfig.Initialize()
at
IdeaBlade.EntityModel.RemoteServiceFns.AddSerializationBehavior(ContractDescription
contract)
at IdeaBlade.EntityModel.Server.EntityServiceHost.AddBehaviors()
at IdeaBlade.EntityModel.Server.EntityServiceHost.ApplyConfiguration()
at
System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection
baseAddresses)
at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[]
baseAddresses)
at
IdeaBlade.EntityModel.Server.EntityServiceHostFactory.CreateHostCore(Type
serviceType, Uri[] baseAddresses)
at
IdeaBlade.EntityModel.Server.EntityServiceHostFactory.CreateServiceHost(Type
serviceType, Uri[] baseAddresses)
at
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String
constructorString, Uri[] baseAddresses)
at
System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String
normalizedVirtualPath)
at
System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String
normalizedVirtualPath)
at
System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String
normalizedVirtualPath)
--- End of inner exception stack trace ---
at
System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String
normalizedVirtualPath)
at
System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String
relativeVirtualPath)
Process Name: w3wp
Process ID: 6048
I’m all out of ideas, any help will be greatly appreciated.
Alternatively, can I get hold a working wpf sample application
for an n-tier, net.tcp configuration?
I'm using Devforce 6.1.1.1 for a WPF application
Regards,
Cornholio