Select to view content in your preferred language

Need to create a simple Silverligth WCF to insert, update and delete feature data.

1258
6
02-28-2011 05:00 AM
RobertBrodsky
Deactivated User
Hi;

I need your help and have only been working with the ESRI Silverlight API for 2 week.
We need a simple example on how to create a simple Silverlight-enabled WCF Service that inserts updates and can delete data from a feature layer.

Thank you in advance.

Robert
0 Kudos
6 Replies
DanielWalton
Frequent Contributor
The answer will depend on what you have available on the server side. Do you have ArcGis Server 10 and ArcSDE?
0 Kudos
RobertBrodsky
Deactivated User
Hi;

Yes are using both.
0 Kudos
DanielWalton
Frequent Contributor
You can leverage the ESRI classes in that case (no need to build your own WCF service). Follow these steps:


  1. Using ArcCatalog, import or create your feature classes into an SDE database.

  2. Register the feature classes as versioned (right-click->register as versioned)

  3. In ArcMap, drag and drop the feature classes to an MXD, and setup any symbology you want there.

  4. Save the MXD and publish to ArcGIS server with Feature Access and Editing options checked.

  5. Add a feature layer to your silverlight map with the url property set to your new feature service (http://[servername]/ArcGIS/rest/services/[foldername]/[servicename]/FeatureService/[0,1,2,3, etc])

  6. Add an editor widget to your silverlight app (from the ESRI Silverlight Toolkit)

  7. You're done.

0 Kudos
DaveRabrun
Deactivated User
This is a very good example to get you started:

Geometry to WCF


Once you've made WCF insert, delete and update operations, you have a few options:

You can make featureserver calls from the WPF version of the ESRI Silverlight API, which is the safest & easiest bet.

You can send HTTPRequests directly to the ESRI REST service, but you'll have to parse the response.

You can directly edit the database with C#, offers the most control out of all the options, but you could seriously corrupt your database if you don't know what you're doing.
0 Kudos
dotMorten_esri
Esri Notable Contributor
If you already have ArcGIS Server 10, there's absolutely no reason to use WCF. The FeatureLayer already fully supports editing and saving back to the server.
The WCF approach mentioned in the blogpost is really for scenarios not involving ArcGIS Server.
0 Kudos
RobertBrodsky
Deactivated User
Hi;

The reason I need to create a web service is that we are going to have other application consume the service. All the example I have seen on the forums and sdk show how it is done directly from a Silverlight application.

Regards
0 Kudos