Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • IBM Web Experience Factory wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category Web Experience Factory 8 Documentation WebSphere Portlet Factory 7 Documentation WebSphere Portlet Factory 7.0.1 Documentation Custom Search Scope...
Search
Community Articles > Web Experience Factory > Best Practices for Web Experience Factory > Modifying the Results of a REST Service Call
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

IBM contributorThomas Dinger
Contribution Summary:
  • Articles authored: 6
  • Articles edited: 1
  • Comments Posted: 0

Recent articles by this author

A Sample Application using the CMIS Document Access Builder

This article and the accompanying sample explain how to use the new CMIS Document Access builder in IBM® Web Experience Factory Version 8.0 (hereafter called WEF or Experience Factory.) This sample includes three WEF models – standard provider and consumer models, along with a model containing ...

Modifying the Results of a REST Service Call

Samples that illustrate three different ways of modifying the results of a REST Service Call.

Restructuring the Results of a REST Service Call

This sample shows how to use a restructure handler to change the structure of XML data retrieved from a backend server.

Revising the Results of a REST Service Call

This sample shows how to add postprocessing support to revise the values of XML data retrieved from a backend server.

Transforming the Results of a REST Service Call

This sample shows how to use Transform builders to restructure and revise the values of XML data retrieved from a backend server.

Community articleModifying the Results of a REST Service Call

Added by IBM contributor Thomas Dinger | Edited by IBM contributor Thomas Dinger on July 19, 2011 | Version 23
  • Edit
  • More Actions Show Menu▼
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars
expanded Abstract
collapsed Abstract
Samples that illustrate three different ways of modifying the results of a REST Service Call.
Tags: best practices, builders, Code samples, sample, wpf, wef
ShowTable of Contents
HideTable of Contents
  • 1 Application Pattern
  • 2 Builders Used
  • 3 Best Practices
  • 4 Samples
  • 5 Resources
REST Service Call results, after they have been modified
Modified results from a REST Service Call builder

Application Pattern


Modify the data retrieved using a REST Service Call builder. The XML data retrieved from a back-end server may not be in the format needed by your WEF application. Sometimes the structure of the data needs to be changed; sometimes the values of the data need to be changed. Web Experience Factory provides tools for doing both.

Builders Used


BuilderDescription
REST Service Call, with a Restructure HandlerRetrieve data from a REST service and restructure it for use by a WEF application.
Transform MapMap the XML schema of the REST service to the XML schema used by a WEF application.
Transform ModifyModify the XML values returned by the REST service.
MethodProvide simple Java code for post-processing REST service result values.
Linked Java ObjectProvide complex Java code for post-processing REST service result values.

Best Practices


There are several different builders that can be used to modify the data returned by a REST Service Call builder. The appropriate builder to use depends on the modifications being made.

If the structure of the XML data is being changed, use a Transform Map builder or a "restructure handler". The Transform Map builder provides a visual approach to restructuring the schema, and can be chained together with other transform builders. Using a restructure handler requires the development of a Java class, but can be used in complex situations that may not be suited for transform builders. Both of these approaches will generate the appropriate results schema for use by other WEF builders.

If only the values of the XML data are being changed, use a Transform Modify builder and/or a Method builder. The Transform Modify builder provides a visual approach to modifying result values, and can be chained together with other transform builders. A Method builder can be used separately or in conjunction with a Transform Modify builder to supply Java code for modifying the result values. If the required logic is complex or extensive, a Linked Java Object can also be used to supply the Java code.

Method builders and Linked Java Objects should not typically be used to make post-processing changes to the structure of the results, because Web Experience Factory will not generate a new schema for the modified structure. If it is absolutely necessary to use Java code for post-processing changes to the structure of the results, then the new results structure should be explicitly defined using a Schema builder. The new schema should then be explicitly specified as the Results Schema in the Service Operation builder. The referenced samples do not illustrate this type of functionality.

Samples

 
Transforming the Results of a REST Service Callexternal link. Use multiple transform builders to modify the structure of the data and the values returned by a REST Service Call builder.
Restructuring the Results of a REST Service Callexternal link. Use a restructure handler (Java implementation of the RestructureFeedData interface) to modify the structure of the data returned by a REST Service Call builder.
Revising the Results of a REST Service Callexternal link. Use a Method builder to modify the values returned by a REST Service Call builder.

Resources


Learning Web Experience Factoryexternal link

  • Edit
  • More Actions Show Menu▼


expanded Attachments (1)
collapsed Attachments (1)
Edit the article to add or modify attachments.
File TypeSizeFile NameCreated On
image/gif 8 KB ModifyRestServiceData.gif 6/28/11 1:53 PM
expanded Versions (23)
collapsed Versions (23)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (23)Jul 19, 2011 4:14:44 PMThomas Dinger  IBM contributor
22Jul 18, 2011 9:13:19 PMThomas Dinger  IBM contributor
21Jul 18, 2011 9:11:26 PMThomas Dinger  IBM contributor
19Jul 18, 2011 2:55:25 PMThomas Dinger  IBM contributor
18Jul 18, 2011 2:28:16 PMThomas Dinger  IBM contributor
17Jul 14, 2011 1:55:55 PMThomas Dinger  IBM contributor
16Jul 13, 2011 8:55:02 PMThomas Dinger  IBM contributor
15Jul 13, 2011 8:51:12 PMThomas Dinger  IBM contributor
14Jul 13, 2011 8:11:09 PMThomas Dinger  IBM contributor
13Jul 13, 2011 7:41:10 PMThomas Dinger  IBM contributor
12Jul 13, 2011 7:26:08 PMThomas Dinger  IBM contributor
11Jul 13, 2011 12:49:05 PMThomas Dinger  IBM contributor
10Jul 12, 2011 5:28:16 PMThomas Dinger  IBM contributor
9Jul 12, 2011 4:26:00 PMThomas Dinger  IBM contributorMinor Change
8Jul 12, 2011 4:24:34 PMThomas Dinger  IBM contributor
7Jul 12, 2011 4:14:33 PMThomas Dinger  IBM contributor
6Jul 12, 2011 1:58:40 PMThomas Dinger  IBM contributor
5Jul 12, 2011 2:42:08 AMThomas Dinger  IBM contributorMinor Change
4Jul 12, 2011 2:37:01 AMThomas Dinger  IBM contributor
3Jul 12, 2011 2:31:27 AMThomas Dinger  IBM contributor
2Jul 1, 2011 3:54:23 PMThomas Dinger  IBM contributor
1Jun 29, 2011 3:19:34 AMThomas Dinger  IBM contributorInitial version
1Jun 29, 2011 4:51:04 PMThomas Dinger  IBM contributorInitial version
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • BlogsIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkIBM Collaboration Solutions
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use