Silverlight Show Forum Working with Web Services Threads http://www.silverlightshow.net/working-with-web-services.aspx Silverlight Show Forum Working with Web Services Threads http://backend.userland.com/rss Silverlight to Web Service not Working? Silverlight to Web Service not Working? Hey everyone. I have a simple Silverlight web app form I created to test a web service I have set up for a bigger project. This form is basically textboxes that take First Name, Last Name, and Middle Name, and on button click, the code gets passed on to the web service on the server, which prints them in a pdf form, saves it to disk, then emails it. I’ve written all the code, I don’t get any errors, but it’s not working. No file gets saved and no email gets sent. Here’s the code from the MainPage.xaml.cs: <pre lang="c#">using System; using System.Collections.Generic; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.ServiceModel; using ExampleSilverlightApp.ServiceReference1; namespace ExampleSilverlightApp { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); } private void button1_Click(object sender, RoutedEventArgs e) { ServiceReference1.newpdfRequestBody proxy = new ServiceReference1.newpdfRequestBody(); proxy._1_FirstName = textBox1.Text; proxy._1_lastName = textBox2.Text; proxy._1_middlename = textBox3.Text; } } } </pre> And here’s the code from my web service: <pre lang="c#">using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Text; using System.IO; using System.Net.Mail; using iTextSharp.text; using iTextSharp.text.pdf; namespace ExampleSilverlightApp.Web { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] public class MyWebService : System.Web.Services.WebService { [WebMethod] public void newpdf(string _1_FirstName, string _1_lastName, string _1_middlename) { string filename = @"C:\Temp\" + _1_FirstName + _1_lastName + ".pdf"; iTextSharp.text.Document d = new iTextSharp.text.Document(PageSize.A4, 72, 72, 172, 72); PdfWriter.GetInstance(d, new FileStream(filename, FileMode.Create)); d.Open(); d.Add(new Paragraph(string.Format("First Name:", _1_FirstName))); d.Add(new Paragraph(string.Format("Last Name:", _1_lastName))); d.Add(new Paragraph(string.Format("Middle Name:", _1_middlename))); d.Close(); try { MailAddress SendFrom = new MailAddress("t@hotmail.com"); MailAddress SendTo = new MailAddress("tg@gmail.com"); MailMessage MyMessage = new MailMessage(SendFrom, SendTo); MyMessage.Subject = "new test"; MyMessage.Body = "heres a new test!"; Attachment attachfile = new Attachment(filename); MyMessage.Attachments.Add(attachfile); SmtpClient emailClient = new SmtpClient("smtp.live.com"); emailClient.Send(MyMessage); } catch (FileNotFoundException) { Console.WriteLine("File Lost!"); } } } } </pre> I can’t tell what is wrong with what I have set up. http://www.silverlightshow.net/Forums/working-with-web-services/silverlight-to-web-service-not-working.aspx tayzirov 10/24/2011 7:28:11 AM How to return the status of Server side when working on sliverlight application <p>Hi,</p> <p>I have the silverlight client application and server side is C++ dll, it's wrapper  by  MC++ and C# WCF.<br /> When client is executing the operation at the client side as loading data or saving data... I want to get the status of step loading as "begin loading....", "loading images..."  ....these status must show in the progress dialog of client until the operations completely, the progress message box is hidden.<br /> For now, my solution is making the Timer at client and call to WCF in mean time for getting this status and update to progress dialog.<br /> Other things, because during Server side is running, sometime the network is disconnected, i want to inform to clients that, server is down too, and when server available, this message will be closed.<br /> Please give me the completely solutions for this and any samples if possible.<br /> Thank you for your help.<br /> Vu Nguyen</p> http://www.silverlightshow.net/Forums/working-with-web-services/how-to-return-the-status-of-server-side-when-working-on-sliverlight-application.aspx dochoangvu 12/11/2012 9:22:14 AM