Welcome!

Silverlight Authors: Automic Blog, Michael Kopp, AppDynamics Blog, Kaazing Blog, Steven Mandel

Related Topics: Silverlight, Java IoT, Microsoft Cloud, Machine Learning

Silverlight: Blog Feed Post

Silverlight 4 + RIA: Exposing WCF (SOAP\WSDL) Services

This is very useful if you want to enable the exact same business logic\data access logic for clients other than Silverlight

Continuing in our series, I wanted to touch on how a RIA Services can be exposed as a Soap\WSDL service. This is very useful if you want to enable the exact same business logic\data access logic for clients other than Silverlight. For example to a WinForms application or WPF or even a console application.  SOAP is a particularly good model for interop with the Java\JEE world as well.

First you need to add a reference to Microsoft.ServiceModel.DomainSerivves.Hosting.EndPoints assembly from the RIA Services toolkit.

image

Then you need to edit the endpoints section of the domainserivces config in web.config  file.  Below I am showing the SOAP and OData endpoints enabled.

<system.serviceModel>
<domainServices>
<endpoints>
<add name="OData"
type="System.ServiceModel.DomainServices.Hosting.ODataEndpointFactory, System.ServiceModel.DomainServices.Hosting.OData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="Soap"
type="Microsoft.ServiceModel.DomainServices.Hosting.SoapXmlEndpointFactory, Microsoft.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</endpoints>
</domainServices>

Now, all you have to do is navigate in the browser to this URL:

http://localhost:21516/BusinessApplication1-web-DishViewDomainService.svc

Note the pattern is [namespace]-[typename].svc

image

And we get the very familiar WCF service debug page.

And if you really want to drill in, here is the full WSDL describing the service.

image

You are done on the server, now let’s look at how you consume that on the client.    For the sake of simplicity, I have created a new Console application.  Right click on the project and select Add Services Reference.

image



image

1: var context = new DishViewDomainServiceSoapClient();
2: var results = context.GetRestaurants();
3: foreach (var r in results.RootResults)
4: {
5:    Console.WriteLine(r.Name);
6: }
7:

The code for query is very simple.  Line 1 creates the client proxy, line 2 does a synchronous call to the server. Then we simply loop through the results.

image

Updating the data is a little bit more interesting…    I need to create a ChanageSet that I populate with any updates. in this case I am updating just one value.  I also need to send the original value back to the server.

1: var changeSet = new ChangeSetEntry();
2: var org = new Restaurant();
3: org.ID = entity.ID;
4: org.Name = entity.Name;
5: entity.Name = "Updated:" + entity.Name;
6: changeSet.Entity = entity;
7: changeSet.OriginalEntity = org;
8: changeSet.Operation = DomainOperation.Update;
9: var updateResults = context.SubmitChanges(new ChangeSetEntry[] { changeSet });
10:

And you can see the result of running this a couple of times:

image

For more information, see Deepesh’s post on Configuring your DomainService for a Windows Phone 7 application

For V1.0, this post describes the RIA Services story for WPF applications.  While it works, it is clearly not the complete, end-to-end solution RIA Services offers for Silverlight.   For example, you may want the full experience:  the DataContext, entities with validation, LINQ queries, change tracking, etc.  This level of support for WPF is on the roadmap, but will not make V1.  But if you like the RIA Services approach, you might consider DevForce from IdeaBlade or CSLA.NET which works for both WPF and Silverlight. The great folks at IdeaBlade have offered me 10 free licenses to give out.  If you are interested in one, please let me know.

Read the original blog entry...

More Stories By Brad Abrams

Brad Abrams is currently the Group Program Manager for the UI Framework and Services team at Microsoft which is responsible for delivering the developer platform that spans both client and web based applications, as well as the common services that are available to all applications. Specific technologies owned by this team include ASP.NET, Atlas and Windows Forms. He was a founding member of both the Common Language Runtime, and .NET Framework teams.

Brad has been designing parts of the .NET Framework since 1998 when he started his framework design career building the BCL (Base Class Library) that ships as a core part of the .NET Framework. He was also the lead editor on the Common Language Specification (CLS), the .NET Framework Design Guidelines, the libraries in the ECMA\ISO CLI Standard, and has been deeply involved with the WinFX and Windows Vista efforts from their beginning.

He co-authored Programming in the .NET Environment, and was editor on .NET Framework Standard Library Annotated Reference Vol 1 and Vol 2 and the Framework Design Guidelines.

IoT & Smart Cities Stories
Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, discussed how they built...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
Business professionals no longer wonder if they'll migrate to the cloud; it's now a matter of when. The cloud environment has proved to be a major force in transitioning to an agile business model that enables quick decisions and fast implementation that solidify customer relationships. And when the cloud is combined with the power of cognitive computing, it drives innovation and transformation that achieves astounding competitive advantage.
Machine learning has taken residence at our cities' cores and now we can finally have "smart cities." Cities are a collection of buildings made to provide the structure and safety necessary for people to function, create and survive. Buildings are a pool of ever-changing performance data from large automated systems such as heating and cooling to the people that live and work within them. Through machine learning, buildings can optimize performance, reduce costs, and improve occupant comfort by ...
René Bostic is the Technical VP of the IBM Cloud Unit in North America. Enjoying her career with IBM during the modern millennial technological era, she is an expert in cloud computing, DevOps and emerging cloud technologies such as Blockchain. Her strengths and core competencies include a proven record of accomplishments in consensus building at all levels to assess, plan, and implement enterprise and cloud computing solutions. René is a member of the Society of Women Engineers (SWE) and a m...
JETRO showcased Japan Digital Transformation Pavilion at SYS-CON's 21st International Cloud Expo® at the Santa Clara Convention Center in Santa Clara, CA. The Japan External Trade Organization (JETRO) is a non-profit organization that provides business support services to companies expanding to Japan. With the support of JETRO's dedicated staff, clients can incorporate their business; receive visa, immigration, and HR support; find dedicated office space; identify local government subsidies; get...
With 10 simultaneous tracks, keynotes, general sessions and targeted breakout classes, @CloudEXPO and DXWorldEXPO are two of the most important technology events of the year. Since its launch over eight years ago, @CloudEXPO and DXWorldEXPO have presented a rock star faculty as well as showcased hundreds of sponsors and exhibitors! In this blog post, we provide 7 tips on how, as part of our world-class faculty, you can deliver one of the most popular sessions at our events. But before reading...
Digital Transformation: Preparing Cloud & IoT Security for the Age of Artificial Intelligence. As automation and artificial intelligence (AI) power solution development and delivery, many businesses need to build backend cloud capabilities. Well-poised organizations, marketing smart devices with AI and BlockChain capabilities prepare to refine compliance and regulatory capabilities in 2018. Volumes of health, financial, technical and privacy data, along with tightening compliance requirements by...
"Avere Systems deals with data performance optimization in the cloud or on-premise. Even to this day many organizations struggle with what we call the problem of data gravity - 'Where should I put the data?' - because the data dictates ultimately where the jobs are going to run," explained Scott Jeschonek, Director Cloud Solutions at Avere Systems, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.