SilverlightShow: Consuming ASMX Web Services with Silverlight Comments
http://www.silverlightshow.net/
Silverlight articles, Silverlight tutorials, Silverlight videos, Silverlight samplesSilverlightShow.nethttp://www.rssboard.org/rss-specificationArgotic Syndication Framework 2008.0.2.0, http://www.codeplex.com/Argoticen-USestoychev@completit.com (Emil Stoychev)RE: Consuming ASMX Web Services with Silverlight<p>It works....</p>
<p>Good Work...</p>
<p></p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment6087
Raghu Marwahhttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxSun, 08 May 2011 21:37:33 GMTRE: Consuming ASMX Web Services with Silverlight<p>Where Should I put that ClientAccessPolicy and crossdomain files.</p>
<p>I got an error massage related to crossdomain policy file.</p>
<p>Please help me ASAP.As I am Stuck on this from last few hours</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment5527
Sharepoint Coderhttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxThu, 17 Feb 2011 12:17:18 GMTRE: Consuming ASMX Web Services with Silverlight<em><span style="font-size: 11pt; line-height: 115%; font-family: calibri, sans-serif;">The article has been updated to the latest version of Silverlight and Visual Studio.</span></em>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment5295
lnikolovhttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxTue, 11 Jan 2011 12:05:01 GMTRE: Consuming ASMX Web Services with Silverlight 2Is this thread still active?
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment4147
LoveNuquihttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxWed, 04 Aug 2010 05:20:52 GMTRE: Consuming ASMX Web Services with Silverlight 2I would like to know whether is there any property called IsCompleted property for the web service method.I want to show progress bar till the web method execution is completed?
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment3385
Sambahttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxWed, 14 Apr 2010 13:36:58 GMTRE: Consuming ASMX Web Services with Silverlight 2Hi,
<div><br />
</div>
<div>I just have this question :</div>
<div><br />
</div>
<div>Is it possible to obtain the SOAP result in the XML format ?</div>
<div><br />
</div>
<div><br />
</div>
<div>Thx for your future answer.</div>
<div><br />
</div>
<div>Narglix</div>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment3302
Narglixhttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxWed, 24 Mar 2010 15:50:46 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Hi, I have a aplication runing with VS 2008, and silverligth and i want to use a web service, but when i put the direction like ip address the aplication try to use the name of the server, did you know how i can force to use the ip and not the name of the server?</p>
<p>Thanks</p>
<p> </p>
<p> </p>
<p> </p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment2577
Angelhttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxTue, 27 Oct 2009 18:38:50 GMTRE: Consuming ASMX Web Services with Silverlight 2<span style="color: rgb(83, 83, 83); font-family: arial; font-size: 14px; line-height: 20px; ">clientaccesspolicy.xml is needed only if ur web service is gonna be accessed by some other domains right.....or do we need it everytime??</span>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment2346
vinodhttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxFri, 11 Sep 2009 12:31:39 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Martin, thank you for this quick start. This thread is very informative, especially K's contribution.</p>
<p>Peter</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment2191
Peterhttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxSun, 02 Aug 2009 13:37:59 GMTRE: Consuming ASMX Web Services with Silverlight 2Thank you for this interesting article. I have what is probably more of a Visual Studio question than a Silverlight question, so I hope it is appropriate here. In the screen grab after you added the service reference, we see all the leaf nodes of the DateTimeWebService in the Solution Explorer tree. I only see the parent node in my view.
<p> How is it possible to enable viewing of the leaf nodes in Visual Studio? I explored for this feature but could not find it. Thanks in advance!</p>
<p>Art</p>
<p> </p>
<br />
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment1543
Arthttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxTue, 05 May 2009 11:28:27 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Good example, thanks. I only needed a hint to put 2 and 2 together.</p>
<p><span id="ctl00_cphMiddle_ContentPlaceHolderContent_itemComments_dlstComments_ctl32_lblCommentAuthor">Lazaro</span> and <span id="ctl00_cphMiddle_ContentPlaceHolderContent_itemComments_dlstComments_ctl44_lblCommentAuthor">GaryB</span> </p>
<p>I also had a same problem and solved it by telling VS to use Local IIS Web Server instead of built in Cassini. It looks to me ports needs to be defined in the policy files. My files are as follows:</p>
<p>clientaccesspolicy.xml<br />
<?xml version="1.0" encoding="utf-8" ?><br />
<access-policy><br />
<cross-domain-access><br />
<policy><br />
<allow-from http-request-headers="SOAPAction"><br />
<domain uri="<a shape="rect" href="http://*/" shape="rect">http://*/</a>><br />
<domain uri="https://*" /><br />
</allow-from><br />
<grant-to><br />
<resource include-subpaths="true" path="/"/><br />
</grant-to><br />
</policy><br />
</cross-domain-access><br />
</access-policy><br />
crossdomain.xml<br />
<?xml version="1.0"?><br />
<!DOCTYPE cross-domain-policy SYSTEM "<a shape="rect" href="http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd" shape="rect">http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd</a>"><br />
<cross-domain-policy><br />
<allow-http-request-headers-from domain="*" headers="*"/><br />
</cross-domain-policy></p>
<p>PS. I am using Win7 with IIS7.5 (default with Win7).</p>
<p>Hope it helps.</p>
<p>K</p>
<p> </p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment1460
Khttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxSun, 12 Apr 2009 18:25:23 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Every article I see (starting with WCF and now this Silverlight/ASMX) uses localhost for the service domain. That is just not complete or real-world. Could someone post a sample of working code that uses two domains, one for the service and one for the client? Isn't that how services are supposed to work?</p>
<p>Nevertheless I am getting the same message Lazaro pasted above even on localhost. After figuring the client web config and the clientaccesspolicy I am stuck with that message.</p>
<p>Is this thread still active??</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment1116
GaryBhttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxMon, 02 Mar 2009 12:26:01 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Your step by step is incomplete and makes a lot of assumptions. Please do a better job next time. From my experience and other comments here, you have left out a lot of details .-(</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment925
Nealhttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxSun, 18 Jan 2009 14:18:13 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Hi i'm really confused on silverlight 2 and the webservice endpoint address.</p>
<p>When you add a reference in a silverlight project in visual studio to a webservice it uses the localhost address</p>
<p>eg. <font color="#a31515" size="2"><font color="#a31515" size="2"><a href="http://localhost/Application.Web/Webservice.svc">http://localhost/Application.Web/Webservice.svc</a></font></font>
<p>Now because the silverlight app is running on the client this means the client will try to access the service on their machine (not the server address). If i change this to a dns address then the service asks for the username and password. I cant seem to get around this. Can anyone help please? Thanks Steve</p>
</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment874
stevehttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxWed, 31 Dec 2008 06:30:41 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Great article - thanks. I would like to call asmx web services which require basic authentication (username/password) - however I am not sure how to set the credentials when calling the web services from the WCF client in Silverlight. Can you povide and guidance?</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment823
Frazerhttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxMon, 15 Dec 2008 05:47:26 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>I have downloaded the code, build it and run it without problems. Make sure that you set one of the test pages in the WebSite project as start page. If you use the automatically generated TestPage in the <em>Bin/Debug</em> directory it would throw this exception, the automatically generated pages just don't work with services and not only with them and the reason is that they are opened not as<strong> http://,</strong> but as <strong>file:///</strong>. Also I tried to run it without starting the ASP.NET Development Server (Port 54602) - the service is hosted there, and it raised the exception that you have encountered. So look if both development servers (port 54602 for the service and port 55461 for the web site) are running and if not, maybe this is the key to your problem. ;)</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment722
Enraihttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxWed, 19 Nov 2008 10:18:08 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Hello...great article...but I have some problems with security....</p>
<p><em>An error occurred while trying to make a request to URI 'http://localhost:54602/DateTimeWebService.asmx'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. Please see the inner exception for more details.</em></p>
<p>I download your code and open it in Visual Studio and build....nothing more....do you iluminate me...</p>
<p> </p>
<p>Thanks</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment712
Lazarohttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxTue, 18 Nov 2008 14:39:26 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Hi Dee!</p>
<p> You are exactly correct w.r.t. that error. What i mentioned was related to WSE Web Service consumption by Silverlight Application.</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment545
Angelinahttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxTue, 14 Oct 2008 21:38:45 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Found the reason - Silverlight does not support Dataset class - Does not allow one to add System.Data as a reference. Once I commented out the web methods that used the Dataset class, the compile worked.</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment542
Deehttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxTue, 14 Oct 2008 12:45:17 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>I am getting the same problem mentioned by Angelina.<br />
Added Service Reference to an existing Web Service and tried to compile. Thats all - nothing else. And I get this error:<br />
"The type or namespace name 'schema' could not be found (are you missing a using directive or an assembly reference?) ".<br />
Should any special settings be applied ?<br />
It seems like Angelina solved the problem "by taking the proxy of the WS in the Silverlight host." in the post above. What does that mean ??</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment541
Deehttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxTue, 14 Oct 2008 11:06:33 GMTRE: Consuming ASMX Web Services with Silverlight 2<p><img align="left" style="margin-right: 10px;" src="http://www.silverlightshow.net/storage/userfiles/ServiceReferencesClientConfig.jpg" alt="" />Looking at the error message I think that the problem might be in the ServiceReferences.ClientConfig file. Check if it's not missing in the project where you reference your services.</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment514
Enraihttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxTue, 07 Oct 2008 07:01:50 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Hi, first really thanks for your great work. I'm trying to modify your code and i have a big exception and i dont have idea. Can you help me?</p>
<p> </p>
<p>this is the exception:</p>
<p> [Xml_CannotFindFileInXapPackage]</p>
<p>Argumentos:ServiceReferences.ClientConfig</p>
<p>Las cadenas de recursos de depuración no están disponibles. La clave y los argumentos suelen proporcionar suficiente información para diagnosticar el problema. Vea http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30523.8&File=System.Xml.dll&Key=Xml_CannotFindFileInXapPackage.</p>
<p> </p>
<p>I create a new silverlight class library and try to implement MVP pattern. calling the presenter method in the onclick button event and cut the code of the call to the web service and paste it in the presenter method.</p>
<p>This error throw the exception when the system call de constructor of the web service proxy class.</p>
<p> </p>
<p>Sorry for my poor english. i'm trying to speak english to write it. and thanks for your work again. From venezuela. </p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment507
Fiannolohttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxMon, 06 Oct 2008 09:02:54 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Thank you for your reply. Now i am able to get in connect with WSE enabled WS through WCF by taking the proxy of the WS in the Silverlight host.</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment506
Angelinahttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxMon, 06 Oct 2008 04:58:23 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>I don't think that this article can be connected with the security in SIlverlight, so it's not very proper to post it as a comment here, but expect an article soon that will be focused on that. ;)</p>
<p>And about your question about the WSE 3.0 web services and Silverlight, which I have missed, I'll try to figure out how it's done when I have some time and will gladly share it with you ;)</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment418
Enraihttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxFri, 19 Sep 2008 08:26:51 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>I want to know more about the security in silverlight Application as i have come across something called silverlight spy which can get all the details from the xap file of any silverlight application. Do share your thoughts on this.</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment416
Angelinahttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxFri, 19 Sep 2008 05:10:29 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Is it possible to consume WSE 3.0 enabled webservice from Silverlight Application? If so, how?</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment330
Angelinahttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxWed, 27 Aug 2008 03:11:12 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Hi Emil!</p>
<p><font size="2">I am consuming simple web service of ASP.Net which has System.Web.Services.P</font><font size="2">rotocols namespace. Whereas silvelright supports System.ServiceModel and hence tell me whether i can do this kind o</font><font size="2">f consumption. Source code that gives me that error is as follows:</font></p>
<p><font size="2"><font color="#0000ff" size="2">public</font><font size="2"> </font><font color="#0000ff" size="2">partial</font><font size="2"> </font><font color="#0000ff" size="2">class</font><font size="2"> </font><font color="#2b91af" size="2">FetchResponseFetchResult</font><font size="2"> : </font><font color="#0000ff" size="2">object</font><font size="2">, System.ComponentModel.</font><font color="#2b91af" size="2">INotifyPropertyChanged</font><font size="2"> {</font><font color="#0000ff" size="2">private</font><font size="2"> schema schemaField;</font><font color="#0000ff" size="2">private</font><font size="2"> System.Xml.Linq.</font><font color="#2b91af" size="2">XElement</font><font size="2"> anyField;</font><font color="#808080" size="2">///</font><font color="#008000" size="2"> </font><font color="#808080" size="2"><remarks/></font><font color="#2b91af" size="2">XmlElementAttribute</font><font size="2">(Namespace=</font><font color="#a31515" size="2">"http://www.w3.org/2001/XMLSchema"</font><font size="2">, Order=0)]</font><font color="#0000ff" size="2">public</font><font size="2"> schema schema</font><font color="#0000ff" size="2">get</font><font size="2"> {</font><font color="#0000ff" size="2">return</font><font size="2"> </font><font color="#0000ff" size="2">this</font><font size="2">.schemaField;</font><font color="#0000ff" size="2">set</font><font size="2"> {</font><font color="#0000ff" size="2">this</font><font size="2">.schemaField = </font><font color="#0000ff" size="2">value</font><font size="2">;</font><font color="#0000ff" size="2">this</font><font size="2">.RaisePropertyChanged(</font><font color="#a31515" size="2">"schema"</font><font size="2">);</font> }}</font></p>
<p> </p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment329
Angelinahttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxTue, 26 Aug 2008 23:32:53 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Hi Angelina,</p>
<p>Could you paste the source code the gives you this error so I can help you?</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment327
emilhttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxTue, 26 Aug 2008 22:24:37 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>What should i do for the above error?</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment325
Angelinahttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxTue, 26 Aug 2008 07:32:26 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>I am getting this error:</p>
<p>Error 3 The type or namespace name 'schema' could not be found (are you missing a using directive or an assembly reference?) D:\SilverLight Practice Using VS\TestWCF\TestWS\Service References\ServiceReference2\Reference.cs 41 17 TestWS<br />
</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment324
Angelinahttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxTue, 26 Aug 2008 07:31:37 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>When adding a Service reference the studio also automatically creates a <strong>ServiceReferences.ClientConfig</strong> file, where the end points and the bindings are defined.</p>
<p><img height="169" width="233" align="left" style="margin-right: 10px;" src="http://www.silverlightshow.net/storage/userfiles/ServiceReferencesClientConfig.jpg" alt="" />See if if you have this file in the project where you have added your service reference, if not, delete the reference and add it again it should be created automatically. If the file is available but there are no settings for the particular service in it, try to update the service or delete the reference and the file and than to add the reference again.</p>
<p> </p>
<p> </p>
<p>The code in the client config file should look like that:</p>
<p> </p>
<div>
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">configuration</span><span style="color: rgb(0, 0, 255);">></span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">system.serviceModel</span><span style="color: rgb(0, 0, 255);">></span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">
<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">bindings</span><span style="color: rgb(0, 0, 255);">></span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">basicHttpBinding</span><span style="color: rgb(0, 0, 255);">></span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">
<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">binding</span> <span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="DateTimeWebServiceSoap"</span> <span style="color: rgb(255, 0, 0);">maxBufferSize</span><span style="color: rgb(0, 0, 255);">="65536"</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
<span style="color: rgb(255, 0, 0);">maxReceivedMessageSize</span><span style="color: rgb(0, 0, 255);">="65536"</span><span style="color: rgb(0, 0, 255);">></span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">
<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">security</span> <span style="color: rgb(255, 0, 0);">mode</span><span style="color: rgb(0, 0, 255);">="None"</span> <span style="color: rgb(0, 0, 255);">/></span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
<span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">binding</span><span style="color: rgb(0, 0, 255);">></span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">
<span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">basicHttpBinding</span><span style="color: rgb(0, 0, 255);">></span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
<span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">bindings</span><span style="color: rgb(0, 0, 255);">></span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">
<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">client</span><span style="color: rgb(0, 0, 255);">></span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
<span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">endpoint</span> <span style="color: rgb(255, 0, 0);">address</span><span style="color: rgb(0, 0, 255);">="http://localhost:54602/DateTimeWebService.asmx"</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">
<span style="color: rgb(255, 0, 0);">binding</span><span style="color: rgb(0, 0, 255);">="basicHttpBinding"</span> <span style="color: rgb(255, 0, 0);">bindingConfiguration</span><span style="color: rgb(0, 0, 255);">="DateTimeWebServiceSoap"</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
<span style="color: rgb(255, 0, 0);">contract</span><span style="color: rgb(0, 0, 255);">="DateTimeServiceSample.DateTimeWebService.DateTimeWebServiceSoap"</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">
<span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="DateTimeWebServiceSoap"</span> <span style="color: rgb(0, 0, 255);">/></span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
<span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">client</span><span style="color: rgb(0, 0, 255);">></span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">
<span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">system.serviceModel</span><span style="color: rgb(0, 0, 255);">></span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">configuration</span><span style="color: rgb(0, 0, 255);">></span></pre>
</div>
</div>
<p> </p>
<p>The end point is defined in the client element. I've tried to run the application without the information for the end point and it threw the same exception. So I think that the problem is in this file.</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment311
Enraihttp://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxWed, 20 Aug 2008 08:45:21 GMTRE: Consuming ASMX Web Services with Silverlight 2<p>Hi, Ive tried your code but im getting this error in this line:<br />
<br />
<font color="#0000ff" size="2"><font color="#0000ff" size="2">Dim</font></font><font size="2"> service </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">As</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">New</font></font><font size="2"> ServiceReference1.Service1SoapClient()</font></p>
<p> </p>
<p>Could not find default endpoint element that references contract 'SilverlightApplication2.ServiceReference1.Service1Soap' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.</p>
<p>What else im a missing here?</p>
http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspx#comment308
redzer0http://www.silverlightshow.net/items/Consuming-ASMX-Web-Services-with-Silverlight-2.aspxWed, 20 Aug 2008 05:06:13 GMT