Print Page | Close Window

TechTip: Web Service Publishing

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=29
Printed Date: 04-Jun-2024 at 1:38pm


Topic: TechTip: Web Service Publishing
Posted By: IdeaBlade
Subject: TechTip: Web Service Publishing
Date Posted: 30-May-2007 at 6:24pm

Level 300
DevForce Enterprise with BOS

Nov 7, 2006

With Release 3.3, DevForce now generates the necessary code to expose your business model via web services. You have always been able to consume web services in a DevForce app; and for some time, you have also been able to base DevForce business classes on them. Now you can publish, too!

To activate this feature, you set a new Web Visible property of the business classes in the Object Mapper to “As web method”. By doing so, you indicate your desire to have the specified classes exposed through web services, so the Object Mapper generates a new file, WebService.cs or WebService.vb, that contains the web methods that will be available to clients.

 
 
 
For each class that you marked with “As web method” visibility, you will see two web methods in the WebService class. One will return business objects in an array; the other (suitable for .NET clients only) will return them in an ADO.NET DataSet. If you set the visibility of a Customer class to “As web method”, for example, the Object Mapper will generate methods GetCustomers() and GetCustomersDataSet() into the WebService class.

Another setting of the Web Visible property, “As span object”, results in no direct web methods, but instead permits objects of the indicated type to be returned from web methods as part of the object graph of other objects. So, for example, if Order objects are marked “As web method” while OrderDetail objects are marked “As span object”, web methods will be defined for the Order objects but not for the OrderDetail objects. However, the OrderDetail objects will be retrievable in a span query as part of the object graph of Orders.

Classes and enums that the web service consumer needs to define and use queries against your web service are included in the generated web service’s WSDL. These include Query, QueryClause, SubQuery, QuerySpan, and others. These members become available to the consuming application through a web reference.

More information about web service publishing with DevForce is currently available from two sources. The Release Notes for the 3.3 release of DevForce include an extended discussion; and a new instructional unit, “Web Service Publishing”, is now part of the product’s Learning Materials. Both items are available through links on the Windows Start menu at Start / All Programs / IdeaBlade DevForce / Documentation.

Happy publishing!




Print Page | Close Window