<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Silverlight Net.TCP Remotable TracePublish Support?</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Silverlight Net.TCP Remotable TracePublish Support?</description>
  <pubDate>Sun, 12 Apr 2026 17:16:36 -700</pubDate>
  <lastBuildDate>Wed, 22 Dec 2010 18:22:01 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2387</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Silverlight Net.TCP Remotable TracePublish Support? : OK, we&amp;#039;ve added this to the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2387&amp;PID=9456#9456</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 2387<br /><strong>Posted:</strong> 22-Dec-2010 at 6:22pm<br /><br />OK, we've added this to the feature request queue.&nbsp; ]]>
   </description>
   <pubDate>Wed, 22 Dec 2010 18:22:01 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2387&amp;PID=9456#9456</guid>
  </item> 
  <item>
   <title>Silverlight Net.TCP Remotable TracePublish Support? :   Hi Kim,Thanks for the quick...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2387&amp;PID=9455#9455</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=701" rel="nofollow">JoeGershgorin</a><br /><strong>Subject:</strong> 2387<br /><strong>Posted:</strong> 22-Dec-2010 at 5:12pm<br /><br /><div>Hi Kim,</div><div><br></div>Thanks for the quick reply. Yes, I'm aware of the included client and server trace viewers. I've implemented my own versions of the client trace viewer based on Telerik data grids. One that runs inside a popup RadWindow that can be called by a keyboard hotkey. It has find as you type keyword search capability, detail views, auto scrolling, and the ability to export the log to excel, csv, etc... I have another implementation of the Silverlight client trace viewer that&nbsp;receives&nbsp;local trace messages via the local messaging api and can run in a different physical browser window (or out of browser)&nbsp;parallel&nbsp;to another local Silverlight application it is monitoring.&nbsp;<div><br></div><div>I'm looking to replicate/extend the functionality of the Winform/WPF BOS trace viewers included with DevForce in Silverlight form that can bundled with projects I'm working on. Right now the furthest I've gotten is a server BOS .log file downloader/viewer. But I would like live BOS trace viewing the way the Win/WPF apps work but through a Silverlight OOB app. I mean it's 99% of the way there with the only hurdle being the <span ="apple-style-span"="" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;">NetDataContractSerializerlization of the Subscribe operation. I guess as a work around I could probably create my own push service server side. But I was hoping to be able to create an SL OOB BOS Trace viewer that didn't require app modification beyond turning on the remote trace publisher.&nbsp;</span></div><div><span ="apple-style-span"="" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><br></span></div><div><span ="apple-style-span"="" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px;">Put me in for a +1 vote for SL&nbsp;compatibility, thanks.</span></div><span style="font-size:10px"><br /><br />Edited by JoeGershgorin - 22-Dec-2010 at 5:18pm</span>]]>
   </description>
   <pubDate>Wed, 22 Dec 2010 17:12:24 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2387&amp;PID=9455#9455</guid>
  </item> 
  <item>
   <title>Silverlight Net.TCP Remotable TracePublish Support? : In a Silverlight application tracing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2387&amp;PID=9453#9453</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 2387<br /><strong>Posted:</strong> 22-Dec-2010 at 2:59pm<br /><br />In a Silverlight application tracing actually occurs in two locations:&nbsp; the Silverlight application generates trace messages for local activities on that client instance, and the BOS generates trace messages for all server-side activities.&nbsp; So the first question is do you truly want to subscribe to the BOS tracing or just see local trace messages (sorry, we don't have a central logging&nbsp; facility).&nbsp; <DIV>&nbsp;</DIV><DIV>If you do want to see the BOS tracing, as you found the trace publisher is not consumable by a Silverlight application, but we'll look into changing this.&nbsp; For the record, I'll mention that the two trace viewers which ship with DevForce (which come in WPF and WinForms flavors) do by default subscribe to the BOS publisher.</DIV><DIV>&nbsp;</DIV><DIV>For local Silverlight trace messages, we do provide a simple subscriber in the sample TraceViewer user control, which you can find buried somewhere in the Deployment folder of the DevForce Resource Center samples download.&nbsp;&nbsp; We also provide the ITraceLogger interface, which defines&nbsp;a very simple interface to receive local trace messages on any platform.&nbsp; You can find more information on this in the DRC.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 22 Dec 2010 14:59:22 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2387&amp;PID=9453#9453</guid>
  </item> 
  <item>
   <title>Silverlight Net.TCP Remotable TracePublish Support? : Silverlight 4 added the ability...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2387&amp;PID=9450#9450</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=701" rel="nofollow">JoeGershgorin</a><br /><strong>Subject:</strong> 2387<br /><strong>Posted:</strong> 22-Dec-2010 at 1:04pm<br /><br /><div>Silverlight 4 added the ability to consume Net.TCP WCF services, which is the way the IdeaBlade Remoteable TracePublisher is exposed. So I went about the task to see if I could consume it in a Silverlight 4 app.</div><div><br></div><div>I made the publisher remoteable in Global.asax:</div><div><br></div><div>// ------------------------------------------------------------</div><div>// Silverlight Client Notes: &nbsp; &nbsp;</div><div>// ------------------------------------------------------------</div><div>// Only ports 4502-4534 are allowed for Silverlight access. Also&nbsp;</div><div>// a clientaccesspolicy.xml which allows the connection port&nbsp;</div><div>// must exist in the root domain on port 80&nbsp;</div><div>// (eg. http://localhost/clientaccesspolicy.xml) &nbsp; &nbsp; &nbsp; &nbsp;</div><div>//</div><div>// ------------------------------------------------------------</div><div>// Sample clientacesspolicy.xml file</div><div>// ------------------------------------------------------------</div><div>// &lt;?xml version="1.0" encodinga="utf-8"?&gt;</div><div>// &lt;access-policy&gt;</div><div>// &nbsp;&lt;cross-domain-access&gt;</div><div>// &nbsp; &nbsp;&lt;policy&gt;</div><div>// &nbsp; &nbsp; &nbsp;&lt;allow-from&gt;</div><div>// &nbsp; &nbsp; &nbsp; &nbsp;&lt;domain uri="*" /&gt;</div><div>// &nbsp; &nbsp; &nbsp;&lt;/allow-from&gt;</div><div>// &nbsp; &nbsp; &nbsp;&lt;grant-to&gt;</div><div>// &nbsp; &nbsp; &nbsp; &nbsp;&lt;socket-resource port="4502-4534" protocol="tcp" /&gt;</div><div>// &nbsp; &nbsp; &nbsp;&lt;/grant-to&gt;</div><div>// &nbsp; &nbsp;&lt;/policy&gt;</div><div>// &nbsp;&lt;/cross-domain-access&gt;</div><div>// &lt;/access-policy&gt;</div><div>//</div><div>// The port restriction and clientaccesspolicy.xml required for Silverlight is not</div><div>// needed for Silverlight trusted (Out of Browser) applications.</div><div>&nbsp;&nbsp; &nbsp;</div><div>IdeaBlade.Core.TracePublisher.LocalInstance.MakeRemotable(4502, "TracePublisher");</div><div>&nbsp;&nbsp; &nbsp;</div><div>The next hurdle was that some of the Silverlight types that need to be passed were not decorated with DataContracts for their Silverlight versions. So I created proxy classes that defiend the contract that are shared between the client and server:</div><div><br></div><div>&#091;ServiceContract(Name = "ITracePublisher", CallbackContract = typeof(ITraceSubscriberCallbackEx))&#093;</div><div>public interface ITracePublisherEx</div><div>{</div><div>&nbsp;&nbsp; &nbsp;// Methods</div><div>&nbsp;&nbsp; &nbsp;&#091;OperationContract(AsyncPattern = true)&#093;</div><div>&nbsp;&nbsp; &nbsp;IAsyncResult BeginPing(AsyncCallback cb, object state); &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp;bool EndPing(IAsyncResult r);</div><div><br></div><div>&nbsp;&nbsp; &nbsp;&#091;OperationContract(AsyncPattern = true)&#093;</div><div>&nbsp;&nbsp; &nbsp;IAsyncResult BeginSubscribe(Guid pKey, ITraceSubscriberCallback pSubscriber, AsyncCallback cb, object state);</div><div>&nbsp;&nbsp; &nbsp;void EndSubscribe(IAsyncResult r);</div><div><br></div><div>&nbsp;&nbsp; &nbsp;&#091;OperationContract(AsyncPattern = true)&#093;</div><div>&nbsp;&nbsp; &nbsp;IAsyncResult BeginUnsubscribe(Guid pKey, AsyncCallback cb, object state);</div><div>&nbsp;&nbsp; &nbsp;void EndUnsubscribe(IAsyncResult r); &nbsp; &nbsp; &nbsp;&nbsp;</div><div>}&nbsp;</div><div><br></div><div>&#091;ServiceContract(Name = "ITraceSubscriberCallback")&#093;</div><div>public interface ITraceSubscriberCallbackEx</div><div>{</div><div>&nbsp;&nbsp; &nbsp;&#091;OperationContract(IsOneWay = true)&#093;</div><div>&nbsp;&nbsp; &nbsp;void OnPublish(TraceMessage pTraceMessage);</div><div>}</div><div><br></div><div>&#091;KnownType(typeof(CustomTraceSubscriber))&#093; &nbsp; &nbsp;</div><div>&#091;DataContract&#093;</div><div>public class CustomTraceSubscriber : ITraceSubscriberCallback, IKnownType, ITraceSubscriberCallbackEx</div><div>{</div><div>&nbsp;&nbsp; &nbsp;public Guid Id { get; private set; }</div><div>&nbsp;&nbsp; &nbsp;private ITracePublisherEx _serverTracePublisher;</div><div><br></div><div>&nbsp;&nbsp; &nbsp;public CustomTraceSubscriber()</div><div>&nbsp;&nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Id = Guid.NewGuid();</div><div>&nbsp;&nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp;public CustomTraceSubscriber Connect(string hostname = "localhost", string port = "4502", string serviceName = "TracePublisher")</div><div>&nbsp;&nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (_serverTracePublisher == null)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var customBinding = new CustomBinding(new TcpTransportBindingElement());</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var endpointAddress = new EndpointAddress("net.tcp://" + hostname + ":" + port + "/" + serviceName);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var callbackInstance = new InstanceContext(this);</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var factory = new DuplexChannelFactory&lt;ITracePublisherEx&gt;(callbackInstance, customBinding, endpointAddress);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_serverTracePublisher = factory.CreateChannel(); &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;return this;</div><div>&nbsp;&nbsp; &nbsp;} &nbsp; &nbsp; &nbsp; &nbsp;</div><div><br></div><div>&nbsp;&nbsp; &nbsp;public void SubscribeAsync(Action&lt;IAsyncResult&gt; action)</div><div>&nbsp;&nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;_serverTracePublisher.BeginSubscribe(Id, this, args =&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_serverTracePublisher.EndSubscribe(args); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (action != null)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;action(args);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}, null);</div><div>&nbsp;&nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp;public void UnsubscribeAsync(Action&lt;IAsyncResult&gt; action)</div><div>&nbsp;&nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;_serverTracePublisher.BeginUnsubscribe(Id, args =&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_serverTracePublisher.EndUnsubscribe(args);</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (action != null)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;action(args);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}, null);</div><div>&nbsp;&nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp;public void PingAsync(Action&lt;bool&gt; action)</div><div>&nbsp;&nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;_serverTracePublisher.BeginPing(</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;args =&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var result = _serverTracePublisher.EndPing(args);</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (action != null)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;action(result);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;},</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;null);</div><div>&nbsp;&nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp;&#091;OperationContract(IsOneWay = true)&#093;</div><div>&nbsp;&nbsp; &nbsp;public void OnPublish(TraceMessage pTraceMessage)</div><div>&nbsp;&nbsp; &nbsp;{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;System.Diagnostics.Debug.WriteLine(pTraceMessage.Message);</div><div>&nbsp;&nbsp; &nbsp;}</div><div>}</div><div><br></div><div>Then on the client:</div><div><br></div><div>var traceSubscriber = new CustomTraceSubscriber().Connect(); &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div><br></div><div>// PingAsync Works fine</div><div>traceSubscriber.PingAsync(</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>result =&gt; Execute.OnUIThread(() =&gt; MessageBox.Show(result.ToString())));</div><div><br></div><div><br></div><div>// SubscribeAsync Throws following exception:</div><div>-------------------------------------------</div><div>The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:pKey. The InnerException message was 'XML 'Element' 'http://tempuri.org/:pKey' does not contain expected attribute 'http://schemas.microsoft.com/2003/10/Serialization/:Type'. The deserializer has no knowledge of which type to deserialize. Check that the type being serialized has the same contract as the type being deserialized.'. &nbsp;Please see InnerException for more details.</div><div>-------------------------------------------</div><div><br></div><div>traceSubscriber.SubscribeAsync(args=&gt;</div><div>{</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>var result = args;</div><div>&nbsp;&nbsp;Execute.OnUIThread(() =&gt; MessageBox.Show(result.IsCompleted.ToString()));</div><div>});</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div><br></div><div>I think the reason the call to Subscribe fails is becasue on the server the Subscribe operation is decorated with a NetDataContractFormat attribute which applies NetDataContractSerializerOperationBehavior which applies as NetDataContractSerializer.</div><div><br></div><div>NetDataContractSerializer is not supported in Silverlight (obviously DataContractSerializer is supported). Is there a reason why NetDataContractSerializer is used?</div><div><br></div><div>From what I read the use of it is discouraged (http://www.pluralsight-training.net/community/blogs/aaron/archive/2006/04/21/22284.aspx) if possible, which is why you have to create your own custom attribute to even apply it.</div><div><br></div><div>Would it be possible in the future to modify your contracts to make them Silverlight compatible? Thanks for any feedback you can provide.</div>]]>
   </description>
   <pubDate>Wed, 22 Dec 2010 13:04:22 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2387&amp;PID=9450#9450</guid>
  </item> 
 </channel>
</rss>