Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I'm developing a big app since 2 years in WPF .NET 4 with MVVMLight framework, SOAP WebServices, ENtityFramework...
My current task is to develop the same app in full-web. So after many searches, i finally decided to use Silverlight 5 and Prism to develop in parallel both app. My solution is composed by a desktop MVVMLight project, a silverlight project, one model project for desktop and on model project for sl. ViewModel and Model are shared (with links). Silverlight model files link to Desktop model files and build for SL5. Same behavior for the ViewModel. Only Views are coded separetely because it's to difficult to share. Everything goes well for now on, bindings and datacontext are ok. The fifth project is the SOAP WebService, started by Silverlight or Desktop project.

The problem is with SeviceReference. I was forced to use two different ServiceReferences because i didn't succeed to share it. Is there a way ?
Silverlight web services calls can only be asynchronous and the original biq wpf app uses synchronous calls sometimes (form validation etc...). Asynchronous calls (various refresh) are made synchronously but in BackgroundWorkers so it's still async for the app, nopb. (Do you still follow me ?).

Shared web services calls are made in the ViewModel the same way (shared code) and are separate in a common class with :

C#
public TResult WebServiceClientCaller(some args)
{
    #if SILVERLIGHT
         result = SilverlightWebServiceClient.MyMethod(some args);
    #else
         result = DesktopWebServiceClient.MyMethod(some args);

    return result;
}



The problem is i can't receive datas from "result = SilverlightWebServiceClient." as simple as
"result = DesktopWebServiceClient.".

I'm in for 3 ou 4 days, i stopped counting :). I tried several examples :

XmlHttpRequest
Daniel Vaughan

and a lot more... i can't post more than 2 links...

I tried to work on VS2010 with CTP and VS2012 with async/await keywords but it wasn't satisfying.

Could anyone help me please ? If i have to be more specific, let me now.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900