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

Top 5 Contributors of the Month
Post New Web Links

Debugging WCF service from silverlight app

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :SharePoint

I have WCF service and its hosted in IIS. ( NOT VS WebServer). My client app is silverlight. How do i step into the service when i'm testing it from silverlight app?

it just goes to System.IAsyncResult _result = base.BeginInvoke("GetCustomer", _args, callback, asyncState); and returns from there. How do i step into the service? I have pdb files inside bin folder of web app.



View Complete Post

More Related Resource Links

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

Error calling WCF service that is returning list.".Debugging resource strings are unavailable ......

Ok.this is just making me frustrated... Here is step by step of what I am trying to do (& not able to) 1. I am calling WCF service hosted in a SharePoint 2010 site from a silverlight app in same domain (So no cross doman I guess). 2. I use Linq to Sharepoint for querying the DB. 3. I am having a list "machines" in Sharepoint 2010 that is having a lookup column from Other list called "part" 4. My WCF method GetAllMachines() works perfectly well when it skips the lookup column "partname" & returns List of type machineitem. 5. But problem occurs when I add machineitemobject.parts.partsname in my Linq to Sharepoint query . My service gives the error not found Async_ExceptionOccurred] Arguments: Debugging resource strings are unavailable." 6. Note that return type of my Method is List<machinesitem> 7. The point to note here is that I use SPMETAL tool to generate the LINQ class that maps the lists . So When I try to query the lookup column it tries to add List item of the type class & that is what causing the error. Is it because I am not using datacontract in my service (but it returns the strings & all private members of machines list e.g. name,title etc) Is it making the attribute Serialisable will solve the error ??? I am kind of lost in it ...Plss help!!   Thanks

consuming a web service in silverlight

Hi all,      I am new to silverlight. I have to develop an application where I have to consume a web service http://www.xignite.com/xRealTime.asmx?WSDL to display the real time stock price on a data grid in the silverlight application. Can anyone please tell me if it is possible and if the answer is yes how do I go about it.If the answer is no please tell me what is the best way to display these values using a silverlight application.     

Silverlight enabled web service security error

I tried to create a SL enabled Web Service by following the example from the Microsoft link: http://msdn.microsoft.com/en-us/library/cc197940(VS.95).aspx When I got to step 6 to test the web service that I created (View in Browser), I got the following error:  Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service. My IIS is located on my local machine with Windows Integrated Authentication and Anonymous access unchecked. After checking the Anonoymous access checkbo, I still got the above error. I have read other post on the Internet that Silverlight uses BasicHttpbinding but the settings in the web.config file was created by Visual Studio 2010 (running .NET 4.0), so I didn't think I need to mess with it. The following is the section from the web.config: <system.serviceModel>   <behaviors>    <serviceBehaviors>     <behavior name="">      <serviceMetadata httpGetEnabled="true" />      <serviceDebug includeExceptionDetailInFaults="false" />     </behavior>    </serviceBehaviors>   </behaviors>   <bindings>    <customBinding>     <binding name=

Re; Debugging windows service

I was trying to debug into this windows service which runs as a worker process in the background and picks up a function and tries to perform a task every few seconds, I installed the service locally on my system and attached the service to the debug process, I set all the breakpoints in the service code so I assumed that the debugging stops at these breakpoints but they never seem to pick up, do you think I am missing something?  Any help is grealty apreciated.Thanks

Debugging a Windows Service (VS 2008 / .NET 3.5) Using Debugger.Launch()

Hi, Everybody! I wrote a Windows Service using VS 2008 (.NET 3.5).  I wish to debug it.  I am able to build it and install it successfully.  When I start the service, the Visual Studio Just-In-Time Debugger (VS JIT Debugger) appears displaying the following message: An unhandled exception ("Launch for user") occurred in <WindowsService> [3392] (or [2560] or [5180] or ...).  I select the following Possible Debuggers <WindowsService> - Microsoft Visual Studio: Visual Studio 2008 and click the Yes button.  This is followed immediately by the following dialog box: Caption: Microsoft Visual Studio, Message: There is no source code available for the current location.  Clicking the Show Disassembly button results in displaying the disassembly.  The call stack shows mscorlib.dll!System.Diagnostics.Debugger.Launch() + 0x6a bytes.  The exception apparently occurs in Debugger.Launch();.  If I choose to continue, I am able to debug the Windows Service, stopping at the specified break points.  Why does the VS JIT Debugger appear in the first place?  How can I use Debugger.Launch(); without the VS JIT Debugger appearing?  See code below... protected override void OnStart(string[] args) { try { Debugger.Launch(); var t = new Thread(Start); t.IsBackground = true

silverlight + WCF Service + Dynamic proxy(custom binding) + basic authentication on iis

hi all, I am having an issue with how to get windows identity in silverlight project. Below is my scenario: the silverlight application need to get data from server via WCF service, i used the way that built dynamic proxy at runtime and aslo used custombinding in this case. Now my application need to deploy on iis and chosen "basic authentication" as a authentication mode. Thus i have chosen authentication mode in WCF was " <security authenticationMode="UserNameOverTransport">". At the client side where kind of project is silverlight that i need have to dynamic proxy with custombinding. My question is: In basic authentication how can i get windows identity to set to chanelfactory.Credentials: _channelFactory = new ChannelFactory<TWebService>(this._binding, new EndpointAddress(_endpointAddress));            _channelFactory.Credentials.UserName = new UserNamePasswordClientCredential();            _channelFactory.Credentials.UserName.UserName = "username";            _channelFactory.Credentials.UserName.Password = "password"; actually, i do not want to use Windows a

WF Service and Silverlight Cross domain exception

Hi I have created a workflow service (xamlx) and hosted it on IIS. The web.config file of the service is: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <services> <service name="VacationRequestService"> <endpoint contract="IVacationEntry" binding="wsHttpBinding"/> </service> </services> <behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests

Problem with Silverlight & WCF service



I've got a silverlight app which calls a WCF service deployed in SharePoint. The entire site is secured by https, so the WCF service is too. When I deploy the Silverlight app, it works ok from the front-end server itself. But when opened from a different machine outside the network, it throws an error: "The remote server returned an error: NotFound". I checked the WSDL, what I noticed is that the port address in the bottom section of the file lists the internal network address. So I tried explicitely hardcoding the correct (internet) address in the constructor of the WCF service object, but that doesn't seem to do anything.

I tried fiddler, but because the site is secured, that's not giving me any clues either. Where can I look next or what could be wrong!?

MCTS in Web Application Development in .NET 2.0

Best method for authentication with an external WCF service called from a Silverlight 4 Web Part ins

If we have a Silverlight 4 application which gets its data from an external WCF service and is deployed as a Web Part on in SharePoint 2010 what is the best method to perform authentication in the WCF service itself.  The service is not on the same domain as the SharePoint server but any user authenticated by the SharePoint server (and only those users) should be able to access the service.  Since the Silverlight application is calling the service the WCF service itself must be configured to use BasicHttpBinding which, of course, severely limits possible authentication methods.

Cannot read Silverlight client ip-address in service


I'm using the following code to read the ip address and port from a client that connects to my service:

            //Read IP-address and port
            MessageProperties messageProperties = OperationContext.Current.IncomingMessageProperties;
            RemoteEndpointMessageProperty endpointProperty = messageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
            string ip = endpointProperty.Address;
            string port = endpointProperty.Port.ToString();

If I connect with a wpf client using netTcp binding I can read the proper ip adress and port number but if I connect with a SL4-client with the PollingDuplex the ip adress is empty and the port is 0. Why is that?

Thanks for help!

EDIT: I noticed that it works as supposed for Silverlight 3 so this seems to be SL4 specific.

WCF Service returning DataTable for silverlight client



I am creating a WCF 3.0 service which will fetch data from the database and return mostly in DataTable and DataSet format. I am building a Silverlight client for consuming this service. But what I found is Silverlight 3.0 does not support datatable or dataset. Unfortunately most of my datas are returned in the datatable format. Is there any way to consume datatable in silver light or converting datatable to generic list or LINQ before returning them? If it is possible to convert datatable to generic collection, does it possible without iteration? This is because converting hundreds of records by iterating will affect my performance.

Thanks in Advance!!!!

Best regards,
Subalakshmi Vijayarajan.

Subalakshmi Vijayarajan.

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.


Can I use WinForms, ASP.NET and Silverlight with the same WCF service?



I'm exploring WCF, trying to find my feet and decide if it's the right architecture for our project. We are looking at having a WCF service that provides a central point of access for various clients, including WinForms, ASP.NET and Silverlight 4. We are using self-tracking entities (STEs).

I have tested out a solution in which I can have a WCF service and use it from WinForms and ASP.NET without any problems. I used the STE T4 template, and put the STEs in their own class library, which I referenced from the client project. This all worked fine.

I ran into trouble trying to build a Silverlight 4 client to access the same WCF service. It seems that SL can't reference a non-SL project, so I can't use the same STE project as I used in the other client. I added a SL class library, hoping I could use that in the non-SL clients, but this didn't work.

So, it looks like I am going to have to have two separate WCF services, one that sends out plain old STEs, and one that uses a SL version if I want to get this to work. Frankly this is unacceptable, and one of the main points of having a single point of access was consistency. If we have to maintain two separate services, we lose a lot of that.

I have searched in vain for an answer to this, which surprises me as I would have expected many people to want to do such a thing.


Debugging WCF service with x86 dependencies on a x64 bit machine

  I've got a WCF service that makes use of SQL compact edition -- which is only availible in 32 bit. The result is when I'm building and running on my x64 bit machine I have to tell the build system to build as x86 rather than "Any CPU". In the IDE, however, it seems like I loose a lot of functionality when I do this.

  For example, I have tests for all my WCF services using the IDE's built in testing framework. On my x86 machine it was great - I'd hit debug, the IDE would automatically start the WCF service in a local service host, and then if I'd set a breakpoint it would automatically stop. How sweet is that?

  But because of this x86 requirement, the IDE starts the WCF host process that is 64 bit, and that fails to load the x86 project... so it would seem that I've lost the ability to debug and step into my service automatically. This is too bad - this is a real productivity loss.

  Have others figure out a way around this? Thanks in advance for any advice!


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

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