Print Page | Close Window

How to configure endpoints for Push service

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2283
Printed Date: 13-May-2026 at 11:29am


Topic: How to configure endpoints for Push service
Posted By: rasmus
Subject: How to configure endpoints for Push service
Date Posted: 04-Nov-2010 at 6:17pm

Hi

I am having trouble connecting my SL-client to my Push-service. I can tell the Notification-service is started in the log:
 
EntityServer listening on http://office1/BookingWeb/Services/EntityServer.svc/sl-NotificationService - http://office1/BookingWeb/Services/EntityServer.svc/sl-NotificationService
 
I get an error when the client attemps to subscribe to the NotificationService, and I can tell from the log that the server is not hit.
 
Can you please explain how I specify endpoints for the NotificationService for my client and server with a small sample of a Web.config section and a section from a ServiceReferences.ClientConfig.
 
Hope you can help
 
-Rasmus



Replies:
Posted By: kimj
Date Posted: 05-Nov-2010 at 10:09am
In the simplest configurations where you accept DevForce defaults, you don't need to provide a ClientConfig, and in your web.config all you need is the <notificationService enabled="true" /> setting, no serviceModel settings are required.  You also need to ensure several additional assemblies are deployed.  For the Silverlight application you need to reference the client version of System.ServiceModel.PollingDuplex.dll (it's in the "%Program Files(x86)%\Microsoft SDKs\Silverlight\v4.0\Libraries\Client" folder), and also IdeaBlade.EntityModel.Push.SL.  In the web application you must reference the server version of System.ServiceModel.PollingDuplex.dll ( (in the "%Program Files(x86)%\Microsoft SDKs\Silverlight\v4.0\Libraries\Server" folder).
 
For more advanced configurations where the config files are used you can find complete sample files in the Deployment folder of the DevForce Resource Center samples:  http://drc.ideablade.com/zip/DRC_SampleCode.zip - http://drc.ideablade.com/zip/DRC_SampleCode.zip .  Here are the highlights:
 
In the ServiceReferences.Clientconfig the endpoint and binding look like this (with your URL):
      <endpoint name="sl-NotificationService"
                address=" http://localhost:9009/EntityServer.svc/sl-NotificationService - http://localhost:9009/EntityServer.svc/sl-NotificationService "
                binding="customBinding" bindingConfiguration="pollingDuplex"
                contract="IdeaBlade.EntityModel.INotificationServiceAsync"
                />
 
       <binding name="pollingDuplex">
            <pollingDuplex duplexMode="MultipleMessagesPerPoll" inactivityTimeout="01:00:00"/>
            <binaryMessageEncoding />
            <httpTransport maxBufferSize="2147483647"  maxReceivedMessageSize="2147483647"
                  transferMode="StreamedResponse"/>
        </binding>
 
In the web.config -
The service endpoint (under EntityServer):
     <endpoint address="sl-NotificationService"
           binding="pollingDuplexHttpBinding" bindingConfiguration="duplexBinding"
           contract="IdeaBlade.EntityModel.INotificationService" />
 
The binding:
   <pollingDuplexHttpBinding>
        <binding name="duplexBinding"
         duplexMode="MultipleMessagesPerPoll" maxOutputDelay="00:00:03" />
   </pollingDuplexHttpBinding>
A binding extension is needed too:
    <bindingExtensions>
     <add name="pollingDuplexHttpBinding"
         type="System.ServiceModel.Configuration.PollingDuplexHttpBindingCollectionElement,
          System.ServiceModel.PollingDuplex,
          Version=4.0.0.0,
          Culture=neutral,
          PublicKeyToken=31bf3856ad364e35" />
    </bindingExtensions>
 

 
 
 


Posted By: rasmus
Date Posted: 05-Nov-2010 at 5:09pm
Hi
 
Thank you for your reply. I hvae double checked my assembly reference, and I have tried configuring the endpoints "manually", but still get the same error:
 
Message: Unhandled Error in Silverlight Application
Code: 4004   
Category: ManagedRuntimeError      
Message: IdeaBlade.EntityModel.EntityServerException: Unable to subscribe to service.  Make sure the EntityServer is listening for INotificationService operations. ---> IdeaBlade.Core.IdeaBladeException: Unable to subscribe to service.  Make sure the EntityServer is listening for INotificationService operations. ---> System.ServiceModel.CommunicationException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound.
   at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
   at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
   at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)
   --- End of inner exception stack trace ---
   at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
   at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
   --- End of inner exception stack trace ---
   at System.ServiceModel.Channels.Remoting.RealProxy.Invoke(Object[] args)
   at proxy_4.EndSubscribe(IAsyncResult )
   at IdeaBlade.EntityModel.PushClient.Subscribe(SessionBundle sessionBundle, SubscribeWorkState workstate)
   at IdeaBlade.EntityModel.NotificationCallbackManagerBase.Subscribe(SessionBundle sessionBundle, SubscribeWorkState workstate)
   --- End of inner exception stack trace ---
   at IdeaBlade.EntityModel.RemoteEntityServerProxyBase.CheckConnection(Exception pException)
   at IdeaBlade.EntityModel.EntityServerProxy.RegisterCallback(SessionBundle sessionBundle, SubscribeWorkState workstate)
   at IdeaBlade.EntityModel.EntityManager.<RegisterCallbackAsyncCore>b__57(RegisterCallbackOperation op)
   --- End of inner exception stack trace ---
   at IdeaBlade.EntityModel.AsyncProcessor`1.<>c__DisplayClass2.<.ctor>b__0(TArgs args)
   at IdeaBlade.EntityModel.AsyncProcessor`1.Signal()
   at IdeaBlade.EntityModel.AsyncProcessor`1.<Execute>b__5(Object x)    
Line: 56
Char: 13
Code: 0
URI: http://localhost/BookingWeb/Start/Booking.Test.ResourceManagementTestPage.aspx - http://localhost/BookingWeb/Start/Booking.Test.ResourceManagementTestPage.aspx
 
I believe the problem is the SL-client not conntecting to the service, but I am sure the endpoint is configured correctly. Do you have any idea for how to debug where the problem is?
 
Best regards,
 
Rasmus


Posted By: kimj
Date Posted: 05-Nov-2010 at 7:18pm
Since the stack trace isn't providing anything helpful here I would add either an ITraceLogger or a TraceViewer to the Silverlight application to capture trace messages.  You can find more information on the TraceViewer here:  http://drc.ideablade.com/xwiki/bin/view/Documentation/AdvPersist_TraceViewer#HUsingtheTraceViewerWithaSilverlightApp - http://drc.ideablade.com/xwiki/bin/view/Documentation/AdvPersist_TraceViewer#HUsingtheTraceViewerWithaSilverlightApp
and the ITraceLogger here:  http://drc.ideablade.com/ApiDocumentation/topic61.html.%20 - http://drc.ideablade.com/ApiDocumentation/topic61.html.
 
If your application is deployed to IIS and your assemblies are in the GAC, also make sure that the PollingDuplex.dll is specified in the web.config or available in the bin folder.
 
I'm assuming you've already tried the SL Push sample from the downloadable samples and that worked OK, correct? 


Posted By: rasmus
Date Posted: 11-Nov-2010 at 11:34am

Thank you for your pointer to the SL-TraceViewer. The Traceviewer showed this error:  "Could not find endpoint element ith name EntityServer.sc-NctificationService and contract..."

So I changed the name of my endpoint in ServiceReferences.ClientConfig from

sl-NotificationService to EntityServer.svc-NotificationService

And that solved my problem. If this could be a help for others, here is my complete ServiceReferences.ClientConfig:
<configuration>

<system.serviceModel>

<client>

<endpoint name="EntityService"

address="../Services/EntityService.svc"

binding="customBinding" bindingConfiguration="customBinaryBinding"

contract="IdeaBlade.EntityModel.IEntityServiceContractAsync"

/>

<endpoint name="EntityServer"

address="../Services/EntityServer.svc"

binding="customBinding" bindingConfiguration="customBinaryBinding"

contract="IdeaBlade.EntityModel.IEntityServerContractAsync"

/>

<endpoint name="EntityServer.svc-NotificationService"

address="../Services/EntityServer.svc/sl-NotificationService"

binding="customBinding" bindingConfiguration="pollingDuplex"

contract="IdeaBlade.EntityModel.INotificationServiceAsync"

/>

</client>

<bindings>

<customBinding>

<!-- Custom binding using http, binary encoding, no security -->

<binding name="customBinaryBinding">

<binaryMessageEncoding/>

<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />

</binding>

<!-- Simulates the PollingDuplexHttpBinding used by Push -->

<binding name="pollingDuplex">

<pollingDuplex duplexMode="MultipleMessagesPerPoll" inactivityTimeout="01:00:00"/>

<binaryMessageEncoding />

<httpTransport maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" transferMode="StreamedResponse"/>

</binding>

</customBinding>

</bindings>

</system.serviceModel>

</configuration>

 


Posted By: pponzano
Date Posted: 11-Jan-2012 at 1:36am
Hello,
I'm facing a similar iussue under a WPF application... I've got a DomainModel splitted by Server/Client and I've added my watcher as shared link in order to use it with the WPF application...

the inner exception is

Caught exception: IdeaBlade.Core.IdeaBladeException: Unable to create the server delegate 'myProject.DomainModel.UserMessageWatcher, myProject.DomainModel.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.NewUserMessageService' ---> IdeaBlade.Core.IdeaBladeException: Unable to load type: myProject.DomainModel.UserMessageWatcher, myProject.DomainModel.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null at IdeaBlade.Core.ReflectionFns.GetLatestType(String pTypeName, Boolean pThrowOnError, Boolean pIgnoreCase) at IdeaBlade.Core.ReflectionFns.GetDelegate[T](String pTypeName, String pMethodName, Type[] pSignature) at IdeaBlade.EntityModel.Server.NotificationServiceManager.Subscribe(SessionBundle sessionBundle, SubscribeWorkState workstate) --- End of inner exception stack trace --- at IdeaBlade.EntityModel.Server.NotificationServiceManager.Subscribe(SessionBundle sessionBundle, SubscribeWorkState workstate) at IdeaBlade.EntityModel.Server.EntityServer.Subscribe(SessionBundle sessionBundle, SubscribeWorkState workstate) at SyncInvokeSubscribe(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

Any help on this?
Thanks




Print Page | Close Window