<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Calling a WCF service from your Silverlight application</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/06/12/calling-a-wcf-service-from-your-silverlight-application.aspx</link><description>Yesterday I talked about calling a traditional ASMX web service from your Silverlight app. Today, I&amp;#39;ll be talking about WCF services. As I&amp;#39;ve said yesterday, in the current release, you only have tool support for getting a proxy to an ASMX web</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>SoCal MSDN events for Web Developers - slide deck and links</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/06/12/calling-a-wcf-service-from-your-silverlight-application.aspx#1380635</link><pubDate>Wed, 05 Dec 2007 16:11:51 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1380635</guid><dc:creator>Contagious Curiosity</dc:creator><description>&lt;p&gt;Presentations given in Irvine and Riverside, CA - here's the deck and links for more information about&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1380635" width="1" height="1"&gt;</description></item><item><title>MSDN Blog Postings  &amp;raquo; SoCal MSDN events for Web Developers - slide deck and links</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/06/12/calling-a-wcf-service-from-your-silverlight-application.aspx#1377124</link><pubDate>Tue, 04 Dec 2007 00:33:53 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1377124</guid><dc:creator>MSDN Blog Postings  » SoCal MSDN events for Web Developers - slide deck and links</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;MSDN Blog Postings &amp;nbsp;&amp;amp;raquo; SoCal MSDN events for Web Developers - slide deck and links&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1377124" width="1" height="1"&gt;</description></item><item><title>re: Calling a WCF service from your Silverlight application</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/06/12/calling-a-wcf-service-from-your-silverlight-application.aspx#1348125</link><pubDate>Fri, 23 Nov 2007 01:55:47 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1348125</guid><dc:creator>Reece Sim</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am trying to use a duplex service in Silverlight. Is that possible? If it is may I know how?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1348125" width="1" height="1"&gt;</description></item><item><title>Working with WCF for your Silverlight 1.1 Applications</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/06/12/calling-a-wcf-service-from-your-silverlight-application.aspx#1275564</link><pubDate>Wed, 31 Oct 2007 14:50:48 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1275564</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;While you can easily use XML web services in your Silverlight applications, working with WCF is much&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1275564" width="1" height="1"&gt;</description></item><item><title>Working with WCF for your Silverlight 1.1 Applications</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/06/12/calling-a-wcf-service-from-your-silverlight-application.aspx#1275530</link><pubDate>Wed, 31 Oct 2007 14:08:45 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1275530</guid><dc:creator>Zhiming Xue's WebLog</dc:creator><description>&lt;p&gt;While you can easily use XML web services in your Silverlight applications, working with WCF is much&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1275530" width="1" height="1"&gt;</description></item><item><title>Ghillie Suits &amp;raquo; Calling a WCF service from your Silverlight application - LA.NET [EN]</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/06/12/calling-a-wcf-service-from-your-silverlight-application.aspx#1274664</link><pubDate>Tue, 30 Oct 2007 18:46:24 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1274664</guid><dc:creator>Ghillie Suits » Calling a WCF service from your Silverlight application - LA.NET [EN]</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Ghillie Suits &amp;amp;raquo; Calling a WCF service from your Silverlight application - LA.NET [EN]&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1274664" width="1" height="1"&gt;</description></item><item><title>Silverlight and JSON &amp;laquo; Tales from a Trading Desk</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/06/12/calling-a-wcf-service-from-your-silverlight-application.aspx#1265574</link><pubDate>Fri, 26 Oct 2007 20:02:51 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1265574</guid><dc:creator>Silverlight and JSON « Tales from a Trading Desk</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Silverlight and JSON &amp;amp;laquo; Tales from a Trading Desk&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1265574" width="1" height="1"&gt;</description></item><item><title>re: Calling a WCF service from your Silverlight application</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/06/12/calling-a-wcf-service-from-your-silverlight-application.aspx#1250518</link><pubDate>Thu, 18 Oct 2007 07:33:40 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1250518</guid><dc:creator>sacha barber</dc:creator><description>&lt;p&gt;any chance of working source code. COuld you send it to me at sachabarber@hotmail.com&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1250518" width="1" height="1"&gt;</description></item><item><title>re: Calling a WCF service from your Silverlight application</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/06/12/calling-a-wcf-service-from-your-silverlight-application.aspx#1060947</link><pubDate>Fri, 27 Jul 2007 07:59:28 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1060947</guid><dc:creator>Walter</dc:creator><description>&lt;p&gt;Hi, Can you upload your sample code here?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1060947" width="1" height="1"&gt;</description></item><item><title>re: Calling a WCF service from your Silverlight application</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/06/12/calling-a-wcf-service-from-your-silverlight-application.aspx#1048388</link><pubDate>Mon, 23 Jul 2007 13:08:18 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1048388</guid><dc:creator>Swati</dc:creator><description>&lt;p&gt;Thanks for this useful information:&lt;/p&gt;
&lt;p&gt;Actually i am trying to call a WCF Service from a SilverLight application. Silverlight provides add webreference but i cann't get the object of reference and hence can not call the WCF service..&lt;/p&gt;
&lt;p&gt;Would you please highlight more upon your writeup.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1048388" width="1" height="1"&gt;</description></item><item><title>re: Calling a WCF service from your Silverlight application</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/06/12/calling-a-wcf-service-from-your-silverlight-application.aspx#1003352</link><pubDate>Thu, 05 Jul 2007 20:16:11 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1003352</guid><dc:creator>luisabreu</dc:creator><description>&lt;p&gt;hello.&lt;/p&gt;
&lt;p&gt;send me a running sample to labreu at gmail.com and i'll try to take a look at it&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1003352" width="1" height="1"&gt;</description></item><item><title>re: Calling a WCF service from your Silverlight application</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/06/12/calling-a-wcf-service-from-your-silverlight-application.aspx#1002187</link><pubDate>Thu, 05 Jul 2007 13:53:24 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1002187</guid><dc:creator>W James</dc:creator><description>&lt;p&gt;Thanks for your work. &amp;nbsp;I've tried to duplicate a WCP service call at my end. &amp;nbsp;Unfortunately, I get an &amp;quot;Operation is not valid due to the current state of the object.&amp;quot; error. &amp;nbsp;Forgive me for being a WCF newb. &amp;nbsp;I'm hoping that you can provide an answer to my dilema. &amp;nbsp;Here are some code snippets:&lt;/p&gt;
&lt;p&gt;&amp;lt;Web.config&amp;gt;&lt;/p&gt;
&lt;p&gt;	&amp;lt;system.serviceModel&amp;gt;&lt;/p&gt;
&lt;p&gt;		&amp;lt;services&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;service name=&amp;quot;TestService&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;				&amp;lt;endpoint contract=&amp;quot;ITestService&amp;quot; &lt;/p&gt;
&lt;p&gt;				 &amp;nbsp; &amp;nbsp;binding=&amp;quot;webHttpBinding&amp;quot; address=&amp;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt;				 &amp;nbsp; &amp;nbsp;behaviorConfiguration=&amp;quot;jsonBehavior&amp;quot; bindingConfiguration=&amp;quot;jsonBinding&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;				&amp;lt;endpoint address=&amp;quot;mex&amp;quot; binding=&amp;quot;mexHttpBinding&amp;quot; contract=&amp;quot;IMetadataExchange&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;/service&amp;gt;&lt;/p&gt;
&lt;p&gt;		&amp;lt;/services&amp;gt;&lt;/p&gt;
&lt;p&gt;		&amp;lt;bindings&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;webHttpBinding&amp;gt;&lt;/p&gt;
&lt;p&gt;				&amp;lt;binding name=&amp;quot;jsonBinding&amp;quot; messageEncoding=&amp;quot;Json&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;/webHttpBinding&amp;gt;&lt;/p&gt;
&lt;p&gt;		&amp;lt;/bindings&amp;gt;&lt;/p&gt;
&lt;p&gt;		&amp;lt;behaviors&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;serviceBehaviors&amp;gt;&lt;/p&gt;
&lt;p&gt;				&amp;lt;behavior name=&amp;quot;metadataSuport&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;					&amp;lt;serviceMetadata httpGetEnabled=&amp;quot;true&amp;quot; httpGetUrl=&amp;quot;&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;				&amp;lt;/behavior&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;/serviceBehaviors&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;endpointBehaviors&amp;gt;&lt;/p&gt;
&lt;p&gt;				&amp;lt;behavior name=&amp;quot;jsonBehavior&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;					&amp;lt;enableWebScript /&amp;gt;&lt;/p&gt;
&lt;p&gt;				&amp;lt;/behavior&amp;gt;&lt;/p&gt;
&lt;p&gt;			&amp;lt;/endpointBehaviors&amp;gt;&lt;/p&gt;
&lt;p&gt;		&amp;lt;/behaviors&amp;gt;&lt;/p&gt;
&lt;p&gt;	&amp;lt;/system.serviceModel&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;TestService.svc&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;%@ ServiceHost Language=&amp;quot;C#&amp;quot; Debug=&amp;quot;true&amp;quot; Service=&amp;quot;TestService&amp;quot; CodeBehind=&amp;quot;~/App_Code/TestService.cs&amp;quot; %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;app_code/ITestService.cs&amp;gt;&lt;/p&gt;
&lt;p&gt;[ServiceContract]&lt;/p&gt;
&lt;p&gt;public interface ITestService&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;[OperationContract]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;string GetDataRows(string serviceName);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;[OperationContract]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;string HelloWorld();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;lt;app_code/TestService.cs&amp;gt;&lt;/p&gt;
&lt;p&gt;public class TestService : ITestService&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public string GetDataRows(string serviceName)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return &amp;quot;Dummy result&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public string HelloWorld()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return &amp;quot;Hi world!&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;lt;Default.xaml.cs&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public class Proxy : SoapHttpClientProtocol&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public Proxy(string url)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.Url = url;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public string GetDataRows(string serviceName)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ServiceParameter[] parameters = new ServiceParameter[]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new ServiceParameter(&amp;quot;serviceName&amp;quot;, serviceName)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;object[] obj = this.Invoke(&amp;quot;GetDataRows&amp;quot;, parameters, typeof(string));&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return (string)obj[0];&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;catch (System.Exception error)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return error.Message;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public string HelloWorld()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;object[] obj = this.Invoke(&amp;quot;HelloWorld&amp;quot;, new ServiceParameter[0], typeof(string));&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return (string)obj[0];&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;catch (System.Exception error)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return error.Message;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;Proxy proxy = new Proxy(&amp;quot;&lt;a rel="nofollow" target="_new" href="http://localhost:1999/WebSite/TestService.svc&amp;quot;"&gt;localhost/.../TestService.svc&amp;quot;&lt;/a&gt;);&lt;/p&gt;
&lt;p&gt;proxy.HelloWorld();&lt;/p&gt;
&lt;p&gt;I'm sorry about posting all this code to your forum. &amp;nbsp;I'm stumped and didn't know where else to turn. &amp;nbsp;It's probably not the best way to introduce myself.&lt;/p&gt;
&lt;p&gt;I've followed your code examples as closely as possible. &amp;nbsp;I've tried the proxy url without the &amp;quot;.svc&amp;quot; extension as well and come up with the same issue.&lt;/p&gt;
&lt;p&gt;Any help you can lend is greatly appreciated.&lt;/p&gt;
&lt;p&gt;W James&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1002187" width="1" height="1"&gt;</description></item></channel></rss>