.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Transferring objects between a Web Service and Silverlight Phone Application

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ADO.Net

I am fairly new to the Silverlight and Web Services, unfortunately I have come across an issue that seems seems to make each one more complicated for me. What I am trying to do is use a Web Service to connect a Silverlight Phone Application with an SQL Server 2008 database. Connecting and getting data from the database is easy, but my issue lies with transferring it back to the Phone Application using the web service.

Currently there are 2 projects - one is the actual Phone Application, and the other is a web application with the ASMX.

In the Phone Application project is a Customer class (basic attributes - id, name, phone number etc), which I want to fill with data from SQL Server using the Web Service. Visual Studio is not letting me directly use the Customer class from the Silverlight Project in the Web Service, same if I were to create the class in the Web Application and use it in the Silverlight Application.

What I planned on doing was iterating through the data set in the web service and create an XmlDocument, which has been created successfully. The InnerText of this document is:

"<?xml version=\"1.0\" encoding=\"utf-8\"?>




<Name>SMITH, John</Name>




View Complete Post

More Related Resource Links

Return ReadOnlyCollection from WCF service and use it in Silverlight 3 client application

Hi all!

I have a solution containing of 3 parts: wcf service, wpf app and silverlight 3 app.
Both wpf app and silverlight app use wcf service to get a collection of objects.

The point is that my business requirements insistently tell me to return ReadOnlyCollection<T> from wcf service.
When I try to do it I have Serialization exception in silverlight client app. But it's ok in wpf app.

Then, I haven't started the investigation for such strange thing (different behavior in wpf and silverlight) and decided to implement custom serialization, returning the ICollection interface and trying to get ReadOnlyCollection on deserializing.  But wcf service proxy class in silverlight app returned Array of T, not ReadOnlyCollection<T> as proxy in wpf did.

So, the question is: Is it possible to return ReadOnlyCollection<T> from WCF service?

Any help is appreciate.


Silverlight application using RIA Service v1.0 give error in Sharepoint 2010


Hi All,

I am using RIA Service v1.0 in Silverlight 4.0 to retrieve database from sql-server and display on Silverlight application. For this I create RIA class library using Template available in VS2010.  In silverlight application I just fetch the employee from the Employee table and displaying in Silverlight Datagrid. Silverlight application is working fine with ASP.Net web. But when we going deploy same silverlight xap file to Sharepoint  Foundation Server 2010 using Module,deployed sucessfully,webpart display properly except following script error occurred in browser and data is not fetched.

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; InfoPath.3; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
Timestamp: Mon, 24 May 2010 13:46:40 UTC

Message: Unhandled Error in Silverlight Application Load operation failed for query 'GetEmployees'. The remote server returned an error: NotFound.   at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
   at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error)
   at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)

Web Service different between Asp.net Application and SilverLight Application


Hi All,
I try to use this webService ws.eoddata.com/data.asmx in web application i can access all information using following code:

        var wsEOD = new com.eoddata.ws.Data();
            var response = wsEOD.Login("khem", "Nepal"); [Example]

            if (response != null)
                if (!string.IsNullOrEmpty(response.Token))
                    hddtoken.Value = response.Token;
                    // Load Exchange Dropdown

all basic windows controls,wpf controls,silverlight application

here you will find all the information from basic.

Convert WCF service to self hosting application


 I created project as a  WCF Service application and now according to recuriment that needs to be converted as a self hosting application

How can i do this?

Converting WCF service app to Self hosting app?

problem in consuming WCF service through Window application


I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0

now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error


The document at the url was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from '' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: ''.

Content Type application/soap+xml; charset

Data Points: Service-Driven Apps With Silverlight 2 And WCF


Here John Papa demonstrates how to build a Silverlight 2 user interface that communicates through WCF to interact with business entities and a database.

John Papa

MSDN Magazine September 2008

Service Station: The Application Connection Designer


In some of my past columns on service orientation and contract-first development, I've mentioned the new suite of designers, formerly codenamed "Whitehorse," that are part of Visual Studio® Team edition for Software Architects Team System.

Aaron Skonnard

MSDN Magazine August 2005

Silverlight in Enterprise Application

The article Silverlight in Enterprise Application was added by kanagucdm on Sunday, June 06, 2010.

Silverlight: Silverlight is a RIA (Rich Internet Application) technology by Microsoft is a well competitor to Flash (who is a market leader for long time and having 80% market share). Flash is used by all the web sites which needs more rich user interface

Video: Consuming SharePoint 2010 Objects and Data in Silverlight Applications

This video provides an overview of how to build Silverlight applications that access SharePoint data. (Length: 3:50)

WPAsign application service unable to succesfuly pass the BVT tool

Hello, I'm getting a bunch these messages every two hours in my Windows 2003 application log. The server in question does not have outbound internet access where by the server is configured as a web server for the WPAsign application. Message: Failed auto update retrieval of third-party root list sequence number from: <http://www.download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootseq.txt> with error: The specified server cannot perform the requested operation. and when I run the BVT tool form the comand window I am getting unknown error and the output has some partial files but not the whole list expected at succesful sign. What does this mean? How can I manually update this? Any help or insight would be appreciated.

WCF Workflow Service Application - Required Extensions

Hello, I built a WCF Workflow Service App and I built a custom activity that requires an extension in the workflow. In a web app, I'm trying to create a service reference to the WCF workflow service but it says that an extension that is required has not been provided; so how do I consume a service with a required extension? At what point do I supply that extension in an ASP.NET scenario? Thanks. http://linkedin.com/in/brianmains

Displaying PDF in Silverlight Application

Hi I am going to show the pdf file in my silver light application, now i am trying to display the pdf in a iframe inside div container, and then displaying that grid with the use of the javascript. is there any solution to show the pdf file with in the silver light application   Thanks in advance. Gagandeep Singh

how can we show error in our application when exception occur in webs service

how can we show error in our application when exception occur in webs service
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend