New Posts New Posts RSS Feed: Net.TCP BOS hosted in IIS 7.0
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Net.TCP BOS hosted in IIS 7.0

 Post Reply Post Reply
Author
Cornholio View Drop Down
Newbie
Newbie
Avatar

Joined: 14-Feb-2011
Location: South Africa
Posts: 5
Post Options Post Options   Quote Cornholio Quote  Post ReplyReply Direct Link To This Post Topic: Net.TCP BOS hosted in IIS 7.0
    Posted: 03-Aug-2011 at 6:59am

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

Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 05-Aug-2011 at 1:37pm
Cornholio,

I reproduced the issue here.
I'm trying to troubleshoot it and will follow up soon.

Regards,
   Silvio.
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 10-Aug-2011 at 9:27am
Hi Cornholio,
When hosting the BOS using net.tcp, the application_start in Global.asax is not invoked by WAS (so VirtualPathProvider can't be used). The workaround is to define physical *.svc files for all EntityService and EntityServers needed.
 
However,  we verified that the exception thrown when using .svc files is due to a bug.
Fortunatelly, this bug has already been fixed and will be available in our next release. (Mid September)
 
Let us know if you would want a patch in the meantime.
 
Regards,
   Silvio.
Back to Top
Cornholio View Drop Down
Newbie
Newbie
Avatar

Joined: 14-Feb-2011
Location: South Africa
Posts: 5
Post Options Post Options   Quote Cornholio Quote  Post ReplyReply Direct Link To This Post Posted: 11-Aug-2011 at 12:06am
Hi Silvio,

Thanks for solving the issue.

If I can get my hands on a patch that would be great.

Regards,
Neil


Edited by Cornholio - 22-Aug-2011 at 11:38pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down