Sap BC Developer Guide
Sap BC Developer Guide
Sap BC Developer Guide
Developer Guide
SAP System
Release 4.8
Copyright
©Copyright 2008 SAP AG.. All rights reserved.
No part of this description of functions may be reproduced or transmitted in any form or for any
purpose without the express permission of SAP AG.. The information contained herein may be
changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software
components of other software vendors.
Microsoft® , WINDOWS® and EXCEL®, NT® and SQL-Server® are registered trademarks
of Microsoft Corporation.
IBM®, OS/2®, DB2/6000®, AIX®, OS/400® and AS/400® are registered trademarks of IBM
Corporation.
UNIX ® and X/Open® are registered trademarks of SCO Santa Cruz Operation.
Contents
Chapter 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Welcome! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Program Code Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Viewing this Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Printing this Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4 1
Contents
6 1
Contents
8 1
Contents
10 1
Contents
Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Files That Are Generated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Building a C/C++ Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Files That Are Generated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Building a Visual Basic Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
Environment Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
Files That Are Generated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
General Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
Files for the User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Files Containing the Code that Invokes the Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
File Containing the Code that Interacts with SAP BC Server . . . . . . . . . . . . . . . . . . . . . . . 326
Building an Excel Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
Files That Are Generated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Building a Browser-Based Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Invoking Services with a URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Using the HTTP GET Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Using the HTTP POST Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Input into the Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Output from the Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
12 1
Contents
14 1
Contents
16 1
Contents
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
18 1
CHAPTER 1
Introduction
Welcome! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Welcome!
This guide shows you how to create services using SAP BC Developer®. It contains
information for developers who want to build services using the webMethods flow
language or a programming language such as Java, C/C++, or Visual Basic. It also contains
information about creating client applications, working with output templates, and
accessing databases through the SAP BC platform.
To use this guide effectively, you should know how to program in Java, C/C++, and/or
Visual Basic if you will be creating services in those languages.
Typographical Conventions
This document uses the following typographical conventions:
Convention Example
Procedures are designated by a blue 1 On the Activity menu, click File.
box in the left column. Procedures
are presented as a series of
numbered steps.
Terms that identify elements, The Service field on the Properties tab specifies
options, selections, and commands the name of the requested service.
on the screen are shown in bold.
Characters that you must type Type: setup
exactly are shown in a typewriter and then press ENTER.
font.
Variable information that you must Type: <sapbc>\setup
type based on your specific and then press ENTER.
situation or environment is shown
in italics.
Keyboard keys are shown in Press ENTER; then press TAB.
uppercase.
Keys that you must press Press CTRL+ALT+M.
simultaneously are joined with the
“+” symbol.
Directory paths are shown with the <sapbc>\server\packages
“\” directory delimiter unless the \Default
subject is UNIX‐specific. In these
cases, the “/” is used. If you are
working in a UNIX environment,
substitute a “/” for the “\” shown in
the procedures in this book.
Convention Example
Information that you must read
before beginning a procedure or Important! If the folder is not already
that alerts you to negative open in the Service Browser, open it
consequences of certain actions is before you start the following
denoted using this notation. procedure.
Notes that provide related, but non‐
critical, information are denoted Note: When you start SAP BC
using this notation. Developer, you are prompted to log on
to a SAP BC Server.
Helpful information such as
shortcuts and alternatives. Tip! You can also use CTRL+C to copy
an object.
Convention Example
Keywords and values that you %CoSymbol%
must type exactly as printed are
shown in typewriter font.
Variable values or parameters that %VarName%
you must supply are shown in
italics.
Keywords or values that are %loop LoopVar [null=NullValue]%
optional are enclosed in [ ]. Do not
type the [ ] symbols in your own
code.
Related Documentation
The following documents are companions to this guide. Some documents are in PDF
format and others are in HTML.
If you do not have this software or you do not have the correct version, you can download
a free copy from:
http://www.adobe.com/supportservice/custsupport/download.html.
What Is Developer? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Starting Developer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Basic Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Caching Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
What Is Developer?
SAP BC Developer is an integrated development environment (IDE) that you use to create
services on a SAP BC Server. It provides all of the tools necessary to build and test
services, generate stubs for client applications, and create output templates.
Have a user account on that SAP BC Server.
Belong to a group that is a member of the “Developers” ACL (access control list) on
that SAP BC Server.
You will not be able to use Developer unless these requirements are satisfied. If you do
not have access to a SAP BC Server or you do not have an appropriate user account or
access rights, contact your server administrator.
Starting Developer
Use the following procedure to start Developer on your workstation.
Important! Make sure that the server with which you want to use Developer is running.
You cannot work with Developer if the server is not running
Important! If you are starting Developer for the first time on a UNIX system, verify that the
B2B_ROOT and JAVA_ROOT settings in integrator.sh specify the paths where
Developer (B2B_ROOT) and Java Runtime Environment (JAVA_ROOT) reside. If these
settings are not correct, update them before starting Developer.
To start Developer
1 Depending on which operating system is running on your workstation, do the
following:
Note: Servers to which you have successfully logged on
in the past are listed in the Server list. You can select a
server from this list or type its name and port number.
Note: The server is installed with a default user account
called “Developer” that has developer privileges.
Password The password for the user account in Username. Use the
exact combination of upper‐ and lower‐case characters
with which it was originally defined. SAP BC
passwords are case‐sensitive.
Note: The default password for the Developer user
account is isdev.
Note: If you want to use a proxy you can configure it via Edit ‐> Preferences ‐> Proxies. I you
get a transport error exception when trying to login, check your proxy settings.
4 Click OK.
Select a component in
the Service Browser...
Select and lock an element that you want to edit.
Copy, move, delete, or rename an element.
Elements in the Service Browser are shown in a hierarchical structure where the server is
the topmost element in the hierarchy. Packages on the server contain one or more folders,
which contain elements that you can create and edit using Developer (e.g., services,
specifications, records).
Click ’Refresh’ to
update the contents
of the Service
Browser.
The Editor
The Editor contains the controls that you use to examine and edit an element you select in
the Service Browser. The contents of the Editor vary depending on the type of element
you select.
If you select
and lock a flow
service in the
Service Browser...
...the service-editing
interface is displayed
in the Editor.
If you select
and lock a
specification...
...the specification-
editing interface is
displayed.
For more information about data types supported in Developer, see Appendix C,
“Supported Data Types” on page 577.
Basic Operations
...and tabs.
Note: You cannot create a new Java, C, or WebTap service unless all services of those types
are unlocked or locked by you in the folder in which you want to create the new service.
For details, see the SAP BC Cooperative Development Guide.
To copy an element, select the element in the Service Browser and right‐click the mouse.
On the right‐click menu, click Copy. Select the folder where you want to copy the element
and right‐click (this can be the same folder). On the right‐click menu, click Paste. A copy of
the element is inserted in the selected folder. If you copied the element to the same folder,
“Copy” is appended to the element name. If you want to rename the element, make sure
that you have the lock or it is unlocked and select it and press ENTER. You can also use
the Rename command on the right‐click menu.
Important! When you copy a Java service from one folder to another, you must re‐specify
the Shared tab information in the copy of the service. (You can copy the information from
the Shared tab for the original service to the Shared tab for the copy of the service.) In
addition, you must recompile the copy of the Java service (using jcode or the Save
command in Developer) before running it on SAP BC Server.
Important! You cannot use the Undo command with renaming or deleting a element.
1 On the Edit menu, click Preferences.
2 On the General tab, under Service Browser, do the following:
Select... To...
Confirm before deleting Instruct Developer to check for any flow services, records,
or specifications that use the element.
If elements are found that depend on the element to be
deleted, then those dependents are listed. You are given
the opportunity to delete the element anyway or cancel
the operation.
Check dependency Instruct Developer to check for flow services, records, and
when renaming / moving specifications that use the element.
If elements are found that use the element to be renamed,
then those dependents are listed. You are given the
opportunity to:
Rename/move the selected element as well as all
references in dependent flow services, records, and
specifications.
Rename/move the selected element only.
Cancel the operation.
3 Click OK.
To rename an element
1 In the Service Browser, select the element that you want to rename. You must have
the element locked or it must be unlocked.
2 Right‐click and select Rename. A cursor appears in the name of the element.
3 Edit the name and click the mouse, or press ENTER.
If you have the renaming safeguards enabled in the Preferences dialog box, Developer
displays a dialog box listing all dependent elements. For example, if you renamed the
PO:logPO flow service, the following dialog box may appear.
4 Do one of the following:
Click... To...
Update Rename the selected element in the Service Browser.
Update All Rename the selected element as well as all references in dependent
elements. WebTap rules and WIDLs will not be renamed.
Cancel Cancel the operation and preserve the original name of the
element.
Important! If you are renaming a schema, Developer will not find any dependents be
renamed, because this functionality does not support schemas.
To delete an element
1 In the Service Browser, select the element that you want to delete. You must have the
element locked or it must be unlocked.
2 Right‐click and select Delete.
If you enabled the deleting safeguards in the Preferences dialog box, Developer
displays a dialog box listing all dependent elements. For example, if you wanted to
delete the PO:logPO flow service, the following dialog box may appear.
3 Do one of the following:
Click... To...
Continue Delete the element from the Service Browser. References in
dependent elements remain.
Cancel Cancel the operation and preserve the element in the Service
Browser.
The list contains up to 20 non duplicate entries. Select an entry and press Go to or double
click on an entry to select the correlated service in the service tree.
Note: There are situations when an entry in the history dialog is not represented by a
service entry in the tree view any more. This may happen when you perform some action
in the Administrator UI like installing a new package version. In this case selecting the
Element in the Dialog will not lead to selecting the service in the tree view. When
reselecting the service in the service tree you will get a new work history entry you can
use afterwards.
Note: The work history is not persistent. It is lost when closing the Developer.
When the checkbox keep window open is checked the history window stays open and you
are able to switch quickly between the services you work on without needing to reopen
the dialog.
Tip! To get a feeling for the behaviour of the work history dialog, open it and check the
keep window open checkbox. Now click on some services in the service tree. You can see the
services to be added to the history.
Reverting Changes
If you made a change in an element, but want to cancel that change before saving it, use
the File / Revert function. You will also find the Revert action in the popup menu of any
service in the service tree.
After starting the Revert action and pressing OK on the following dialog, the service is
reloaded from the server in its former state.
In the Settings tab of an element and also in the icon for the tree item you get the
information if an element is deprecated. This means the element should not be used
anymore, because it may be removed in a future release.
When using a deprecated service in your own flow service, you see a deprecated service
marked with a special icon in the flow view. The deprecation note can be found in the
Properties panel of the Service.
In the Flow Diagram View you find the deprecation icon in the rectangle representing the
flow step and the comment for the deprecated service in the fly‐over text of the rectangle.
In your own packages, you can also set this deprecation information in the Settings tab /
Deprecation on delivery.
Note: You can deprecate any service using this mechanism. Deprecating a record
definition, a schema, a specification or a template is not possible.
Note: The deprecation feature only works if you are connected to a SAP Business
Connector Server 4.8 or higher.
Important! While you have an open session on a server through Developer, you are using a
licensed seat for that server. At times when you are not actively using Developer, you
may want to close your session on the server to free a seat on the server for others to use.
1 Save any work that you want to keep.
2 On the File menu, select Close Session.
–OR–
Click on the Service Browser toolbar.
1 On the File menu, select Open Session.
–OR–
Click on the Service Browser toolbar.
2 Complete the Open Session dialog box. If you need procedures for this step, see “To
start Developer” on page 27.
3 Click OK.
Important! If you close your session (disconnect from the current server) or exit Developer
before the server restarts, all unsaved work will be lost.
On the File menu, select Restore Session.
Important! Do not change your password if you are outside of the corporate firewall and
you did not use SSL to open the session on the SAP BC Server.
Note: You cannot use Developer to change passwords that are stored in an LDAP or NIS
server.
Password Requirements
For security purposes, SAP BC Server places length and character restrictions on
passwords. SAP BC Server contains a default set of password requirements, however,
your server administrator can change these. Contact your server administrator for
information about password requirements for SAP BC Server.
The default password requirements provided by SAP are as follows:
Requirement Default
Minimum Length 8
Minimum Number of Alphabetic Characters 3
Minimum Number or Uppercase Characters 2
Minimum Number of Lowercase Characters 2
Minimum Number of Numeric Characters 1
Minimum number of special characters (non‐alphabetic and non‐numeric 1
characters, such as *. ?, &)
To ensure the security of your password, follow the additional guidelines below:
Do not choose obvious passwords, such as your name, address, phone number,
license plate, spouse’s name, child’s name, or a birthday.
Do not use any word that can be found in the dictionary.
Do not write your password down.
Do not share your password with anyone.
Change your password frequently.
Examples of good passwords include: RuKIDDing?, 4theLUVof$, two4TEA?.
1 On the File menu, select Change Password.
2 In the Change Password dialog box, in the Old Password field, type your current
password.
3 In the New Password field, type your new password.
Important! The Server Administrator can disable the feature for changing your password
from Developer. If the feature is disabled, when you try to change your password, you
will receive a message stating that the administrator has disabled the feature.
Caching Elements
You can improve performance in Developer by caching Service Browser elements that are
frequently used. You can also clear the cache of elements at any time. To do this, you use
the Caching tab on the Preferences dialog box.
To cache elements
1 On the Edit menu, click Preferences.
2 Click the Caching tab.
Note: Keep in mind that increasing the cache reduces memory. If you experience memory
problems, consider reducing the number of elements that are cached.
Flow services with breakpoints (to fix, remove the breakpoint and clear the cache
again)
Flow services that are currently being debugged (for example, if a service has been
stepped into)
Unsaved elements
Keep in mind that the cache is automatically cleared when you close Developer or when
you refresh the session by clicking on the toolbar.
1 On the Edit menu, click Preferences. The Preferences dialog box appears.
2 Click the Caching tab if it is not already in the foreground.
3 Click the Clear Cache button. All cached elements are removed from memory.
Note: Clearing cached elements from Developer is different from clearing the contents of
the pipeline from SAP BC Server. If you want to clear the Server cache, see the Settings tab
in the Editor area. For more information, see “Configuring a Service’s Use of Cache” on
page 88.
What Is a Package? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Package Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
What Is a Package?
A package is a container that is used to bundle services and related elements, such as
specifications, records, SAP BC schemas, and output templates. When you create a folder,
service, specification, record, SAP BC schema, or output template, you save it in a
package.
Packages are designed to hold all of the components of a logical unit in an integration
solution. For example, you might group all the services and files specific to a particular
marketplace in a single package. By grouping these components into a single package,
you can easily manipulate them as a unit. For example, you can copy, reload, distribute,
or delete the set of components—the package—with a single operation.
Although you can group services using any package structure that suits your purpose,
most sites organize their packages by function or application. For example, they might put
all purchasing‐related services in a package called “PurchaseOrderMgt” and all time‐
reporting services into a package called “TimeCards.”
On the server, a package represents a subdirectory within the <sapbc>\server\packages
directory. All the components that belong to a package reside in the package’s
subdirectory.
Note: Every service in SAP BC Developer must belong to a package.
WmWin32. This package contains services you can use to invoke methods on COM
objects. This package also contains Windows‐specific samples, such as sample Visual
Basic services. The WmWin32 package is installed, but is not enabled when you install
SAP BC Server. For information about enabling a package, see the SAP BC
Administration Guide.
Note: The names of predefined packages that contain services, records, specifications, and
other elements begin with the prefix “Wm”.
Package Management
SAP BC Developer provides several tasks that you can perform to manage the packages
on SAP BC Server. When you perform a package management task, it affects all of the files
and services in the package. You can complete basic package management tasks, such as
creating and deleting a package, using Developer. Only the server administrator can
perform certain complex tasks, such as enabling, disabling, archiving, publishing, and
recovering a package.
The following table identifies all of the package management tasks that can be performed
using Developer or the Server Administrator. If you can perform the task with Developer,
the See column directs you to a page with the instructions. If a person using the Server
Administrator can perform the task, the See column directs you to the SAP BC
Administration Guide.
To... See...
Create a package page 57
Activate a package SAP BC Administration Guide
Lock the contents of a package SAP BC Cooperative Development Guide
Reload the services and files in a page 59 and
package into memory without SAP BC Administration Guide
restarting the server
Enable a package that you previously SAP BC Administration Guide
disabled
Disable access to a package, but do not SAP BC Administration Guide
want to delete the package
Delete all services and related files in a page 59 and
package SAP BC Administration Guide
Recover the services and related files SAP BC Administration Guide
from a deleted package.
To... See...
Assign a version number to a package page 61 and
SAP BC Administration Guide
Identify packages that must be loaded page 63
before a specific package is loaded
(package dependencies)
Export a package or partial package page 60
Replicate or copy the contents of a SAP BC Administration Guide
package and send (publish) it to other
SAP BC Servers
Archive a copy of the package (such as SAP BC Administration Guide
for a backup copy)
View the patch history for a package page 62 and
SAP BC Administration Guide
Assign startup, shutdown, or page 67
replication services to a package
Creating a Package
When you want to create a new grouping for services and related files, create a package.
Packages can store services, specifications, records, output templates, and schemas.
Important! To create a package, you must have Developer or Administrator privileges.
When you create a package, Developer creates a new subdirectory for the package in the
file system on the machine where SAP BC Server is installed. For information about the
subdirectory and its contents, see the SAP BC Administration Guide.
Keep the following guidelines in mind when naming new packages:
Start all package names with an uppercase letter and capitalize the first letter of
subsequent words. For example, PurchaseOrder.
Keep package names short. Use abbreviations instead of full names. For example,
instead of ProcessPurchaseOrder, use ProcessPO.
Make sure the package name describes the functionality and purpose of the services it
contains.
Avoid creating package names with random capitalization. For example,
cOOLPkgTest.
Avoid using articles (e.g., “a,” “an,” and “the”) in the package name. For example,
instead of TestTheService, use TestService.
Avoid using the prefix “Wm”. Developer uses the “Wm” prefix for predefined
packages that contain services. records, and other files.
To create a package
1 Click on the Service Browser toolbar.
–OR–
On the File menu, click New.
2 In the New dialog box, select Package, and click Next.
3 In the New Package dialog box, in the Name field, type the name for the new package
using any combination of letters, numbers, and the underscore character. Click Finish.
Developer automatically refreshes the Service Browser and displays the new package.
Note: Avoid using control characters and special characters like periods (.) in the name
of a package. The watt.server.illegalNSChars setting in the server.cnf file (which is
located in the <sapbc>\server\config directory) defines all the characters that you
cannot use when naming packages. Additionally, the operating system on which you
run SAP BC Server might have specific requirements that limit package names.
Documenting a Package
You can communicate the purpose and function of a package and its services to other
developers by documenting the package. To make the package documentation accessible
to other developers, use Web documents (such as HTML pages) for the documentation
and place the documents in the pub subdirectory for the package on SAP BC Server.
For example, place the package documentation for a package named “PurchaseOrders” in
the following directory: <sapbc>\server\packages\PurchaseOrders\pub
Tip! An alternate location for package documentation is the <sapbc>\server\packages\doc
directory. Typically, this directory is used for reference material such as PDFs that do not
need to be published to the Web.
For each package, make sure to create an index.html file for use as a home page for the
package documentation. The index.html file can contain links to the other Web
documents for the package. An index.html file exists for each package installed by the
SAP BC Server.
Use the following process to access the documentation for a package.
Enter the URL for the package documentation. The URLs for package documentation
have the following format:
http://serverName:port/PackageName/DocumentName
where:
serverName:port is the name and port address of the SAP BC Server on which the
package resides.
PackageName is the name of the package for which you want documentation.
DocumentName is the name of the Web document you want to access. If you do
not specify a DocumentName, SAP BC Server automatically
displays the index.html file.
Reloading a Package
Sometimes, you need to reload a package on the server to activate changes that have been
made to it outside of Developer. You need to reload a package if any of the following
occurs:
A Java service that was compiled using jcode is added to the package
New jar files are added to the package
Any of the configuration files for the package are modified
Note: Reloading a package is not the same thing as refreshing the Service Browser. When
you refresh the Service Browser, SAP BC Developer retrieves a fresh copy of the contents
of all the packages from the memory of SAP BC Server. When you reload a package, SAP
BC Server removes the existing package information from memory and loads new
versions of the package and its contents into its memory.
To reload a package
In the Service Browser, right‐click the package you want to reload, and click Reload
Package.
–OR–
In the Service Browser, select the package you want to reload, and click File Reload
Package.
Deleting a Package
When you no longer need the services and files in a package, you can delete the package.
Deleting a package removes the package and all of its contents from the Service Browser.
When you delete a package from Developer, SAP BC Server saves a copy of the package.
If you later want to recover the package and its contents, contact your server
administrator. Only Server Administrator users can recover a package. For more
information about recovering packages, see the SAP BC Administration Guide.
Before you delete a package, make sure of the following:
Other users or other services do not use (depend on) the services, templates, records,
and schemas in the package. You can use the Find Dependents to identify other services
that are dependent on a service in a package that you want to delete. For more
information, see “Finding Dependents” on page 240.
All elements are unlocked in the package that you want to delete. If there are elements
that are locked by others or system locked, you cannot delete the package.
To delete a package
In the Service Browser, right‐click the package you want to delete, and click Delete.
–OR–
In the Service Browser, select the package you want to delete, and click Edit Delete.
To export a package
1 In the Service Browser, select the package you want to export and select File Export.
2 In the Export To dialog box, select the location on your hard drive where you want the
exported package to reside. Click Save.
This exports the package to a ZIP file and saves it on your hard drive. The ZIP file can
then be published on another server.
1 In the Service Browser, select the folder or element that you want to export, and select
File Export.
2 In the Export To dialog box, select the location on your hard drive where you want the
exported partial package to reside. Click Save.
This exports the folder or element to a ZIP file and saves it on your hard drive. The
ZIP file can then be published on another server.
Important! When you change the version number of a package, make sure that you update
the package dependencies for other packages that depend on the earlier version of this
package.
Tip! Assign and change package version numbers through Developer only when the
packages are in a development stage. To avoid difficulties installing package releases, do
not change version numbers on packages you receive from trading partners, packages to
which you subscribe, or packages installed with SAP BC Server.
1 In the Service Browser, select the package to which you want to assign a version
number.
2 Click the Settings tab.
3 In the Package Version field, type the version number you want to assign to the
package. The version number needs to adhere to one of the following patterns: X.X or
X.X.X (e.g., 1.0, 2.1, 2.1.3, or 3.1.2)
4 Click to save your changes.
If the version number you entered does not adhere to one of the formats specified in
step 3, Developer displays a message stating that the format is not correct.
Note: You can also use the Server Administrator to assign version numbers to packages.
For more information, see the SAP BC Administration Guide.
To view the changes that comprise each version of the package.
To inform SAP Customer Care which versions of predefined packages are installed on
your SAP BC Server.
When you select a package in the Service Browser, the Settings tab displays the patch
history since the last full release of the package. (A full release of a package incorporates
all previous patches for the package.)
Note: When the server administrator installs a full release of a package (a release that
includes all previous patches for the package), SAP BC Server removes the existing patch
history. This helps the server administrator avoid potential confusion about version
numbers and re‐establish a baseline for package version numbers.
In the Server Administrator, select the package for which you want to view a patch
history. Click the Settings tab.
The following table describes each field under Patch history:
Tip! You might also want to identify package dependencies if a startup service for a
package invokes a service in another package. The startup service cannot execute if the
package containing the invoked service has not yet loaded.
1 In the Service Browser, select the package for which you want to specify package
dependencies.
2 Click the Settings tab.
3 Under Package Dependencies, click .
4 In the Enter Input Values dialog box, enter the following information:
5 Click OK and then click on the toolbar.
Important! Make sure that you do not create circular package dependencies. For example, if
you identify “FinanceUtil” as a dependent package for the “Finance” package, do not
identify “Finance” as a dependent package for the “FinanceUtil” package. If you create
circular package dependencies, neither package will load the next time you start SAP BC
Server.
1 In the Service Browser, select the package for which you want to remove a package
dependency.
2 Click the Settings tab.
3 Under Package Dependencies, select the package dependency you want to remove.
4 Click .
When someone uses Developer or the Server Administrator to reload a package.
When someone uses Developer or the Server Administrator to enable a package.
Startup services are useful for generating initialization files or assessing and preparing
(e.g., setting up or cleaning up) the environment before the server loads a package.
However, you can use a startup service for any purpose. For example, you might want to
execute a time‐consuming service at startup so that its cached result is immediately
available to client applications.
Tip! If a startup service invokes a service in another package, make sure to identify the
other package as a package dependency for the package containing the startup service.
When someone uses the Server Administrator to disable the package.
When someone uses the Server Administrator to reload a package before it is
removed from memory.
Shutdown services are useful for executing clean‐up tasks such as closing files and
purging temporary data. You could also use them to capture work‐in‐progress or state
information before a package unloads.
Note: The term replication service does not refer to the services contained in pub.replicator or
to services that subscribe to replication events (replication event services).
Because services in a package are not made available to clients until the package’s
startup services finish executing, you should avoid implementing startup services
that access busy remote servers. They will delay the availability of other services in
that package.
You can assign one or more startup services to a package; however, you cannot
specify the order in which the services execute. If you have a series of startup services
that need to execute in a specific order, create a “wrapper” service that invokes all the
startup services in the correct order. Designate the “wrapper” service as the startup
service for the package.
1 In the Service Browser, select the package to which you want to assign startup,
shutdown, or replication services.
2 Click the Startup/Shutdown/Replication Services tab.
3 To add a startup service, under Startup services, select the service from the Available
Services list, and click . Repeat this step for each service you want to add as a
startup service for the package.
1 Under Replication Services click .
2 In the Enter Input Values dialog box, in the service field, do one of the following:
— Type the service name in the format: folderName:serviceName
— Click to navigate to and select the service you want to use as a replication
service.
3 Click OK.
4 Repeat steps 1–3 for each service you want to add as a replication service.
Tip! If you remove a startup service that invoked a service in another package and the
package was identified as a package dependency, make sure you remove the package
dependence after you remove the startup service.
1 In the Service Browser, select the package for which you want to remove startup,
shutdown, or replication services.
2 Click the Startup/Shutdown/Replication Services tab.
3 Do one or more of the following:
— To remove a startup service, under Startup services, select the service you want to
remove from Selected services list, and click .
— To remove a shutdown service, under Shutdown services, select the service you
want to remove from the Selected services list, and click .
— To remove a replication service, under Replication services, select the replication
service you want to remove and click .
Basic Concepts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
A Process Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Basic Concepts
To successfully build a flow service, you should understand the following basic concepts
and terms.
Any service can be invoked within a flow (including other flow services). For instance, a
flow might invoke a service that you create, any of the built‐in services provided by
webMethods, and/or services from a webMethods add‐on product such as the
webMethods SAP R/3 Adapter or the webMethods Baan Adapter.
You create flow services using Developer. They are saved in XML files on SAP BC Server.
Important! Although flow services are written as XML files, they are maintained in a format
that can only be created and understood by Developer. You cannot create or edit a flow
service with a text editor.
Retry a specified sequence until it succeeds.
Repeat a specified sequence (loop) for each element in an array variable.
In the following flow service, flow‐control steps have been inserted to loop through a
subset of the flow service and branch to one of two services in the last step of the loop.
A LOOP step
repeats a set of
flow steps
A flow service can contain the following types of flow steps:
Invocation Steps
Executes a specified service. For more information about this
INVOKE
step, see “Invoking Services” on page 107.
Data-Handling Steps
Performs specified editing operations on the pipeline (e.g.,
MAP
mapping variables in the pipeline, adding variables to the
pipeline, dropping variables from the pipeline, and so forth).
For more information about this step, see “The MAP Step” on
page 132.
Flow-Control Steps
Executes a specified flow step based on the value of a specified
BRANCH
variable in the pipeline. For more information about this step,
see “The BRANCH Step” on page 110.
LOOP Executes a set of flow steps once for each element in a
specified array. For more information about this step, see “The
LOOP Step” on page 126.
Re‐executes a set of flow steps up to a specified number of
REPEAT
times based on the successful or non‐successful completion of
the set. For more information about this step, see “The
REPEAT Step” on page 118.
Groups a set of flow steps into a series. The SEQUENCE step is
SEQUENCE
implicit in most flow services (that is, the steps in a flow
service are treated as a series). However, at times it is
necessary to explicitly group a subset of flow steps using
SEQUENCE so that they can be treated as a unit. For more
information about this flow step, see “The SEQUENCE Step”
on page 125.
Controls the execution of a flow step; for example, abort an
EXIT
entire flow service from within a series of deeply nested steps,
throw an exception without writing a Java service, or exit a
LOOP or REPEAT without throwing an exception. For more
information about this step, see“The EXIT Step” on page 130.
See Appendix A, “SAP BC Flow Steps” for a detailed description of each type of flow step
provided by the webMethods flow language. For information about building each type of
flow step, see “Creating an SAP Inbound Map” on page 77.
The pipeline holds the input and output for a flow service
When you build a flow service, you use Developer to specify how information in the
pipeline is mapped to and from services in the flow.
Input and output parameters define the variables that the service requires as input and generates as output
Input Output
Name Data Type Name Data Type
AcctNum String AuthCode String
OrderTotal String
Part of the process of creating a service is declaring its input and output parameters—i.e.,
explicitly specifying the variables it expects as input and produces as output.
A Process Overview
Building a flow service is a process that involves the following basic stages:
The remaining sections in this chapter and the following chapters provide detailed
information about each stage.
Important! The flow steps produced by these options are no different than those produced
by manually inserting INVOKE loadDocument and INVOKE queryDocument steps in a flow
service. Once the New Wizard inserts the set of default steps into your flow service, you
can edit the default steps and insert additional steps just as you would any ordinary flow
service.
1 In the Service Browser, select the New button to create a new element.
2 Select SAP Inbound Map in the New window and click Next.
3 Select a package for the Inbound Map and click Next.
4 Enter the Inbound Map generation parameters in the window New SAP Inbound Map and
click Finish.
SAP Lookup
functions
If you use one of these Lookup functions you can display the structure of the
corresponding SAP data elements. SAP BC Developer uses the following icons to display
these structures:
IDoc Type
IDoc Segment
Data Type CHAR
Data Type NUMBER
Data Type DATE
Data Type TIME
Data Type RAW
Data Type STRUCTURE
Business Object Repository
Business Object
BAPI (BOR)
Keyfield (BOR)
Import Parameter
Export Parameter
Changing Parameter
Function Module
Table Parameter
Data Type Table
A MAP step.
A BRANCH step.
A LOOP step.
A REPEAT step.
A SEQUENCE step.
An EXIT step.
For more information about inserting flow steps, see “Building Flow Services” on page 69.
Although you are not required to declare input and output parameters for a service (SAP
BC Server will execute a service regardless of whether it has a specification or not), there
are good reasons to do so:
Declaring parameters makes the service’s input and outputs visible to Developer. Without
declared input and output parameters, you cannot:
— Map data to and/or from the service using Developer’s Pipeline Editor.
— Assign default input values to the service with the Pipeline Editor.
— Validate the input and output values of the service at run time.
— Test the service in Developer and enter initial input values.
— Generate skeleton code for invoking the service from a client.
Declaring parameters makes the input and output requirements of your service known to other
developers who may want to call your service from their programs.
For these reasons, we strongly recommend that you make it a practice to declare input
and output parameters for every service that you create.
Note: The purpose of declaring input parameters is to define the inputs that a calling
program or client must provide when it invokes this flow service. You do not need to
declare inputs that are obtained from within the flow itself. For example, if the input
for one service in the flow is derived from the output of another service in the flow,
you do not need to declare that variable as an input parameter.
When possible, use variable names that match the names used by the services in the flow.
Variables with the same name are automatically mapped to one another in the
pipeline. (Remember that variable names are case‐sensitive.) If you use the same
variable names used by flow’s constituent services, you reduce the amount of manual
data mapping that needs to be done. When you specify names that do not match the
ones used by the constituent services, you must use the Pipeline Editor to manually
map them to one another. For information about the Pipeline Editor, see “What Is the
Pipeline Editor?” on page 150.
Make sure the variables match the data types of the variables they represent in the flow. For
example, if a service in the flow takes a Record List called LineItems, define that input
variable as a Record List. For a complete description of the data types supported by a
service, see Appendix C, “Supported Data Types” on page 577.
Declared input variables appear automatically as inputs in the pipeline. When you select the
first service or MAP step in the flow, the declared inputs appear under Pipeline In.
Important! If you edit a cached service by changing the inputs (not the pipeline), you must
click Reset Cache on the Settings tab in Developer, or in Service Usage in the Server
Administrator. If you do not reset the Server cache, the old cached input parameters will
be used at run time.
Input/Output tab
For a flow service, the input side describes the initial contents of the pipeline. In other
words, it specifies the variables that this flow service expects to find in the pipeline at run
time. The output side identifies the variables produced by the flow service and returned
to the pipeline.
You can complete the Input/Output tab in the following ways:
Reference a specification. A specification defines a set of service inputs and outputs. You
can use a specification to define input and output parameters for multiple services.
When you assign a specification to a service, you cannot add, delete, or modify the
declared variables using the service’s Input/Output tab.
Reference a record. You can use a record to define the input or output parameters for a
service. When you assign a record to the Input or Output side of the Input/Output tab, you
cannot add, modify, or delete the variables on that half of the tab.
1 In the Service Browser, select the service for which you want to declare input and
output parameters.
2 In the Editor, click the Input/Output tab.
3 If you want to reference a specification, do the following:
Important! When a specification is assigned to a service, you cannot add, delete, or
modify the declared variables using the service’s Input/Output tab.
4 If you want to reference a record for the input or output parameters of the service, do
the following:
1 In the Input or Output field (depending on which half of the specification you want
to assign the record to), type the record name or click to select it from a list.
2 If you assigned a record to both the Input and Output sides of the Input/Output tab,
skip the rest of this procedure. Otherwise, continue to the next step to specify the
variables in the other half of the tab.
Important! When a record is assigned to the Input or Output side, you cannot add, delete,
or modify the declared variables on that half of the Input/Output tab.
5 For each input or output variable that you want to define, do the following:
1 Select the half of the Input/Output tab (Input or Output) where you want to define the
variable by clicking anywhere in that half’s large white text box.
2 Click on the toolbar and select the type of variable that you want to define.
3 Type the name of the variable and press ENTER.
4 Right‐click the variable and select Properties to set variable properties and apply
validation constraints (optional).
5 If the variable is a Record or a Record List, repeat steps 2–4 to define each of its
members. Use to indent each member beneath the Record or Record List
variable
6 If you want to enter any notes or comments about the input and output parameters,
type your comments in the Comments field.
Important! The run‐time options on the Settings tab should only be set by someone who is
thoroughly familiar with the structure and operation of the selected service. Improper use
of these options can lead to a service failure at run time and/or the return of invalid data to
the client program.
Important! Do not use the stateless option unless you are certain that the service operates as
an atomic unit of work. If you are unsure, leave the Stateless option disabled.
1 In the Service Browser, select the service that you want to configure.
2 Select the Settings tab.
3 Under Runtime, select the Stateless check box if you do not want the server to maintain
session information for this service. Otherwise, leave this option disabled.
Note: Caching is only available for data that can be written to the repository server. Since
nodes cannot be written to the repository, they cannot be cached.
Note: If you do not have administrator privileges on your SAP BC Server, work with your
server administrator to monitor and evaluate your service’s use of cache.
Important! If you edit a cached service by changing the inputs (not the pipeline), you must
click Reset Cache on the Settings tab in Developer, or in Service Usage in the Server
Administrator. If you do not reset the server cache, the old cached input parameters will
be used at run‐time.
Important! Use Prefetch carefully. Overuse can quickly exhaust the memory available for
cache.
Important! Do not use Prefetch with Java or C/C++ services that invoke access‐controlled
services. Such services will fail during prefetch because the embedded service will be
invoked without the proper access privileges. To avoid this problem, enable Prefetch on
the invoked services rather than on the Java or C/C++ services that call them.
1 In the Service Browser, select the service that you want to configure.
2 Select the Settings tab.
3 Under Runtime, select the Caching check box.
4 In the Cache Expire (minutes) field, type an integer representing the length of time (in
minutes) that you want the results for this service to be available in cache.
5 If you want to use prefetch, do the following:
1 Select the Prefetch check box.
2 In the Prefetch Activation (hits) field, specify the minimum number of hits needed to
activate the use of prefetch.
Note: If a service has an output template assigned to it, the server automatically applies the
template to the results of the service (i.e., the contents of the pipeline) whenever that
service is invoked by an HTTP client. If a service does not have an output template, the
server simply returns the results of the service in the body of an HTML document,
formatted as a two‐column table.
When using output templates, keep in mind that:
You do not have to assign an output template to a service.
A service can have at most one output template assigned to it at a time (you can
dynamically change the output template assignment at run time, however).
You can assign the same output template to more than one service.
If you assign an existing output template to a service, the output template must reside
in the <sapbc>\server\packages\packageName\templates directory where
packageName is the package in which the service is located.
You can reference one output template from within another.
1 In the Service Browser, select the service to which you want to assign an output
template.
2 Click the Settings tab.
3 In the Name field, do one of the following:
— If you want to assign a new output template to the service, type the name of the
new output template. By default, Developer assigns the service an output
template with the name FolderName_ServiceName.
— If you want to assign an existing output template to the service, type the file name
of the existing output template. You do not need to include the path information
or the file name extension.
Important! If you want to assign an existing output template to the service, make
sure the output template resides in the
<sapbc>\server\packages\packageName\templates directory where packageName
is the same package in which the service is located.
4 In the Type list, do one of the following to specify the format for the output template:
Select... To...
html Assign an HTML output template to the service.
xml Assign an XML output template to the service.
wml Assign a WML output template to the service.
hdml Assign an HDML output template to the service.
Note: The Type you select determines the extension for the output template file (*.html,
*.xml, *.wml, or *.hdml). In cases where the output is returned to a Web browser, the
Type also determines the value of the HTTP “Content‐Type” header field (e.g.,
“text/html,” “text/xml,” “text/vnd.wap.wml,” or “text/x‐hdml“).
5 Do one of the following:
— If you assigned a new output template to the service, click New to create the
output template.
— If you assigned an existing output template to the service and you want to edit the
template, click Edit.
SAP BC Server
1
Client
Client Purch:SubmitPO
2
INVOKEPurch:LogPO Purch:LogPO
Purch:LogPO
3
: CreditAuth
INVOKEPurch Purch:CreditAuth
Purch:CreditAuth
4
INVOKEPurch:SendPO Purch:SendPO
Purch:SendPO
Stage Description
1 The client (such as another application or a DSP) requests the Purch:SubmitPO
service on the local SAP BC Server. SAP BC Server checks the ACL of the
Purch:SubmitPO service (the externally invoked service). The server executes the
service only if the client is invoking the service on the behalf of a user that is a
member of an allowed group and not a member of a denied group for the ACL
assigned to the service.
2 The Purch:SubmitPO service invokes the Purch:LogPO service. Because the
Purch:LogPO service is invoked by the externally invoked service and is located
on the same server as the externally invoked service, SAP BC Server considers
the Purch:LogPO service to be internally invoked. Consequently, the server does
not check the ACL of the Purch:LogPO service before executing it.
3 The Purch:SubmitPO service invokes the Purch:Auth service. Like the Purch:LogPO
service, SAP BC Server considers the Purch:Auth service to be an internally
invoked service. Consequently, the server does not check the ACL of the
Purch:Auth service before executing it.
4 The Purch:SubmitPO service invokes the Purch:SendPO service. Like the
Purch:LogPO and Purch:Auth services, SAP BC Server considers the Purch:SendPO
service to be an internally invoked service. The server does not check the ACL
of the Purch:SendPO service before executing it.
Note: Any service invoked by the Purch:SubmitPO flow service could also be invoked directly
by the client. For example, if the client directly invokes the Purch:SendPO service, the
server checks the ACL of the Purch:SendPO service. If the client is invoking the service on
the behalf of a user that is a member of an allowed group and not a member of a denied
group, then the server executes the Purch:SendPO service.
When you create root folders (the top‐level folders in a package), Developer automatically
assigns the Internal ACL to the folder. Services protected by the Internal ACL are
accessible only to users belonging to the Administrators or Developers groups. If you are
developing a service that will be externally invoked by users (such as your partners), you
may want to assign an ACL other than Internal to the service or folder that contains the
service.
The following sections explain how to assign ACLs to folders and services. For guidelines
and recommendations about setting up security for services, see the SAP BC
Administration Guide.
1 In the Service Browser, select the folder or subfolder to which you want to assign an
ACL.
2 On the Settings tab, select the ACL you want to assign to the folder or subfolder from
the Access Control List (ACL).
3 Click .
For information about the default ACLs and guidelines for creating and selecting an
ACL, see the SAP BC Administration Guide.
1 In the Service Browser, select the service to which you want to assign an ACL.
2 Click the Settings tab.
3 Under Security, in the Access Control List (ACL), select the ACL you want to assign to the
service.
4 Next to Enforce ACL on Internal Invokes, select one of the following options:
Select... To...
On Instruct SAP BC Server to always check the ACL of the service
against the permissions of the group(s) to which the requesting client
belongs.
If you select this option, the server checks the ACL of the service
every time it is invoked—even when the service is invoked by
another service.
Off Instruct SAP BC Server to ignore the ACL of the service when it is
invoked internally (invoked by another service).
This is the recommended option.
5 Click .
1 In the Service Browser, select the service for which you want to require an ACL check
for internal invocations.
2 Click the Settings tab.
3 Next to Enforce ACL on Internal Invokes, select the On option. This instructs SAP BC
Server to perform a ACL check when the service is invoked by another service.
4 Click .
1 In the Service Browser, select the folder or service from which you want to remove an
ACL.
2 Click the Settings tab.
3 In the Access Control List (ACL), select <None>.
4 Click .
The local name uniquely identifies a service within a particular namespace. Most sites
use the service’s unqualified name as its local name. Under this scheme, for example,
a service named gl.journals.closeGL would have a local name of closeGL. The Integration
Server does not require you to use the service name as a local name; however, you can
specify the local name as any sequence of letters, or digits. For example, all of the
following would be valid local names for a service called orders:postOrder:
postOrder
PO
orders.add.regularPO
For details on universal names, see the SAP BC SOAP Programming Guide.
1 In the Service Browser, select the service whose universal name you want to assign,
edit, or view.
2 Click the Settings tab.
3 If you want to assign or edit the service’s universal name, specify the following under
Universal Name:
Note: By convention, a URI is generally used as the namespace
name (e.g., http://www.gsx.com/gl). This assures that the
universal name is globally unique.
Note: Most sites use the unqualified portion of the service
name as the local name.
4 Click to save the new settings.
T
To delete a universal name
1 In the Service Browser, select the service whose universal name you want to delete.
2 Click the Settings tab.
3 Under Universal Name, remove the current settings from the Namespace name and Local
name fields.
4 Click to save the new settings.
A flow report lets you view all aspects of the flow service at once
Input/Output
parameters
Details of each
operation
1 In the Service Browser, select the service that you want to print.
2 From the File menu, select View as HTML.
3 If you want to print the flow, select your browser’s print command.
Note: When you print a flow service as HTML while viewing the flow in diagram view,
only the flow diagram appears. Service input, service output and flow details do not
appear. Additionally, only the flow steps currently visible in the Flow Editor appear in the
resulting HTML page. To fit all of the steps in a flow service into the Flow Editor (and
therefore, into a single HTML page), click to zoom out of the flow service or click
to maximize the Flow Editor.
A flow step is the basic unit of work that instructs SAP BC Server about what to do with
data at each stage of a flow service. Flow steps can invoke services and direct the course of
execution. Using flow steps you can:
Invoke a service, such as a flow service, Java service, C service, or Web Service
Connector (INVOKE).
Conditionally execute one step from a set of specified alternatives (BRANCH).
Repeat a set of flow steps up to a specified number of times or until a step in the set
fails or succeeds as specified (REPEAT).
Group a set of flow steps and control the way in which the failure of a member of the
set is processed (SEQUENCE).
Repeat a set of flow steps over the elements of a specified array (LOOP).
Exit the entire flow or exit a single flow step (EXIT).
Map, add, edit, and delete pipeline variables or invoke several services that operate
on the same set of pipeline variables (MAP).
Flow Steps for the selected flow service are displayed in the Flow Editor
Note: When creating flow services, you can use the Flow Tree view or the Flow Diagram
view of the Flow Editor. (Flow Tree view is shown in the above graphic. In Flow Diagram
view, a flow service looks like a flow chart.) Flow Tree view is the default view for the
Flow Editor. Consequently, the procedures in this book are written for working in Flow
Tree view. For information about working in Flow Diagram view, see “Using Flow
Diagram View” on page 133.
Note: You might find it helpful to declare the input and output parameters for a flow
service before you insert flow steps. By first declaring the parameters, it is clear what data
the service expects and what variables are available for use in flow steps.
Flow steps are inserted into a service using the following toolbar buttons at the top of the
Flow Editor (you cannot directly type a flow step into the Flow Editor—all editing is
performed through the toolbar):
A MAP step. 132
A BRANCH step. 110
A REPEAT step. 118
A SEQUENCE step. 125
An EXIT step. 130
Note: If you select an existing step in the Flow Editor before inserting a new one,
Developer inserts the new step below the one that is selected. If you do not have a step
selected, it adds the new step to the end of the flow. You can move a step to a new location
using the arrow buttons on the toolbar. See “Changing the Position of a Flow Step” which
follows.
Move the flow step down in the list.
You can also move a flow step by dragging it up or down with your mouse or by using
the Shift commands on the Compose menu.
To promote or demote a flow step within a parent/child hierarchy, select the step in the
Flow Editor, and then use one of the following buttons to move it left or right beneath the
current parent step.
Note: You can also set the properties for a flow step using the Properties dialog box. This
dialog box contains the same fields as the Properties tab. To open the Properties dialog box,
double‐click a flow step.
Although each type of flow step has a set of unique properties, they all have the following
properties:
Property Description
comment Assigns an optional descriptive comment to the selected flow step.
label Assigns a name to the selected flow step. When a label is assigned, that
label appears next to the step in the Flow Editor. The label allows you to
reference that flow step in other flow steps. In addition, you use the label
to control the behavior of certain flow steps. For example, the BRANCH
step uses the label property to determine which alternative it is supposed
to execute.
See “The BRANCH Step” on page 110 and “The EXIT Step” on page 130
for additional information about this use of the label property.
For a complete description of the properties associated with each flow step, see
Appendix A, “SAP BC Flow Steps” .
Invoking Services
You use the INVOKE step to request a service within a flow. You can use the INVOKE
step to:
Invoke any type of service, including other flow services and Web Service Connectors.
Invoke any service for which the caller of the current flow has access rights on the
local SAP BC Server.
Invoke built‐in services and services on other SAP BC Servers.
Invoke flow services recursively (i.e., a flow service can call itself). If you use a flow
service recursively, bear in mind that you must provide a means to end the recursion.
Invoke any service, validating its input and/or output. For details, see “Performing
Input/Output Validation” on page 226.
You must specify the service’s name exactly as it is defined on the server. Service
names are case‐sensitive.
Note: If you are using one of webMethods Adapters (e.g., webMethods BAAN Adapter,
webMethods Siebel Adapter), you will have additional built‐in services provided. See the
documentation provided with those packages for details
1 In the Service Browser, select the flow service in which you want to invoke another
service. In the Flow Editor, select the step immediately above which you want to
insert the INVOKE step.
2 Click on the Flow Editor toolbar. Select the service you want to invoke. If the
service you want to invoke does not appear in the list, select Browse to navigate to and
select the service.
3 Complete the following fields on the Properties tab.
Note: In SAP BC version 3.x, you could set an as‐user property for a transformer. In SAP
BC Server version 4.0, this property was removed. For more information see “The As‐User
Property in SAP BC Developer 3.x” on page 97.
1 Select the invoked service you want to locate.
2 Right‐click the highlighted service, and select Go To. Developer locates and selects the
service in the Service Browser.
Must be a variable that exists in the pipeline when the BRANCH step is executed at
run time.
Must be formatted as record/recordElement, if you are specifying a record element as
the switch variable (e.g., SupplierInfo/AccountNum).
For example, if you want to select a step based on whether a PO number starts with the
string “REL” you use /^REL/ as the value of label.
Unlike other flow steps, whose children execute in sequence at run time, only one child of
a BRANCH step is executed—the target whose label matches the value of the switch
variable. If none of the targets match the switch variable, none of them are performed, and
execution “falls through” to the next step in the flow service. For example, in the
following flow, execution passes directly to the Orders:LogTransaction service if the value of
PaymentType is “COD.”
If PaymentType is
“COD,” execution will
fall through this
BRANCH step.
Keep the following points in mind when assigning labels to the targets of the BRANCH
step:
You must give each target step a label unless you want to match an empty string. For
that case, you leave the label property blank. For more about matching an empty
string, see “Branching on Null and Empty Values” on page 115.
Each label value must be unique within the BRANCH step.
When you use specify a literal value as the label of a child step, the value you specify
must match the run‐time value of the switch variable exactly. The label property is
case‐sensitive.
You may use a regular expression as the value of label instead of a literal value.
You can use the $null option in the label property to match a null value.
You can use the $default value in the label property to designate a default step for all
unmatched cases. For more information about using the $default setting, “Specifying a
Default Step” on page 114.
Branching on an Expression
When you branch on an expression, you assign an expression to each child of a branch
step. At run time, the BRANCH step evaluates the expressions assigned to the child steps.
It executes the first child step with an expression that evaluates to true.
To build a BRANCH step that branches on an expression, create a list of the conditional
steps (target steps) and make them children of the BRANCH step. Then, complete the
following:
In the Properties tab for the BRANCH step, set evaluate-labels to true.
In the label property of each target, specify the expression that when true, will trigger
the target step. The expressions you create can include multiple variables and can
specify a range of values for variables. Use the syntax provided by SAP to create the
expression. For more information about expression syntax, see Appendix E,
“Conditional Expressions” on page 593.
Keep in mind that only one child of a BRANCH step is executed—the target whose label
contains an expression that evaluates to true. If none of the expressions evaluate to true,
none of the child steps are performed, and execution falls through to the next step in the
flow service. You can use the $default value in the label property to designate a default step
for cases where no expressions evaluate to true. For more information about using the
$default setting, see “Specifying a Default Step” on page 114.
Important! You cannot branch on switch value and an expression for the same BRANCH
step. Branch on the switch value if you want to branch on the value of a single variable
and you know the possible run‐time values of the switch variable exactly. If you want to
branch on the values of more than one variable or on a range of values, branch on
expressions
Important! The expressions you create for the children of a BRANCH step need to be
mutually exclusive—only one condition should evaluate to true at run time.
Important! You can only have one default target step for a BRANCH step. Developer
always evaluates the default step last. Consequently, the default step does not need to be
the last child of the BRANCH step.
Note: You may use $null with any type of switch variable. You may only use an empty
value with String variables
Important! If you are branching on expressions (evaluate-labels is set to true), you cannot
branch on null or empty values. Developer ignores children with a blank or $null label.
Create a SEQUENCE
for each multi-step
alternative...
The SEQUENCE step that you use as a target for a BRANCH can contain any valid flow
step, including additional BRANCH steps. For additional information about building a
SEQUENCE, see “The SEQUENCE Step” on page 125.
1 If you are inserting a BRANCH step into an existing flow service, display that service
in the Flow Editor and highlight the step immediately above where you want the
BRANCH step inserted.
2 Click on the Flow Editor toolbar.
3 Complete the following fields on the Properties tab:
Note: If you use this step as a target for another BRANCH or an
EXIT step, you must specify a value in the label field. For more
information about the EXIT step, see “The EXIT Step” on
page 130.
switch The name of the string variable whose value will be used to
determine which child step is executed at run time. Do not
specify a switch variable if you want to branch on expressions.
evaluate-label Whether or not you want to branch on expressions. Select true
to branch on expressions (evaluate labels as expressions).
Select false if you want to branch on the switch value. Default
is false.
4 Insert the conditional steps that belong to the BRANCH (i.e., its children) using the
following steps:
1 Insert a flow step using the buttons on the Flow Editor toolbar.
2 Indent the flow step using on the Flow Editor toolbar. (Make it a child of the
BRANCH step.)
3 In the label field on the Properties tab, specify the switch value that will trigger this
step at run time. You may use any of the following as values:
Specify... To match...
A string That exact string.
A regular Any string fitting the criteria specified by the regular
expression expression.
Example /^REL/
A blank field An empty string.
$null A null string.
$default Any unmatched string (i.e., execute the step if the value does
not match any other label).
4 Set other properties as needed.
Important! If you are branching on expressions, make sure the expressions you assign to the
child steps are mutually exclusive
Important! If you are branching on expressions, do not branch on null or empty values.
Developer will ignore children with a blank or $null label.
Important! Note that children of a REPEAT always execute at least once. The count property
specifies the maximum number of times the children can be re‐executed. At the end of an
iteration, the server checks to see whether the condition (i.e., failure or success) for
repeating is satisfied. If the condition is true and the count is not met, the children are
executed again. This process continues until the repeat condition is false or count is met,
whichever occurs first. (In other words, the maximum number of times that children of a
REPEAT will execute when count is > ‐1, is count+1.)
If the REPEAT step is a child of another flow step, the failure is propagated to its parent.
If you specify multiple children under a REPEAT step, the failure of any one of the
children will cause the entire set of children to be re‐executed.
The REPEAT step immediately exits a set of children at the point of failure (i.e., if the
second child in a set of three fails, the third child is not executed).
When repeat‐on is set to failure, the failure of a child within a REPEAT step does not
cause the REPEAT step itself to fail unless the count limit is also reached.
The timeout property for the REPEAT step specifies the amount of time in which the
entire REPEAT step, including all of its possible iterations, must complete. When you
use REPEAT to retry on failure, you may want to leave the timeout value at 0 (no limit)
or set it to a very high value. You can also set the property to the value of a pipeline
variable by typing the name of the variable between % symbols.
As a developer, you must be thoroughly familiar with the processes you include
within a REPEAT step. Make certain that the child steps you specify can safely be
repeated in the event that a failure occurs. You don’t want to use REPEAT if there is
the possibility that a singular action—such as accepting an order or crediting an
account balance—could be applied twice.
1 If you are inserting a REPEAT step into an existing flow service, display that service
in the Flow Editor and highlight the step immediately above where you want the
REPEAT step inserted.
2 Click on the Flow Editor toolbar.
3 Complete the following fields on the Properties tab:
Important! If you use this step as a target for a BRANCH or
EXIT step, you must specify a value in the label field. For more
information about the BRANCH and EXIT steps, see “The
BRANCH Step” on page 110 or “The EXIT Step” on page 130.
count The maximum number of times you want the children to be re‐
executed. If you want to use the value of a pipeline variable for
this property, type the variable name between % symbols. For
example, %servicecount%.
If you want the children re‐executed until they are all
successful (i.e., no maximum limit), set this value to –1.
backoff The length of time (in seconds) that you want the server to
wait between iterations of the children.
If you want to use the value of a pipeline variable for this
property, type the variable name between % symbols. For
example, %waittime%.
repeat on FAILURE
4 Beneath the REPEAT step, use the following steps to insert each step that you want to
repeat:
1 Insert a flow step using the buttons on the Flow Editor toolbar.
2 Indent that flow step using on the Flow Editor toolbar. (Make it a child of the
REPEAT step.)
3 Set the properties for the child step as needed.
1 If you are inserting a REPEAT step into an existing flow service, display that service
in the Flow Editor and highlight the step immediately above where you want the
REPEAT step inserted.
2 Click on the Flow Editor toolbar.
3 Complete the following fields on the Properties tab:
Important! If you use this step as a target for a BRANCH or
EXIT step, you must specify a value in the label field. For more
information about the BRANCH and EXIT steps, see “The
BRANCH Step” on page 110 or “The EXIT Step” on page 130.
count The maximum number of times you want the children to be re‐
executed. If you want to use the value of a pipeline variable for
this property, type the variable name between % symbols. For
example, %servicecount%.
If you want the children re‐executed until any one of them
fails (i.e., no maximum limit), set this value to –1.
backoff The length of time (in seconds) that you want the server to
wait between iterations of the children.
If you want to use the value of a pipeline variable for this
property, type the variable name between % symbols. For
example, %waittime%.
repeat on SUCCESS
4 Beneath the REPEAT step, use the following steps to insert each step that you want
repeat:
1 Insert a flow step using the buttons on the Flow Editor toolbar.
2 Indent that flow step using on the Flow Editor toolbar. (Make it a child of the
REPEAT step.)
3 Set the properties for the child step as needed.
You may include any valid flow step within the body of a LOOP, including additional
LOOP steps. The following example shows a pair of nested LOOPs. Note how the
indentation of the steps determines the LOOP to which they belong.
String Table
Record List
Object List
LOOP Properties
When you design your flow, bear in mind that because the services within the loop
operate against individual elements in the specified input array, they must be designed to
take elements of the array as input, not the entire array.
For example, if your LOOP executes against a Record List called LineItems that contains
children called Item, Qty, and UnitPrice, you would specify LineItems as the in-array for the
LOOP step, but services within the loop would take the individual elements of LineItems
(e.g., Item, Qty, UnitPrice, and so forth) as input.
1 If you are inserting a LOOP step into an existing flow service, display that service in
the Flow Editor and select the step immediately above where you want the LOOP
step inserted.
2 Click on the Flow Editor toolbar.
3 Complete the following fields on the Properties tab:
Important! If you use this step as a target for a BRANCH or
EXIT step, you must specify a value in the label field. For more
information about the BRANCH and EXIT steps, see “The
BRANCH Step” on page 1100 or “The EXIT Step” on page 130.
4 Build the body of the loop using the following steps:
1 Insert a flow step using the buttons on the Flow Editor toolbar.
2 Indent the flow step using on the Flow Editor toolbar. (Make it a child of the
LOOP step.)
3 Set the properties for the child step as needed.
5 Use the Pipeline Editor to map the elements of the input array to the input variables
required by each child of the LOOP step. For more information about using the
Pipeline Editor, see “Mapping Data in a Flow Service” on page 149.
The parent flow step of the EXIT flow step.
A specified ancestor flow step to the EXIT flow step.
The entire flow service.
When you use the EXIT step, you indicate whether exiting should return a successful
condition or a failure condition. If the exit is considered a failure, an exception is thrown.
You can specify the text of the error message that is displayed by typing it directly or by
assigning it to a variable in the pipeline.
Examples of when to use the EXIT step include to:
Exit an entire flow service from within a series of deeply nested steps.
Throw an exception when you exit a flow or a flow step without having to write a
Java service to call Service.throwError( ).
Exit a LOOP or REPEAT flow step without throwing an exception.
1 If you are inserting an EXIT step into an existing flow service, display that service in
the Flow Editor and select the step immediately above where you want the EXIT step
inserted.
2 Click on the Flow Editor toolbar.
3 Complete the following fields on the Properties tab:
Important! If you use this step as a target for a BRANCH step,
you must specify a value in the label field. For more
information about the BRANCH step, see “The BRANCH
Step” on page 110.
from The flow step that you want to exit from. Specify one of the
following:
Specify To exit from the...
$loop Nearest ancestor LOOP or REPEAT flow step.
$parent Parent flow step, regardless of the type of step.
$flow Entire flow.
label Nearest ancestor flow step that has a label that
matches this value.
Note: If the label you specify does not match the
label of an ancestor flow step, the flow will exit
with an exception.
signal Whether the exit is to be considered a success or a failure.
Specify one of the following:
Specify… To…
SUCCESS Exit the flow service or flow step with a success
condition.
This property is not used when signal is set to SUCCESS.
Initialize the input values for a flow service.
Invoke several services (transformers) in a single step.
Tip! The MAP step is especially useful for hard coding an initial set of input values in a
flow service. To use it in this way, insert the MAP step at the beginning of your flow, and
then use the Set Value modifier to assign values to the appropriate variables in Pipeline Out.
For more information about the MAP step, see “Mapping Data in a Flow Service” on
page 149.
Following is the same flow service in tree view.
Notice that tree view provides a condensed view of the flow service. Developer lists flow
steps sequentially, top to bottom, and executes the steps in that order.
Note: You can use diagram view to view and edit any flow service that you created in an
earlier version of SAP BC Server.
Note: Developer uses tree view as the default view for flow services. With the exception of
the procedures in this chapter, the procedures in this book are written for working in tree
view.
You need to show diagrams of how the flow service works to management. (Flow
services can be exported to HTML and then printed.)
You want to be able to customize the appearance of the flow service without changing
the order in which flow steps are executed. In diagram view, you can place the flow
steps in an arrangement that you want. Developer maintains the lines between the
flow steps and the structure of the flow service.
You want to use Trace to debug a flow step an operation. It might be easier to follow
the path of execution when Developer presents the flow as a diagram.
Flow Step
Developer automatically inserts the start and end symbols when you create a flow service.
When you insert a step into a flow service, Developer automatically draws the lines
connecting the flow step to the rest of the steps in the service.
Note: Developer automatically draws, redraws, and deletes lines when you insert, move,
or delete steps in a flow service. You cannot move or delete lines.
Steps such as BRANCH, LOOP, and REPEAT can contain child steps. By default,
Developer displays these steps collapsed—you cannot see the individual child steps. You
can expand these steps. When you do, Developer uses a solid colored line to indicate the
path of data within the flow step. Developer also uses dashed lines to enclose the children
under the parent step. Developer places a small rectangle after the last child step to
indicate the end of the parent step.
Click to expand
and view the
children of the
step.
Click to collapse
and hide the
children of the
Dashed lines enclose step.
the children of a step.
Note: Notice that lines enclosing the child steps appear in the same color as the parent step
symbol. Developer also uses the same color around the small rectangle that it places after
the last child step.
In diagram view, the rectangle that contains the flow step displays properties for the step,
such as label and comment. Each rectangle also displays an additional property that is
relevant to the flow step type, such as in-array for LOOP and switch for BRANCH.
In-array property
Service property
Comment property
Label property
The following table indicates which property is shown for each flow step.
Click on the Flow Editor toolbar.
–OR–
On the View menu, select Diagram View.
Click on the Flow Editor toolbar.
–OR–
On the View menu, select Tree View.
Note: You might find it easier to build services in diagram view if you have larger view of
the Flow Editor. To maximize the size of the Flow Editor, click anywhere in the Flow
Editor, and click on the toolbar.
A green circle
surrounds the
selected drop zone.
Note: The following procedure provides general information for inserting steps in diagram
view. For specific information about working with BRANCH steps in diagram view, see
“Inserting a Child Step into a BRANCH Step” on page 142.
1 In the Flow Editor, display the service in which you want to insert a step. Make sure
that you are in Flow Diagram view.
2 On the Flow Editor toolbar, click the button representing the step you want to insert.
For example, if you are inserting an INVOKE step, click , and select the service
you want to invoke.
Developer displays all of the drop zones for the flow service. To view the drop zones
in a collapsed flow step, move the mouse pointer over the in the flow step
rectangle.
3 Click the drop zone where you want to insert the flow step.
Developer inserts the step and automatically draws lines to connect the step to the
rest of the steps in the flow service.
4 Click to save your changes to the server.
Insert a flow step into an existing target
The locations of the drop zones within a BRANCH step indicate where you can place flow
steps. (Drop zones only appear when you insert or relocate a step.) The following
illustration displays the drop zones inside a BRANCH step.
The drop zones that appear on the horizontal line above the children (targets) of the
BRANCH step indicate locations for new targets. The drop zones that appear on the lines
to and from the targets of a BRANCH indicate locations where a flow step can be inserted
into an existing target.
Note: In diagram view, Developer evaluates the target steps of a BRANCH from left to
right—Developer evaluates the label of the left‐most target first. (In tree view, Developer
evaluates the target steps from top to bottom.) At run time, Developer executes the first
target with a matching switch value or an expression that evaluates to true. A target with
the $default label will be evaluated last, regardless of its position.
If you insert a container step (a flow step that can contain children) above the existing
step in a target, Developer uses the container step as the target of the BRANCH.
Developer makes the existing target step the last child of the inserted container step.
If you insert any type of flow step below the existing step in a target, Developer
combines the inserted and existing flow steps into a new SEQUENCE step.
For more information about the flow step that SAP BC generates when you insert steps
into an existing target of a BRANCH, see the following sections.
Note: The behavior described in the following sections is unique to diagram view and does
not occur in tree view.
If you insert an
INVOKE, MAP, or
EXIT step here...
Important! Make sure that you assign a label to the new SEQUENCE step. For more
information about assigning labels to the children of BRANCH steps, see “The BRANCH
Step” on page 110.
Important! Make sure that the label assigned to the container step is the label that you want
to use for the target step. For more information about assigning labels to the children of
BRANCH steps, see “The BRANCH Step” on page 110.
Important! Make sure that you assign a label to the new SEQUENCE step. For more
information about assigning labels to the children of BRANCH steps, see “The BRANCH
Step” on page 110.
To relocate a step
1 In the Flow Editor, select the flow step you want to relocate.
2 On the Edit menu, select Relocate. Developer removes the step from the flow service
and displays the drop zones where you can place the step.
To view the drop zones in a collapsed step, move the mouse pointer over the in the
step rectangle.
Note: You can also press ALT+R to remove the selected step from the flow service and
display the drop zones. (This shortcut key does not work if you are running
Developer on a Solaris platform.)
3 Click the drop zone where you want to move the step.
4 Click to save your changes to the server.
You can also change the order in which flow steps run in a flow service by cutting,
copying, and pasting steps. For step‐by‐step procedures for cutting, copying, and pasting
steps in diagram view, see online help.
Note: When you change the layout of steps in a flow service, you are only changing the
appearance of the flow service in diagram view—you are not changing the actual logic of
the flow service.
1 Select the flow step you want to move and drag it to a new location in the Flow Editor.
Developer automatically adjusts the flow lines when you move the flow step.
2 Click to save your changes. Developer displays the new layout the next time you
open the flow service.
Click on the Flow Editor toolbar.
Developer aligns the flow steps at the left edge of the Flow Editor. Steps retain their
expanded or collapsed state when you reset the flow service.
Mapping is the process of performing transformations to resolve data representation
differences between services or document formats. By mapping, you can accomplish the
following types of data transformations:
Name transformations where different variable names represent the same data item. For
example, one service or document format might use Telephone as the name of the
variable for telephone number information and another might use PhoneNumber.
When you perform name transformations, the value and position of a variable in the
record structure remain the same, but the name of the variable changes.
Structural transformations where different data structures represent a data item. For
example, one service or document format might put the telephone number in a string
called Telephone, and the next may expect to find it in an element of a record array
called CustInfo. When you perform structural transformations, the value of the
variable remains the same, but the data type or position of the variable in the record
structure changes.
Value transformations where different formats represent the same value. This occurs
commonly with date and time variables, where, for instance, one variable might use
“01/01/99” and another “January 1, 1999.” In other cases, your services or document
formats might use different notations for standard codes or values, different currency
units, or a different system of weights and measures (metric instead of the U.S.
Customary or British Imperial systems). When you perform value transformations,
the name and position of the variable remain the same, but the data contained in the
variable changes. (For example, you can change the format of a date, concatenate two
strings, or add the values of two variables together.)
When you build flow services or convert between document formats, you may need to
perform one, two, or all of the above types of data transformation. The webMethods flow
language provides two ways for you to accomplish data transformations between services
and document formats—you can map variables to each other (create links) or you can
insert transformers.
SAP BC Developer provides a graphical environment in which you can perform mapping
between variables and formats—the Pipeline Editor.
1 The expected state of the pipeline just before the selected service
executes.
Pipeline In depicts the set of variables that are expected to be in the
pipeline before the service executes (based on the declared input
and output parameters of the preceding services).
Service In depicts the set of variables the selected service expects as
input (as defined by its input parameters).
Using the Pipeline Editor, you can insert “pipeline modifiers” at
this stage to adjust the contents of the pipeline to suit the
requirements of the service. For example, you can map variables,
assign values to variables, drop variables from the pipeline, or add
variables to the pipeline. Modifications that you specify during
this stage are performed immediately before the service executes at
run time.
2 The expected state of the pipeline just after the service executes.
Service Out depicts the set of variables that the selected service
produces as output (as defined by its output parameters).
Pipeline Out depicts the set of variables that are expected to be in the
pipeline after the service executes. It represents the set of variables
that will be available to the next service in the flow. If the selected
service (INVOKE step) is the last step in the flow service, Pipeline
Out displays the output variables for the flow service (as declared
on the Input/Output tab).
Using the Pipeline Editor, you can insert “pipeline modifiers” at
this stage to adjust the contents of the pipeline. For example, you
can map variables, assign values to variables, drop variables from
the pipeline, or add variables to the pipeline. Modifications that
you specify during this stage are performed immediately after the
service executes at run time.
The Pipeline In column represents input to the MAP step. It contains the names all of
the variables in the pipeline at this point in the flow.
The Transformers column displays any services inserted in the MAP step to complete
value transformations. For more information about invoking services in a MAP step,
see “Inserting a Transformer into a MAP Step” on page 179.
The Pipeline Out column represents the output of the MAP step. It contains the names
of variables that will be available in the pipeline when the MAP step completes.
When you first insert a MAP step into your flow, Pipeline In and Pipeline Out are identical.
However, if the MAP step is the only step in the flow service or is the last step in the flow
service, Pipeline Out also displays the variables declared as output in the flow service.
Using the Pipeline Editor, you can insert “pipeline modifiers” to adjust the contents of the
pipeline. For example, you can map variables from Pipeline In to services in Transformers.
You can also use pipeline modifiers to assign values to pipeline variables, drop variables
from the pipeline, or add variables to the pipeline. Use pipeline modifiers to map
variables to each other or to adjust the contents of the variables in the Pipeline Editor.
Pipeline Modifiers
Pipeline modifiers are special commands that you apply to adjust the pipeline at run time.
They execute immediately before or after the selected service or transformer, depending
on where you add them to your pipeline map. Use the following buttons to add pipeline
modifiers to the pipeline:
Note: When you view the pipeline editor as HTML, the resulting HTML page displays
only the portion of the pipeline editor that is visible on the Pipeline tab. Before you select
the View as HTML command, make sure the Pipeline tab displays the part of the pipeline
editor that you want to view as HTML.
1 In the Service Browser, select the flow service for which you want to print the pipeline
editor.
2 In the Flow Editor, select the INVOKE or MAP step for which you want to print the
pipeline editor.
3 Click anywhere on the Pipeline tab.
4 Scroll or resize the Pipeline tab to display the portion of the pipeline editor you want to
view as HTML.
The following table identifies the sections that describe the basic mapping tasks.
Mapping Variables
When you want to copy the value of a variable in a service or document format to another
variable, you map the variables. The Pipeline Editor connects service and pipeline
variables with a line called a link. The process of mapping variables is also called creating
a link.
Within a flow, Developer implicitly maps variables whose names are the same and whose
data types are compatible. For example, the service in the following flow takes a variable
called AcctNumber. Because a variable by this name already exists in Pipeline In, it is
automatically mapped to the AcctNumber variable in Service In. The Pipeline Editor
connects implicitly mapped variables with a gray link.
Pipeline variables
are automatically
mapped to service
variables of the
same name.
Important! The Pipeline Editor does not display implicit mapping lines for a MAP step.
In cases where the services in a flow do not use the same names for a piece of information,
use the Pipeline Editor to explicitly map the variables to each other. Explicit mapping is
how you accomplish name and structure transformations required in a flow. The Pipeline
Editor connects explicitly mapped variables with a solid black line.
On the input side of the Pipeline Editor, use the Map modifier to map a variable from the
pipeline to the service. In the following example, the service expects a value called
OrderTotal, which is equivalent to the pipeline variable BuyersTotal—they are simply
different names for the same data. To use the value of BuyersTotal as the value for
OrderTotal, you “map” the pipeline variable to the service using the Map modifier.
At run time, the server will copy the value from the source variable (BuyersTotal) to the
target variable (OrderTotal) before executing the service.
When a pipeline
variable name is
different from the one
used by the service,
use the Map modifier
to connect them.
All the output variables that a service produces are automatically placed in the pipeline.
Just as you can map variables from the Pipeline In stage to a service’s input variables, you
can map the output from a service to a different variable in Pipeline Out.
In the following example, a variable called TransactionNumber is mapped to the element
Num in a record called TransRecord. At run time, the server will copy the value of
TransactionNumber to Num, and both TransactionNumber and Num will be available to
subsequent services in the flow.
When you map variables in the pipeline, keep the following points in mind:
The variable that you are mapping from is the source. For example, when you map
from a variable in Pipeline In to one in Service In, the Pipeline In variable is the source.
When you map from a variable in Service Out to one in Pipeline Out, the Service Out
variable is the source.
The variable you are mapping to is the target. For example, when you map from a
variable in Pipeline In to one in Service In, the Service In variable is the target. When you
map from a variable in Service Out to one in Pipeline Out, the Pipeline Out variable is the
target.
A Service In variable can be the target of more than one Map modifier only if you use
array indexing or if you place conditions on the maps to the variable.
By mapping variables to each other, you are copying data from the source variable to
the target variable. (Records, however, are copied by reference. For more information,
see “What Happens When SAP BC Server Executes a Map Between Variables at Run
Time?” on page 160.)
After you map to a target variable, you cannot create another map to the target
variable—a target variable can be connected to only one source variable. (Two
exceptions to this rule involve array variables and conditional maps. For more
information about mapping array variables, see “Mapping to and from Array
Variables” on page 165. For more information about placing conditions on maps
between variables, see “Applying Conditions to Maps Between Variables” on
page 169.
You cannot create a map to a variable if you already used the Set Value modifier to
assign a value to a variable.
After a Map modifier is executed, both the source and target variables exist in the
pipeline. The target variable does not replace the source variable.
1 In the Flow Editor, select the INVOKE or MAP step containing the variables you want
to map.
2 Click the Pipeline tab.
3 If you want to map a variable from Pipeline In to Service In, do the following:
1 In Pipeline In, click the pipeline variable you want to use as the source variable.
2 In Service In, click the input variable you want to use as the target variable.
3 Click on the toolbar.
4 If you want to map a variable from Service Out to Pipeline Out, do the following:
1 In Service Out, click the output variable you want to use as the source variable.
2 In Pipeline Out, click the pipeline variable you want to use as the target variable.
3 Click on the toolbar.
Notes:
— If the variable types are incompatible and cannot be mapped to one another, the
Pipeline Editor displays a message stating that the operation is not allowed.
— If you mapped to or from an array variable, you need to specify which element in
the array you are mapping to or from. For more information about array
mapping, see “Mapping to and from Array Variables” on page 165.
— If you want to place a condition on the execution of the map, see “Applying
Conditions to Maps Between Variables” on page 169.
Tip! You can also use your mouse to map variables to one another. To do this, select
the source variable and drag your mouse to the appropriate target variable.
Step 2: R1 is mapped to R2
Step 3: The value of String1 is changed to “modified” after the map executes
When the above flow service executes, it returns the following results.
In Step 3, the value of the String1 in R1 was set to “modified.” However, the value of
String1 in R2 changed also. This is because in step 2 of the flow service, the value of R1
was copied to R2 by reference. Changes to the value of R1 in later flow steps also change
the value of R2.
To prevent the value of the target variable from being overwritten by changes to the value
of the source value in subsequent steps in the flow service, you can do one of the
following:
When working with Record variables, map each child of the Record variable
individually. This method can be time consuming and might significantly increase the
memory and time required to run the service. However, this might be the best
approach if the target record needs only a few values from the source record.
After you map the source variable to a target variable, use the Drop modifier to drop
the source variable. Only the target variable will have the reference to the data. This
method ensures that the value of the target variable will not be overwritten in a
subsequent step, but does not increase the memory and time required to execute the
service.
Create a service that performs a copy by value. Insert this service (as an INVOKE step
or as a transformer) and map the variables to the service instead of mapping them to
each other. (In the case of Records, you could create a Java service that clones the
IData object underlying the Record.) In situations where you map one Record to
another, using a “cloning” service would require less time than mapping a record
field by field.
When you map between scalar and array variables and you do not specify which
element in the array variable that you want to map to or from, Developer uses the
default rules in the Pipeline Editor to determine the value of the target variable. For
more information about the default behavior for mapping array variables, see
“Default Pipeline Rules for Mapping to and from Array Variables” on page 580.
The following table identifies which data types you can map to each other.
String List
String Table
Record
Record List
Record Reference
Record Reference List
Object
Object List
Two String Lists can be combined into one Record List through pipeline mapping. For
example, if in the above scenario, you also had a String List variable named bList, and
recList had two String children, aString and bString, you could combine the two String
Lists by mapping aList to aString and bList to bString.
Tip! You can also convert a String List to a Record List by invoking the built‐in service
pub.list:stringListToRecordList. You can insert the service as an INVOKE step or as a
transformer. For more information about transformers, see “What Are Transformers?” on
page 177. For more information about built‐in services, see the SAP BC Built‐In Services
Guide.
For String Lists and Object Lists, you can specify the index for the element in the list
that you want to map. For example, you can map the third element in a String List to a
String.
For String Tables, you can specify the row and column indexes for the element that
you want to map. For example, you can map the value of the element in the second
row and third column of a String Table to a String.
For Record Lists, you can specify the index for the record in the Record List that you
want to map. For example, you can map the second record in a Record List to a
Record variable.
For a variable in a Record List, you can specify the index for the record in the Record
list that contains the value that you want to map. For example, if your source variable
(a String named ItemNumber) is the child of a Record List named POItems, you can
map the value of ItemNumber from the second POItems record to a String variable.
In the following diagram, the AccountNumber String variable is mapped to the Accounts
String List variable.
To specify the index for the element in the Accounts variable to which you want to map the
AccountNumber value, select the link between the variables and select Edit Properties.
Then, use the Indexing tab on the Link Properties dialog box to specify the index. If the
source or target variable is an array, Developer displays a text box next to the variable (in
this case, Accounts). For example, if you want to map the value of the AccountNumber
variable to the second element in the Accounts String List, type 1 in the field next to
Accounts. (Index numbering in arrays begins at 0.)
If the source or target variable is not an array, Developer displays the words “Field not
indexable” next to the variable name.
Indexing tab
Note: The Pipeline Editor uses blue links to indicate that properties—conditions or index
values for arrays—have been applied to the map between variables.
If the source and target variables are arrays, you can specify an index for each variable.
For example, you can map the third element in a source String List to the fifth element
in target String List.
If you do not specify an array index for an element when mapping to or from arrays,
the default behavior of the Pipeline Editor will be used. For information about the
default behavior of the Pipeline Editor, see “Default Pipeline Rules for Mapping to
and from Array Variables” on page 580.
The following procedure explains how to map to or from an array variable.
1 Map the variables to each other using the procedure described in “To map one
variable to another” on page 159.
2 Right‐click the link (line) that connects the variables, and select Properties. (You can
also double‐click the link to display the Link Properties dialog box.)
3 In the Link Properties dialog box, click the Indexing tab.
4 If the source variable is an array variable, under Source, next to the source variable
name, type the index that contains the value you want to map.
5 If the target variable is an array variable, under Destination, next to the Destination
variable name, type the index to which you want to map the source value.
6 Click OK.
Note: If you are mapping to or from a String Table, you need to specify an index value for
the row and column.
Note: When you map a Record or Record List variable to another Record or Record List
variable, the structure of the source variable determines the structure of the target
variable. For more information, see “Mapping to Record Variables” on page 163.
In the Pipeline Editor, select the link that you want to delete, and click , or right‐
click and select Delete from the shortcut menu.
Tip! You can also delete a link by selecting it and then pressing the DELETE key.
A blue link indicates that a condition is applied to the link connecting the variables
The Pipeline Editor uses blue links to indicate that properties—conditions or index values
for arrays—have been applied to the links (map) between variables.
Note: You cannot add conditions to the links between implicitly mapped variables.
Tip! If the conditions for maps to the same target variable are not mutually exclusive,
consider using a flow service containing a BRANCH step instead. In BRANCH steps,
child steps are evaluated in a top to bottom sequence. SAP BC Server executes the first
child step that evaluates to true and skips the remaining child steps. For more information
about the BRANCH step, see “The BRANCH Step” on page 110.
1 Map the variables to each other using the procedure described in “To map one
variable to another” on page 159.
2 Right‐click the link (black line) that connects the variables, and select Properties.
3 In the Link Properties dialog box, click the General tab.
General tab
Important! When drawing more than one map to the same target variable, make sure that
the conditions assigned to each map are mutually exclusive.
Note: You can temporarily disable the condition placed on a map. For more information,
see “Disabling a Condition Placed on a Map Between Variables” on page 273.
To view (or change) the value that is assigned to the Set Value modifier, double‐click the
icon next to the variable’s name to open the Input For dialog box.
Note: If a variable to which you assigned a default value is implicitly mapped to another
variable in the pipeline, the Pipeline Editor displays a gray link connecting the variables
beneath the icon.
You can also format string values by specifying one or more pipeline variables in
conjunction with a literal value. For example, if you specified (%areaCode%) %Phone%,
the resulting string would be formatted to include the parentheses and space. If you
specified %firstName% %initial%. %lastName% , the period and spacing would be
included in the value.
1 In the Flow Editor, select the INVOKE or MAP step containing the variable you want to
alter.
2 Click the Pipeline tab.
3 Select the variable to which you want to assign a value.
4 Click on the toolbar.
5 In the Input For dialog box, specify the value you want to assign to this variable.
— If you want to assign a literal value to the variable, type that value.
— If you want to derive the value from a variable in the pipeline, type the name of
that variable enclosed in % symbols. (e.g., %Phone%). Then, select the Perform
Variable Substitution check box.
6 If you want the server to use the specified value only if the variable does not contain a
value at run time, clear the Overwrite Pipeline Value check box. (If you select this check
box, the server will always apply the specified value.)
Note: You can mix literal values and pipeline variables
If you are copying a set value between Record variables, the source Record variable
and the target Record variable must have the same structure or the target Record
variable must have no structure defined. (For example, if the source Record variable is
a record named AddressInfo and has three String variables named City, State, and Zip
as children, the target Record variable must have three String variables named City,
State, and Zip as children.)
1 In the Flow Editor, select the INVOKE or MAP step containing the variable with the
value you want to copy and paste.
2 Click the Pipeline tab.
3 Select the you want to copy.
4 Right‐click and select Copy.
5 Select the variable or variables to which you want to assign the copied value, right‐
click and select Paste.
Note: You can only paste the set value if the target variable is the same data type as the
source variable and if the target variable has either an identical structure to the source
variable or has no defined structure
Important! Once you drop a variable from the pipeline, it is no longer available to
subsequent services in the flow. Do not use the Drop modifier unless you are sure the
variable is not used by services invoked after the point where you drop it.
At run time, the server removes a dropped variable from the pipeline just before it
executes the selected service (if you attach the Drop modifier to a variable in Pipeline In) or
immediately after it executes the selected service (if you attach the Drop modifier to a
variable in Pipeline Out).
If you drop a mapped variable from Pipeline In, the server executes the Map modifier before
it drops the variable. The server does not map a null value to the destination variable.
1 In the Flow Editor, select the INVOKE or MAP step whose pipeline variables you
want to drop.
2 Click the Pipeline tab.
3 Select the variable that you want to drop.
4 Click on the toolbar.
Important! If you create a new variable in a flow, you must immediately do one of the
following:
– Map a variable to it
– Assign a value to it
– Drop it
If you do not take one of these steps, the Pipeline Editor automatically clears it from the
map the next time it refreshes the Pipeline tab.
Note: You might want to drop a variable immediately after adding it if a service produces
a variable that is not declared in the service input or output parameters. The variable will
not appear in the Pipeline Editor if it is not an input or output parameter. By adding and
then immediately dropping the variable, you can delete the variable if it does exist in the
pipeline.
1 In the Flow Editor, select the INVOKE or MAP step that represents the stage of the
pipeline at which you want to add a new variable.
2 Click the Pipeline tab.
3 Select the point where you want to add the new variable.
4 Click and select the type of variable that you want to create.
5 Type the name of the variable and press ENTER.
6 If the variable is a Record or a Record List, repeat steps 4 and 5 to define its member
variables. Then use to indent each member variable beneath the Record or Record
List variable.
7 Assign one of the pipeline modifiers to the new variable (Map, Drop, or Set Value). (If
you do not assign a modifier to the variable, the Pipeline Editor considers it
extraneous to the flow and automatically clears the variable when it refreshes the
Pipeline tab.)
Note: Services that you insert using the INVOKE step might also perform value
transformations. However, only transformers can accomplish multiple value
transformations in a single flow step.
You can think of transformers as a series of INVOKE steps embedded in a MAP step. And
like INVOKE steps, when you insert a transformer, you need to map variables between
the pipeline to the transformer (create links between pipeline variables and the
transformer). You can also set properties for the transformer and validate the input and/or
output of the transformer. Because transformers are contained within a MAP step, they do
not appear as a separate flow step in the Flow Editor.
Transformers are well suited for use when mapping data from one document format to
another. When you map data between formats, you usually need to perform several
name, structure, and value transformations. By using transformers, the flow service in
which you map data between formats could potentially consist of a single MAP step in
where transformers and links between variables handle all of the data transformations. In
this way, you could see your entire document‐to‐document mapping in a single view.
Tip! You can create a flow service that uses transformers to convert data between
document formats (such as an IDOC to an XML document or RosettaNet PIP to a
proprietary format). You could then invoke this service in other flow services each time
you need to convert between the specific document formats before you begin processing
data.
Note: In a MAP step, the Pipeline Editor only displays the links between pipeline variables
and transformers. The Pipeline Editor does not display any implicit mapping for a MAP
step.
For more information about built‐in services, see the SAP BC Built‐In Services Guide.
Any service can be used as a transformer, including flow services, C services, and Java
services.
The transformers you insert into a MAP step operate on the same set of pipeline data.
The output of one transformer cannot be used as the input of another transformer in
the same MAP step.
Transformers in a MAP step are independent of each other and do not execute in a
specific order. When inserting transformers, assume that SAP BC Server concurrently
executes the transformers at run time.
To insert a transformer
1 In the Flow Editor, select the MAP step in which you want to insert a transformer.
2 Click the Pipeline tab.
3 Click on the Pipeline tab toolbar, and select the service you want to invoke. If
the service you want to insert does not appear in the list, select Browse to select the
service from the Service Browser. The transformer appears under Transformers on the
Pipeline tab.
4 To set the properties for the transformer, right‐click the transformer and select
Properties. Then, complete the following fields in the Transformer Properties dialog box:
5 Click OK.
For information about debugging transformers, see “Debugging Transformers” on
page 187.
Note: In SAP BC version 3.x, you could set an as‐user property for a transformer. In SAP
BC Server version 4.0, this property was removed. For more information see “The As‐User
Property in SAP BC Developer 3.x” on page 97.
1 To map a variable from Pipeline In to the transformer, do the following:
1 In Pipeline In, select the variable you want to use as input to the transformer and
drag your mouse to the transformer.
2 In the Map To list, select the transformer variable to which you want to map the
Pipeline In variable.
Once you map input variable for a transformer to a Pipeline In variable,
Developer displays the phrase “has already been chosen” next to the transformer
variable in the Map To list.
3 Repeat steps 1 and 2 for each transformer input variable you want to map to a
pipeline variable.
2 To map an output variable from the transformer to Pipeline Out, do the following:
1 Select the transformer and drag your mouse to the variable in Pipeline Out to which
you want to map the transformer.
2 In the Map From list, select the transformer variable that you want to map to the
selected Pipeline Out variable.
3 Repeat steps 1 and 2 for each output variable produced by the transformer.
You can map an output variable for a transformer to more than one Pipeline Out
variable.
Important! Developer does not automatically add the output of a transformer to the
pipeline. If you want the output of a transformer to appear in the pipeline after the
transformer executes, you need to explicitly map the output variable to a variable in
Pipeline Out.
Important! If you do not map any output variables or the transformer does not have any
output variables, the transformer will not execute.
Transformer Movement
When you map to and from a selected transformer, it moves up and down in the
Transformers column. This movement or “jumping” is by design to help minimize the
distance between the transformer and the variable you are mapping it to.
Transformers exhibit the following behavior or movement:
When a transformer is selected and you select a variable in Pipeline In or Pipeline Out,
the transformer “jumps” or moves up or down in the Transformers column so that it is
directly across from the selected pipeline variable.
When you finish mapping a transformer and it is no longer selected, the Pipeline
Editor “anchors” or aligns the transformer next to the highest Pipeline Out variable it is
mapped to.
To stop the transformer from jumping, click the transformer again or click in the empty
areas of the Pipeline Editor.
Note: To expand your view of the Pipeline Editor, maximize the Pipeline tab. Click
anywhere on the Pipeline tab, and click on the toolbar. The Pipeline tab expands to be
the size of the Developer window.
What Is Dimensionality?
Dimensionality refers to the number of arrays to which a variable belongs. For example,
the dimensionality of a single String is 0, that of a single String List or Record List is 1, and
that of a single String Table is 2. A String that is a child of a Record List has a
dimensionality of 1. A String List that is a child of a Record List has a dimensionality of 2.
Example
In the following example, the unitPrice variable cannot be mapped to num1 because the
unitPrice variable has a dimensionality of 1 ( string (0) + Record List (1) = 1) and num1 has
a dimension of 0.
Solution
To solve this, you can either:
Change the service invoked by the transformer to accept arrays as data, or
Create a flow service in which a LOOP step loops over the array variable. Then, (in
the same flow service) invoke the service you originally wanted to use as a
transformer, and make that INVOKE step a child of the LOOP. Finally, insert the
resulting flow service as a transformer in the MAP.
Of the two options, changing the service to accept arrays as data results in faster execution
of flow services.
1 In the Flow Editor, select the MAP step containing the transformer you want to
validate.
2 Click the Pipeline tab.
3 Under Transformers, select the transformer for which you want to validate input or
output. Right‐click the transformer, and select Properties.
4 In the Transformer Properties dialog box, in the validate-in list, select $default if you want
to validate the input to the transformer against the input parameters of the invoked
service.
5 In the validate-out list, select $default if you want to validate the output of the
transformer against the output parameters of the invoked service.
6 Click OK.
Copying Transformers
You may want to use the same transformer more than once in a MAP step. For example,
you might want to convert all the dates in a purchase order to the same format. Instead of
using the button to locate and select the service, you can copy and paste the
transformer service.
You can also copy transformers between MAP steps in the same flow or MAP steps in
different flow services.
Important! Copying a transformer does not copy the links between transformer variables
and pipeline variables or any values you might have assigned to transformer variables
using the Set Value modifier.
To copy a transformer
1 In the Flow Editor, select the MAP step containing the transformer service you want
to copy.
2 Click the Pipeline tab.
3 Under Transformers, select the transformer service you want to copy. Right‐click the
transformer, and select Copy.
4 To paste the transformer, click anywhere under Transformers. Right‐click and select
Paste.
5 Map the input and output variables of the transformer using the procedures
described in “Mapping Variables to a Transformer” on page 181.
Expanding Transformers
You might find it easier to map transformers when you expand the transformer. When
you expand a transformer, you can see the Service In and the Service Out variables for the
transformer and all of the maps between the pipeline and the transformer variables.
When you expand a transformer, you can only perform actions for that transformer, e.g.,
you can only map variables or set properties for the expanded transformer. Other
transformers and mappings to other transformers remain hidden until you collapse the
transformer.
To expand a transformer
On the Compose menu, click Expand.
–OR–
Double‐click the transformer you want to expand.
–OR–
Click next to the transformer you want to expand.
To return to a normal view of the Pipeline tab, click – next to the transformer name, or
on the Compose menu, click Collapse.
Note: If SAP BC Server displays a message stating that the transformer cannot be
found, then the service invoked by the transformer has been renamed, moved, or
deleted. You need to use the transformer properties to rename the transformer. See
below for more information.
Renaming Transformers
If SAP BC Server displays the message “Transformer not found” when you try to expand
a transformer or when you point the mouse to the transformer, then the service referenced
by the transformer has been renamed, moved, or deleted. You need to change the service
property of the transformer so that the transformer points to the moved, or renamed
service.
If the service referenced by the transformer has been deleted, you may want to delete the
transformer.
Tip! You can enable safeguards so that you do not inadvertently affect or break other
services when you move, rename, or delete a service. For more information, see
“Renaming and Deleting Elements” on page 37.
To rename a transformer
1 Use the Service Browser to determine the new name or location of the service called
by the transformer.
2 In the Service Browser, select the flow service containing the transformer you want to
rename.
3 In the Flow Editor, select the MAP step containing the transformer. Then, on the
Pipeline tab, select the transformer you want to rename.
4 Right‐click the transformer and select Properties.
–OR–
On the Edit menu, select Properties.
5 In the Transformer Properties dialog box, in the service field, delete the old name, and
type in the service’s new fully qualified name in the folderName:serviceName format.
Click OK.
Debugging Transformers
When you test and debug a flow service, you can use the following testing and debugging
techniques with transformers:
Step into a MAP step and step through the execution of each transformer. For more
information about stepping into and out of a MAP step, see “Using the Step Tools
with a MAP Step” on page 266.
Set a breakpoint on a transformer so that service execution stops when the
transformer is encountered. For more information about setting breakpoints, see
“Setting Breakpoints” on page 266.
Disable a transformer so that it does not execute at run time. For more information
about disabling transformers, see “Disabling Transformers” on page 271.
This chapter provides information about creating, editing, and using SAP BC schemas,
records, and specifications.
Schema tab
Select a component in
the Schema Browser...
Schema Browser
The Schema Browser displays the components of an SAP BC schema in a format that
mirrors the structure and content of the source file. The Schema Browser groups the
global element declarations, attribute declarations, simple type definitions and complex
type definitions from the source file under the top‐level headings ELEMENTS,
ATTRIBUTES, SIMPLE TYPES, and COMPLEX TYPES. For example, the ELEMENTS
heading contains all of the global element declarations from the XML Schema or the DTD.
If the source file does not contain one of these global components, the corresponding
heading is absent. For example, if you create an SAP BC schema from an XML Schema
that does contain any global attribute declarations, the Schema Browser does not display
the ATTRIBUTES heading. an SAP BC schema created from a DTD never displays the
SIMPLE TYPES or COMPLEX TYPES headings because DTDs do not contain type
definitions.
Note: A DTD does contain attribute declarations. However, the Schema Browser does not
display the ATTRIBUTES heading for SAP BC schemas generated from DTDs. This is
because an attribute declaration in a DTD associates the attribute with an element type.
Accordingly, the Schema Browser displays attributes as children of the element type
declaration to which they are assigned. For more information, see “Element Type
Declarations”.
The Schema Browser uses unique symbols to represent the components of the SAP BC
schema. Each of these symbols relates to a component of an XML Schema or a DTD. The
following table identifies the symbol for each component that can appear in an SAP BC
schema.
Note: In the following table, global refers to elements, attributes, and types declared or
defined as immediate children of the <schema> element in an XML Schema. All element
type declarations in a DTD are considered global declarations.
Symbol Description
Element declaration. An element declaration associates an element name
with a type definition. This symbol corresponds to the <element>
declaration in an XML Schema and the ELEMENT declaration in a DTD.
Element reference. An element reference is a reference from an element
declaration in a content specification to a globally declared element.
In an SAP BC schema generated from an XML Schema, this symbol
corresponds to the ref="globalElementName" attribute in an <element>
declaration.
In an SAP BC schema generated from DTD, this symbol appears next to an
element that is a child of another element—the parent element has only
element content.
Any element declaration. In XML Schema, an <any> element declaration is a
wildcard declaration used as a placeholder for one or more undeclared
elements in an instance document.
In a DTD, an element declared to be of type ANY can contain any well‐
formed XML. This symbol corresponds to an element declared to be of
type ANY.
Because an <any> element declaration does not have a name, the Schema
Browser uses ʹAnyʹ as the name of the element.
Attribute declaration. An attribute declaration associates an attribute name
with a simple type definition. This symbol corresponds to the XML
Schema <attribute> declaration or the attribute in a DTD ATTLSAP BCT
declaration.
Attribute reference. An attribute reference is a reference from a complex type
definition to a globally declared attribute. This symbol corresponds to the
ref="globalAttributeName" attribute in an attribute declaration.
DTDs do not have attribute references. Consequently, attribute references
do not appear in SAP BC schemas generated from DTDs.
Symbol Description
Any attribute declaration. An any attribute declaration is a wildcard
declaration used as a placeholder for undeclared attributes in an instance
document. This symbol corresponds to the <anyAttribute> declaration in
an XML Schema.
Because an <anyAttribute> declaration does not specify an attribute
name, the Schema Browser uses ʹAnyʹ as the name of the attribute.
Simple type definition. A simple type definition specifies the data type for a
text‐only element or an attribute. Unlike complex type definitions, simple
type definitions cannot carry attributes. This symbol corresponds to the
<simpleType> element in an XML Schema.
If the simple type definition is unnamed (an anonymous type), the Schema
Browser displays ʹAnonymousʹ as the name of the complex type definition.
Complex type definition. A complex type definition defines the structure and
content for elements of complex type. (Elements of complex type can
contain child elements and carry attributes.) This symbol corresponds to
the <complexType> element in an XML Schema.
If the complex type definition is unnamed (an anonymous type), the
Schema Browser displays ʹAnonymousʹ as the name of the complex type
definition.
Sequence content model. A sequence content model specifies that the child
elements in the instance document must appear in the same order in which
they are declared in the content model. This symbol corresponds to the
<sequence> compositor in an XML Schema or a sequence list in an element
type declaration in a DTD.
Choice content model. A choice content model specifies that only one of the
child elements in the content model can appear in the instance document.
This symbol corresponds to the <choice> compositor in an XML Schema
or a choice list in a DTD element type declaration.
All content model. An all content model specifies that child elements can
appear once, or not at all, and in any order in the instance document. This
symbol corresponds to the <all> compositor in an XML Schema.
Symbol Description
Mixed content. Elements that contain mixed content allow character data to
be interspersed with child elements. This symbol corresponds to the
mixed="true" attribute in an XML Schema complex type definition or a
DTD element list in which the first item is #PCDATA.
Empty content. In an XML Schema, an element has empty content when its
associated complex type definition does not contain any element
declarations. An element with empty content may still carry attributes.
In a DTD, an element has empty content when it is declared to be of type
EMPTY.
If you select an
element declaration...
When you select a simple type definition, the Schema Details area looks like the following:
Note: The actual work of creating an SAP BC schema is performed by the schema
processor. The schema processor is the subsystem of the SAP BC Server that compiles an
SAP BC schema from a source file.
Note: You can find sample XML Schema definitions in the following directory:
<sapbc>\developer\samples\xml\xsd. You can also find XML Schema
definitions and DTDs on the Web sites for these groups: (www.w3c.org and
www.openapplications.org).
1 Click on the Service Browser toolbar.
2 In the New dialog box, select Schema, and click Next.
3 In the New Schema dialog box, next to Folder, select the folder where you want to save
the SAP BC schema.
4 In the Name field, type a name for the SAP BC schema using any combination of
letters, numbers, and the underscore character. Click Next.
Important! Developer does not permit the use of certain reserved words and characters
that are used in Java or C/C++ (such as for, while, and if ) as names. Developer also
prohibits the use of a digit as the first character in a name. If you specify a name that
uses a reserved word or character, SAP BC Server displays an error message. When
this happens, use a different name or try adding a letter or number to the name to
make it valid.
5 In the New Schema dialog box, select one of the following to specify the source for the
SAP BC schema.
Specify... To...
XML Create an SAP BC schema based on an existing DTD referenced by
an XML document.
DTD Create an SAP BC schema based on a DTD.
XML Schema Create an SAP BC schema based on an XML Schema definition.
Important! You can create an SAP BC schema from an XML document only if the XML
document references an existing DTD.
6 Click Next.
7 In the New Schema dialog box, under Enter a URL or select a local file, do one of the
following:
— If you want to base the SAP BC schema on an XML document, DTD, or XML
Schema definition that resides on the Internet, type the URL of the resource. (The
URL you specify must begin with http: or https:.)
— If you want to base the SAP BC schema on an XML document, DTD, or XML
Schema definition that resides on your local file system, type the path and file
name, or click to navigate to and select the file.
8 Click Finish. Developer generates the SAP BC schema using the document you
specified and displays it in the Editor in the Developer window.
Note: You might receive errors or warnings when creating an SAP BC schema from an
XML Schema definition or DTD. For more information about these errors and warnings,
see “Validation Errors and Exceptions” on page 627.
Note: When creating an SAP BC schema from an XML Schema definition, Developer
validates the schema and does not create the SAP BC schema if the XML Schema
definition is not valid. For more information, see “SAP BC Schema Generation Errors and
Warnings” on page 643.
processor encounters a <redefine> mechanism in an XML Schema, Developer
displays the following message:
Detected use of ʺredefineʺ in {XML Schema Name}. SAP BC Server does not
support ʺredefineʺ.
When modifying a simple type definition, keep the following points in mind:
Changes to a simple type definition affect the elements and attributes for which the
simple type is the defined type. For example, if the attribute partNum is defined to be
of type SKU, changes to the SKU simple type definition affect the partNum attribute.
Changes to a global simple type definition in an SAP BC schema do not affect simple
types derived from the global simple type; that is, the changes are not propagated to
the derived types in the SAP BC schema.
Simple types in an SAP BC schema can be used as content constraints for variables in
pipeline validation. Consequently, changes to a simple type also affect every variable
to which the simple type is applied as a content constraint.
Tip! You can create a custom simple type to apply to a variable as a content type
constraint. For more information about creating a custom simple type and applying
constraints to variables, see “Setting Constraining Facet Values” on page 200.
Changes to a simple type definition are saved in the SAP BC schema. If you
regenerate the SAP BC schema from the XML Schema definition, your changes will be
overwritten.
When you edit the constraining facets applied to a simple type definition, you can
only make the constraining facet values more restrictive. The constraining facets
cannot become less restrictive. For more information about setting values for
constraining facets, see “Setting Constraining Facet Values” on page 200.
Tip! If you want to edit complex type definitions, attribute declarations, element
declarations, or the structure of the schema, you need to edit the XML Schema and then
regenerate the SAP BC schema.
1 In the Service Browser, select the SAP BC schema that contains the simple type you
want to edit.
2 In the Schema Browser, select the simple type that you want to edit. The symbol
appears next to simple types.
3 In the Schema Details are, specify the constraining facets that you want to apply to the
simple type. For more information about constraining facets, see “Constraining
Facets” on page 623.
4 To save your changes, click on the Service Browser toolbar.
Creating a Record
A record in the Service Browser can be used to specify input or output parameters for a
service or specification. A record can also be used to build a Record or Record List
variable and as the blueprint for pipeline validation and record validation.
Records can provide the following benefits:
Using a record as the input or output signature for a service can reduce the effort
required to build a flow.
Using a record to build Record or Record List variables can reduce the effort needed
to declare input or output parameters or the effort/time needed to build other records.
Records improve accuracy, because there is less opportunity to introduce a typing
error typing variable names.
Records make future changes easier to implement, because you can make a change in
one place—the record—rather than everywhere the record is used.
If you make a change to a record, keep in mind that any change is automatically
propagated to all services, specifications, Record variables, and Record List variables that
use or reference the record. (This happens when you save the updated record to the
server.)
Important! If you use a record as the blueprint for XML, pipeline, or record validation, any
changes you make to the record can affect whether the object being validated (XML
document, pipeline, or record) is considered valid. For more information about
validation, see “Performing Data Validation” on page 209.
You can create an empty record in which you define the structure and the variables, or
you can base the record on an XML document, DTD, XML Schema definition, SAP DDIC
Structure or SAP IDoc. When you create a record using one of these elements, Developer
creates a record with the same structure and same variable constraints as the source
document.
To create a record
1 On the File menu, click New. The wizard starts.
2 In the New dialog box, select Record and click Next.
3 In the New Record dialog box, do the following:
1 In the list next to Folder, select the folder in which you want to save the record.
2 In the Name field, type a name for the record using any combination of letters,
numbers, and/or the underscore character.
Important! Developer does not allow the use of certain reserved words and characters
that are used in Java or C/C++ (such as for, while, and if) as names. If you specify a
name that is a reserved word, Developer displays an error message. When this
happens, use a different name or try adding a letter or number to the name you have
specified to make it valid
4 In the New Record dialog box, select one of the following to specify whether you want
to build a record based on the structure and elements defined in an existing XML
document, DTD, XML Schema, SAP DDIC Structure or SAP IDoc.
Select... To...
None Create an empty record in which you define variables.
XML Create a record that matches the structure and variables in an
XML document.
DTD Create a record that matches the structure and variables in a
DTD.
XML Schema Create a record that matches the structure and variables in an
XML Schema definition.
SAP Structure Create a record that matches a structure of the SAP DDIC (data
dictionary).
SAP IDoc Create a record that matches the structure and segments of an
SAP IDoc.
5 If you selected None, click Finish, and skip to step 8.
Otherwise, click Next.
6 In the New Record dialog box, do one of the following:
— If you want to base the record on an XML document, DTD, or XML Schema
definition that resides on the Internet, type the URL of the resource. (The URL
you specify must begin with http: or https:.)
— If you want to base the record on an XML document, DTD, or XML Schema
definition that resides on your local file system, type in the path and file name, or
click to navigate to and select the file.
— If you want to base the record on an SAP Structure or an SAP IDoc, select the SAP
system you want to retrieve the information from and enter the name of the
structure or IDoc you are looking for.
7 Do one of the following:
— If you selected XML in step 4, click Finish. Developer generates the record using the
XML document you specified and displays it on the Record tab. If you need to
modify the generated record, proceed to the next step. Otherwise, skip to step 9.
— If you selected SAP Structure or SAP IDoc in step 4, click Finish. Developer generates
the record using the structure or IDoc you specified and displays it on the Record
tab. If you need to modify the generated record, proceed to the next step.
Otherwise, skip to step 9.
— If you selected DTD or XML Schema in step 4, click Next. Developer prompts you to
select the root element for the document. Select the root element and click OK.
Developer generates the record and displays it on the Record tab. Developer also
generates an SAP BC schema and displays it in the Service Browser. If you need to
modify the generated record, proceed to the next step. Otherwise, skip to step 9.
Note: You might receive errors or warnings when creating a record from a DTD or
XML Schema definition. For more information about these errors and warnings, see
“Validation Errors” on page 628.
8 If you want to add or edit variables in the record, click the Record tab to make it active.
For each variable in the record, do the following:
1 Click on the toolbar and select the type of variable that you want to specify.
2 Type the name of the variable and then press ENTER.
3 Right‐click the variable and select Properties to set variable properties and apply
validation constraints (optional).
For more information about setting variable properties, see “Specifying Variable
Properties” on page 205. For details on applying constraints, see “Applying
Constraints to Variables” on page 211.
4 If the variable is a Record or a Record List, repeat steps 1–3 to define its member
variables. Then use to indent each member variable beneath the Record or
Record List variable.
9 On the File menu, click Save (or click in the Service Browser). The record is saved
to the SAP BC Server.
Printing a Record
You can use the View as HTML command to produce a printable version of a record. This
lets you see all the variables in a record in a single document.
To print a record
1 In the Service Browser, select the record you want to print.
2 From the File menu, select View as HTML or click .
Developer expands any Record and Record List variables in the record, creates an
HTML page containing the record, and displays the HTML page in your default
browser.
3 If you want to print the record, select your browser’s print command.
1 In the Service Browser, select the service to which you want to assign the record.
2 Click the Input/Output tab.
3 Under Input or Output (depending on which half of the Input/Output tab you want to
apply the record to), type the fully qualified name of the record or click to select it
from a list.
4 On the File menu, click Save (or click in the Service Browser).
Important! When a record is assigned to the input or output of a service, you cannot
add, delete, or modify the variables on that half of the Input/Output tab.
Click... To...
Record Reference Create a Record variable based on a record in the Service
Browser.
Record Reference List Create a Record List variable based on a record in the
Service Browser.
2 In the Name field, type the fully qualified name of the record or select it from the list
next to Folder.
3 Click OK.
4 Type the name of the variable.
5 Press ENTER.
Important! If you use a record to build a Record or Record List variable, you cannot
directly add, delete, or modify members of that variable on the Input/Output tab. To edit
the referenced Record or Record List, select it in the Service Browser, and then edit the
variables on the Record tab.
Creating a Specification
A specification is a “free‐standing” SAP BC element that defines a set of service inputs
and outputs. If you have multiple services with the same input and output requirements,
you can point each service to a single specification rather than manually specifying
individual input and output variables in each service.
Using specifications provides the following benefits:
It reduces the effort required to build each flow.
It improves accuracy, because there is less opportunity to introduce a typing error
when defining a variable name.
It makes future specification changes easier to implement, because you can make the
change in one place—the specification—rather than in each individual service.
If you use a specification, keep in mind that:
Any change that you make to the specification is automatically propagated to all
services that reference that specification. (This happens the moment you save the
updated specification to the server.)
A specification wholly defines the input and output parameters for a service that
references it. This means that you cannot directly alter the service’s input and output
parameters through its Input/Output tab. (Developer displays the parameters, but does
not allow you to change them.) To make changes to the input and output parameters
of the service, you must modify the specification (which affects all services that
reference it) or detach the specification so you can manually define the parameters on
the service’s Input/Output tab.
You create a specification with Developer. You assign a specification to a service using the
Input/Output tab for the service.
To create a specification
1 On the File menu, click New. The wizard starts.
2 In the New dialog box, select Specification, and click Next.
3 In the New Specification dialog box, do the following:
1 In the list next to Folder, select the folder to which you want to save the
specification.
2 In the Name field, type a name for the specification using any combination of
letters, numbers, and the underscore character.
Important! Developer does not allow the use of certain reserved words (such as for,
while, and if ) as names. If you specify a name that is a reserved word, you will receive
an error message. When this happens, use a different name or try adding a letter or
number to the name you specified to make it valid.
3 Click Finish.
4 If you want this specification to reference another specification, do the following:
Important! Typically, you do not build a specification by referencing another
specification. However, it is useful to do this in the situation where you will use the
specification with a group of services whose requirements are expected to change (i.e.,
they match an existing specification now, but are expected to change at some point in
the future). Referencing a specification gives you the convenience of using an existing
specification and the flexibility to change the specification for only that single group
of services in the future.
5 If you want to reference a record for the Input or Output half of the specification. Do the
following:
1 In the Input or Output field (depending on which half of the specification you want
to assign the record to) type the record name or click to select it from a list. For
information about creating records, see “Creating a Record” on page 200.
2 Proceed to the next step to specify the variables for the other half of the
specification. (If you assigned records to both the Input and Output sides of this
specification, skip the rest of this procedure.)
Important! Once you assign a record to the Input or Output side of a specification, you
cannot add, delete, or modify the variables on that half of the Input/Output tab.
6 For each input or output variable that you want to define, do the following:
1 Select the half of the specification (Input or Output) where you want to define the
variable by clicking anywhere in that half’s large white text box.
2 Click on the toolbar and select the type of variable that you want to specify.
3 Type the name of the variable and then press ENTER.
4 Right‐click the variable and select Properties to set variable properties and apply
validation constraints (optional).
For details on setting variable properties, see “Specifying Variable Properties” on
page 205. For details on applying constraints, see “Applying Constraints to
Variables” on page 211.
5 If the variable is a Record or a Record List, repeat steps 2–4 to define each of its
members. Then use to indent each member beneath the Record or Record List
variable.
7 On the File menu, click Save (or click in the Service Browser). The specification is
saved to the SAP BC Server.
1 In the Service Browser, select the service to which you want to assign a specification.
2 Click the Input/Output tab.
3 In Specification Reference, type the fully qualified name of the specification, or click
to select it from a list.
Important! When a specification is assigned to a service, you cannot add, delete, or modify
the declared variables using that service’s Input/Output tab.
The following sections provide information about performing each type of validation and
information about applying constraints to variables and records.
Note: When you create a record from an XML Schema definition or a DTD, the constraints
applied to the elements and attributes in the original document are preserved in the new
record. For more information about creating records, see “Creating a Record” on
page 200.
1 Select the variable to which you want to apply constraints.
You can apply constraints to variables in records, variables in a specification, and
variables declared on the Input/Output tab.
2 Right‐click the variable and select Properties. Developer opens the Variable Properties
dialog box.
3 In the Variable Properties dialog box, click the Constraints tab.
Constraints tab
4 If you want to require the selected variable to exist at run time, select the Field must
exist at run-time check box. If the existence of the variable is optional, leave the check
box cleared.
5 If the selected variable is a Record or Record List, and you want to allow it to contain
child variables that are not specified in the record, select the Allow unspecified fields
check box.
If the Allow Unspecified Fields check box is cleared, at run time, any child variables that
exist in the pipeline but do not appear in the record will be treated as errors.
6 If the selected variable is a String, String List, or String Table, and you want to specify
content constraints for the variable, do one of the following:
— If you want to use a content type that corresponds to a simple type built‐in to
XML Schema, in the Content type list, select the type for the variable contents. For a
description of these content constraints, see Appendix G, “Validation Content
Constraints” on page 611.
— If you want to use a simple type from an SAP BC schema as the content
constraint, click the Browse button. In the Browse dialog box, select the SAP BC
schema containing the simple type you want to apply. Then, select the simple
type you want to apply to the variable.
Note: A content type corresponds to a simple type from an XML Schema definition. All
of the choices in the Content type list correspond to simple types defined in XML
Schema Part 2: Datatypes.
7 Do one of the following:
— If you want to customize the content type by changing the constraining facets
applied to the type, see “Customizing a Content Type” on page 213.
— If you want to apply the selected content type to the variable, click OK.
8 Repeat steps 2–7 for each variable to which you want to apply constraints in the
record, specification, service input, or service output.
9 Click to save your changes.
Note: When you edit a simple type definition in an SAP BC schema, the changes are saved
to the selected type definition in the SAP BC schema. The modifications affect any
variable to which the simple type is applied as a content type constraint. For more
information about editing a simple type definition, see “Editing a Simple Type in an SAP
BC Schema” on page 198.
When customizing a content type, keep the following points in mind:
When you edit the constraining facets applied to a content type, you can only make
the constraining facet values more restrictive. The constraining facets cannot become
less restrictive. For more information about setting values for constraining facets, see
“Constraining Facets” on page 623.
The constraining facets you can specify depend on the content type. For more
information about the constraining facets for each content type, see Appendix C,
“Supported Data Types” on page 577.
The customized content type applies only to the selected variable. To make changes
that affect all variables to which the content type is applied, edit the content type in
the SAP BC schema. (All content types are simple types from SAP BC schemas.) For
more information about editing simple types, see “Editing a Simple Type in an SAP
BC Schema” on page 198.
1 Select the variable to which you want to apply a customized content type.
2 Right‐click the variable, and select Properties.
3 In the Variable Properties dialog box, click the Constraints tab.
4 To select the content type you want to customize, do one of the following:
— In the Content type list, select the content type you want to customize.
— If you want to customize a simple type from an SAP BC schema, click the Browse
button. In the Browse dialog box, select the SAP BC schema containing the simple
type. Then, select the simple type you want to customize and apply to the
variable.
5 Click the Customize button. Developer makes the constraining facet fields below the
Content type list available for data entry. (Developer changes the background of the
constraining facet fields from grey to white.) Developer changes the name of the
content type to contentType_customized.
6 In the fields below the Content type list, specify the constraining facet values you want
to apply to the content type.
Note: If you also entered values using the Pick List feature on
the General tab, those values will be displayed at run time.
However, the enumeration constraints will be used for
validation.
fractionDigits The maximum number of digits to the right of the decimal
point. For example, 99.999 has a fractionDigits value of 2.
length The precise units of length required for the variable value.
minLength The minimum units of length permitted for the variable value.
maxLength The maximum units of length permitted for the variable value.
minInclusive The lower bound of a range of possible values, including the
value you specify. The variable can have a value greater than
or equal to minInclusive.
minExclusive The lower bound of a range of possible values, not including
the value you specify. The variable can have a value greater
than but not equal to minExclusive.
maxInclusive The upper bound of a range of possible values, including the
value you specify. The variable can have a value less than or
equal to maxInclusive.
maxExclusive The upper bound of a range of possible values, not including
the value you specify. The variable can have a value less than
but not equal to maxExclusive.
pattern A pattern (regular expression) that the value of the variable
must match. For example, you can use a regular expression to
specify that a variable that is a string content constraint must
match a Social Security number format.
totalDigits The maximum number of decimal digits allowed in a value.
For example, the totalDigits of the value 999.99 is 5.
7 Click OK. Developer saves the changes as a new content type named
contentType_customized.
Important! Developer throws exceptions at design‐time if the constraining facet values
for a content type are not valid. For more information about these exceptions, see
Appendix H, “Validation Errors and Exceptions” on page 627
These fields
reference the
record
addressBlock.
Which elements contain child elements and the order of the child elements.
The type of data that elements and attributes can contain.
The number of times an element can appear in an XML document.
Which attributes correspond to which elements.
For information about creating SAP BC schemas, see “Creating an SAP BC Schema” on
page 190.
Note: If the XML document has been converted to a record, validate the XML document
against a record. For more information about validating a record, see “Creating a Record”
on page 200?
You can specify whether the pub.schema:validate service should fail if the XML
document is invalid.
If you want to validate an XML document against an SAP BC schema, the XML
document needs to be a parsed document (a Document node). You can use the
pub.web:loadDocument service or the pub.web:stringToDocument to parse an XML document.
You can also submit an XML document directly to the server via HTTP or FTP. When
the server receives the document, it will automatically parse it. For more information
about submitting XML documents to services, see “Passing XML Data to a Service” on
page 371.
If you want to validate an XML document against a record, the XML document needs
to be a record. You can use the pub.web:documentToRecord service to create a record from
a Document node.
Note: For more information about the pub.web services, see the SAP BC Built‐In Services
Guide.
1 In the Service Browser, select the flow service in which you want to validate an XML
document.
2 In the Flow Editor, click and select Browse.
3 Use the list next to Folder to navigate to and select the pub.schema:validate service and
click OK.
4 In the Flow Editor, move the validate service to the point in the flow where you want to
validate the XML document.
5 Click the Pipeline tab. The Pipeline Editor for the pub.schema:validate service appears.
Note: The nominated SAP BC schema is only used to validate unqualified nodes, that
is, nodes with XML Namespaces URI = null.
9 Use the following table to assign values to the remaining Service In variables for the
pub.schema:validate service. All of these variables are optional.
10 Click to save your changes.
For information about errors that can occur during validation, see “Validation Errors and
Exceptions” on page 233.
Execute or not execute a service based on the validity of the pipeline data.
Eliminate extra validation code in your service.
In pipeline validation, a record in the Service Browser is the blueprint or model that you
validate the pipeline against. The constraints applied to the variables in the record
determine what can and cannot be included in the pipeline. For more information about
applying constraints to variables, see “Applying Constraints to Variables” on page 211.
After you define and apply constraints to the record that you want to validate the pipeline
against, you can validate the pipeline using the built‐in service pub.schema:validatePipeline.
This service instructs the validation engine to validate the pipeline by comparing the
pipeline contents against a specified record in the Service Browser. The pipeline is valid
when it conforms to the structural and content constraints applied to the record. The
pub.schema:validatePipeline service returns a string that indicates whether validation was
successful and an IData array (errors variable) that contains any validation errors.
When you insert the pub.schema:validatePipeline service, you can determine the maximum
number of errors to be collected by the server. You can also specify whether the
pub.schema:validatePipeline service should fail if the pipeline is invalid.
1 In the Service Browser, select the flow service in which you want to validate the
pipeline.
2 Click and select Browse.
3 Use the list next to Folder to navigate to and select the pub.schema:validatePipeline
service.
4 In the Flow Editor, move the validatePipeline service to the point in the flow where you
want to validate the pipeline.
5 Click the Pipeline tab.
6 Under Service In, select conformsTo and click .
7 In the Input for dialog box, type the name of the record that you want to validate the
pipeline against and click OK. You need to type the fully qualified name of the record.
For example: folderName:recordName.
8 Use the following table to assign values to the remaining Service In variables for the
validatePipeline service.
9 Click to save your changes to the flow service.
.
.
.
IData validInput;
IData dtrResult;
.
.
.
// put the result from the documentToRecord service (i.e, the object to be
// validated) into the key named <object>
IDataCursor validCursor = validInput.getCursor();
IDataCursor dtrCursor = drtResult.getCursor();
dtrCursor.first("boundNode");
validCursor.insertAfter( "object", dtrCursor.getValue() );
dtrCursor.destroy();
For additional information about pub.schema:validate and pub.schema:validatePipeline, see the
Schema services in the SAP BC Built‐In Services Guide.
Note: The declared input and output parameters for a service are sometimes called the
signature of the service.
You can specify that you want to perform input/output validation for a service in the
following ways:
Input/Output tab. Set properties on the Input/Output tab to instruct the validation engine
in SAP BC Server to validate the inputs and/or outputs of the service every time the
service executes. If a client calls the service and the inputs are invalid, the service fails
and does not execute.
INVOKE step properties. Set up input/output validation via the INVOKE step properties
to instruct the validation engine to validate the service input and/or output only when
it is called from within another flow service. At run time, if the inputs and/or outputs
of the service are invalid, the INVOKE flow step that calls the service fails.
To determine which method to use, determine whether or not you want the service input
and output values validated every time the service runs. If you want to validate the input
and output values every time the service runs, specify validation via the Input/Output tab.
For example, if your service requires certain input to exist or fall within a specified range
of values, you might want the pipeline validated every time the service runs.
If the input and/or output values do not need to be validated every time the service
executes, set up validation via the INVOKE step properties. Specifying input/output
validation via the INVOKE step properties allows you to decide on a case‐by‐case basis
whether you want validation performed.
Note: If you specify input/output validation via the INVOKE step, and an input or output
value is invalid, the service itself does not actually fail. The validation engine validates
input values before SAP BC Server executes the service. If the service input is not valid,
the INVOKE flow step for the service fails. Similarly, the validation engine validates
output values after SAP BC Server executes the service. If the service output is not valid,
the INVOKE flow step for the service fails. Whether or not the entire flow service fails
when an individual flow step fails depends on the exit conditions for the service. For
information about specifying exit conditions, see “Using SEQUENCE to Specify an Exit
Condition” on page 125.
1 In the Service Browser, select the service for which you want to validate input and/or
output every time the service is invoked.
2 Click the Input/Output tab.
3 If you want the input of the service validated every time the service executes, select
the Validate input check box.
4 If you want the output of the service validated every time the service executes, select
the Validate output check box.
5 Click on the Service Browser toolbar to save your changes
1 In the Flow Editor, select the service for which you want SAP BC Server to validate
input and/or output values.
2 Click the Properties tab.
3 If you want to validate input to the service, in the validate-in list, select $default.
4 If you want to validate the output of the service, in the validate-out list, select $default.
5 Click on the Service Browser toolbar to save your changes
Inputs to the
invoked service
will be validated.
Outputs of the
service will not be
validated.
Important! Keep in mind that the validate-in and validate-out properties are independent of
any validation settings that you might have already set in the service that you are
invoking. If the Validate input and/or Validate output check boxes are selected in the
Input/Output tab of the service being invoked, then input/output validation is being
performed each time the service is invoked. Specifying input/output validation via the
INVOKE step as well will duplicate validation and possibly slow down the execution of
the service.
validated against. This service returns a string that indicates whether validation was
successful and an IData array that contains any validation errors. When you insert the
pub.schema:validate service into a flow service, you can specify the maximum number of
errors to be collected by the service. You can also specify whether the pub.schema:validate
service should fail if the record or node variable is invalid.
1 In the Service Browser, select the flow service in which you want to validate a Record
or node.
2 Click and select Browse.
3 Use the list next to Folder to navigate to and select the pub.schema:validate service.
4 In the Flow Editor, move the validatePipeline service to the point in the flow where you
want to validate the record or node.
5 Click the Pipeline tab.
6 Map the variable that you want validated in Pipeline In to object in Service In.
7 Under Service In, select conformsTo and click .
8 In the Input for dialog box, do one of the following:
— If you are validating a record variable, type the fully qualified name of the record
that you want to validate the variable against. For example:
folderName:recordName. Click OK.
— If you are validating a node (Document), type the fully qualified name of the SAP
BC schema that you want to validate the node variable against. For example:
folderName:schemaName. Click OK.
Note: The nominated SAP BC schema is only used to validate unqualified nodes, i.e.,
nodes with XML Namespaces URI = null.
9 Assign values to the remaining Service In variables, using the following table. All of
these variables are optional.
10 Click on the Service Browser toolbar to save your changes to the flow service.
For more information about the validation built‐in services, see the SAP BC Built‐In
Services Guide.
Note: If you want to validate String, String List, or String Table variables in the pipeline,
use the pub.schema:validatePipeline. Define a record that contains the variables you want to
validate and apply constraints to the variables. Then use this record as the blueprint for
the pub.schema:validatePipeline service. Only the variables in the record will be validated. The
validation engine ignores other variables that exist in the pipeline at run time. (The record
implicitly allows unspecified variables to exist at run time.)
Validation Exceptions
If you use the pub.schema:validate and pub.schema:validatePipeline services to perform data
validation, you can determine whether the service should succeed or fail if the data being
validated is invalid. You might want to a service to succeed even if the data is invalid. In
the pub.schema:validate and pub.schema:validatePipeline services, the value of the failIfInvalid
input variable determines whether a service fails because of an invalid object.
If the pub.schema:validate and pub.schema:validatePipeline service fails, SAP BC Server throws a
validation exception. A validation exception is generated if one of the following is true:
Errors are detected in the object (XML document, pipeline, or Record) that is passed
(e.g., null value)
The basic validation contract is violated (e.g., a binary tree is passed instead of a
record as expected)
You specify that the service should fail if the object to be validated (XML document,
pipeline, or record) did not conform to the SAP BC schema or record (e.g., failIfInvalid
= true). If this is the reason for the exception, SAP BC Server inserts the validation
errors into the exception message
1 Start SAP BC Server and open the Server Administrator.
2 In the Settings menu of the navigation area, click Extended.
3 Click Edit Extended Settings. The server displays the Extended Settings screen.
4 In the text area under Extended Settings, type
watt.core.schema.maxOccursThresholdValue=value where value is the number
you want to use as the maxOccurs threshold.
5 Click Save Changes.
Basic Concepts
In SAP BC Developer, you can resolve relationships between SAP BC elements as part of
your debugging and collaborative development processes. For example, before you
rename a record, you may want to make sure that you do not destroy any references to
that record in any other services, records, or specifications.
Before you use the procedures in this chapter, you may want to familiarize yourself with
the following concepts.
Services, specifications,
records, and SAP BC schemas
are SAP BC elements.
What Is a Dependent?
In Developer, a dependent is an SAP BC element that uses a selected SAP BC element. For
example, suppose that the flow service ServiceA invokes the built‐in service
pub.web:loadDocument. The ServiceA uses the pub.web:loadDocument service; therefore, flow
ServiceA is a dependent of pub.web:loadDocument.
This services is a
dependent of...
...each of these
services.
What Is a Reference?
In Developer, a reference is an SAP BC element that is used by a selected SAP BC element.
For example, suppose that the flow service ServiceA invokes the services
pub.web:loadDocument, ProcessPO and SubmitPO, and declares a Record Reference to PORecord
as part of its input signature. The services pub.web:loadDocument, ProcessPO and SubmitPO,
and the record reference PORecord are used by ServiceA; therefore, they are references of
ServiceA.
Pipeline Reference
This variable is a
reference to the
PORecord in the
Service Browser.
Test
but not
Test OR Test1
All SAP BC elements starting with “PO” ^PO
All SAP BC elements ending with “PO” PO$
All services with the exact name of “logPO” :logPO$
All SAP BC elements containing “log” followed by any two log..
characters (wildcards)
3 If you want to limit the scope of the search to a specific package, select the package in
the Package list.
4 Click Find. The Find In Service Browser dialog box displays the results of the search.
...the names of 17
elements in the
Service Browser. All
of these elements
contain “log” in their
fully qualified name.
5 To jump to an element in the Service Browser, select that element in the results and
click Go To.
Finding Dependents
In Developer, a dependent is an SAP BC element that uses a selected SAP BC element. For
example, suppose that the flow service ServiceA invokes the flow service
Purchasing:SubmitPO. The ServiceA uses the Purchasing:SubmitPO service; therefore, ServiceA is a
dependent of Purchasing:SubmitPO. If you delete Purchasing:SubmitPO from the Service Browser,
ServiceA will not run.
During debugging, you might want to locate all of the dependents of a given service or
record. Use the Find Dependents command to find all the dependents.
The following are not considered dependents:
A variable with a content type constraint that references a simple type in an SAP BC
schema. If, for example, an SAP BC schema contains the simple type sku and you
select sku as the content type constraint for a variable, the SAP BC schema is not a
dependent of the variable (or vice versa).
Java or WebTap services that invoke other services. For example, if Java service A
invokes service B, then A will not appear as a dependent of B.
1 In the Service Browser, select the element for which you want to find dependents.
2 On the Edit menu, click Find, and then click Dependents.
The Find Dependents dialog box displays the dependents of the SAP BC element. The
results do not include SAP BC schemas or Java services.
The PO:logPO
service is used by...
...these SAP BC
elements.
3 After Developer finds the dependents of the selected SAP BC element, you may do
any of the following:
— To jump to an element in the Service Browser, select that element in the results,
and click GoTo.
— To see all child dependents of a found dependent, click next to the item in the
results list.
— To limit the scope of the search to a specific package, select the package in the
Package list. Click Find.
Cancel the operation.
1 On the Edit menu, click Preferences.
2 On the General tab, under Service Browser, select the Check dependency when
renaming/moving check box.
3 Click OK.
For more information about enabling safeguards for renaming, deleting, or moving an
element, see “Renaming and Deleting Elements” on page 37.
Important! You cannot use the Undo command after renaming an item.
Finding References
In Developer, a reference is an SAP BC element that is used by a selected SAP BC element.
For example, suppose that the flow service ServiceA invokes the flow services ProcessPO
and SubmitPO, and declares a Record Reference to PORecord as part of its input signature.
The flow services ProcessPO and SubmitPO, and record reference PORecord are used by
ServiceA; therefore, they are references of ServiceA.
During debugging of a complex flow service, you might want to locate all of the services,
records, and specifications used by the flow service. Use the Find References command to
locate the references.
The following are not considered references:
A variable with a content type constraint that references a simple type in an SAP BC
schema. If, for example, an SAP BC schema contains the simple type sku and you
select sku as the content type constraint for a variable, the SAP BC schema is not a
reference of the variable (or vice versa).
Java or WebTap service invocations. For example, if Java service A invokes service B,
then B will not appear as a reference of A.
Note: When you find references, you search across all packages on SAP BC Server. You
cannot limit your search to a specific package.
1 In the Service Browser, select the element for which you want to find references.
2 On the Edit menu, click Find, and then click References.
The Find References dialog box displays the references of the SAP BC element. The
results do not include Java services, C services, or SAP BC schemas.
The PO:sendPO
service uses...
...these SAP BC
elements. The
element in bold
italics does not exist
in the Service
Browser.
Unresolved references are indicated in bold italics. An unresolved reference is an
element that does not exist in the Service Browser, yet it is still referred to in the
service, record, or specification that you selected. The element might have been
renamed, moved, or deleted. To prevent unresolved references, enable the renaming
and deleting safeguards on the General tab of the Preferences dialog box. For more
information, see “Renaming and Deleting Elements” on page 37.
3 After Developer finds the references of the selected SAP BC element, you may do any
of the following:
— To jump to an element in the Service Browser, select that element in the results,
and click Go To.
— To see all child references of a found reference, click next to the item in the
results list.
1 In the Service Browser, select the flow service or record for which you want to find
invalid pipeline references.
2 On the Edit menu, click Inspect Pipeline References.
The Inspect Pipeline References dialog box displays all invalid pipeline references for
the selected service or record.
— If you inspected a flow service, the search results contain all of the records that
have invalid pipeline references in that flow.
— If you inspected a record, the search results contain all of the flow services that
have invalid pipeline references to that record.
The PO:processPO
flow service
contains...
3 After Developer finds the pipeline references of the selected SAP BC element, you
may do any of the following:
— To jump to an element in the Service Browser, select that element in the results,
and click GoTo.
— To jump to the unresolved reference in the pipeline, select the element in the
results, and click Find in Flow.
— If the selected element has multiple unresolved references in the same flow
service, you can use the Find Next command to automatically jump to the next
reference within the selected element. To use the Find Next command, keep the
Inspect Pipeline References dialog box open. Then select Edit Find Next or press
CTRL+F3.
— If the selected element is a record reference and you want to limit the scope of the
search to a specific package, select the package in the Package list. Click Inspect.
Examine the call stack and the pipeline when an error occurs.
Execute services in “debug” mode, a mode that lets you monitor a flow service’s
execution path and/or execute its steps one at a time.
Temporarily disable steps in a flow and/or specify points where you want to halt
execution.
Additionally, SAP provides tools for collecting run‐time information that can help debug
a service. These include tools to:
Write arbitrary messages to the server log.
Trace the pipeline at run time.
Modify and save the contents of the pipeline at a specified point.
Testing Services
You can test any type of service—flow services or coded services—with Developer,
eliminating the need to build special clients simply for testing. It also allows you to easily
pass different sets of test data to your service, which makes it easy to test your service
under a variety of data conditions.
You can use Developer to test services in two ways:
From Developer. With this technique, Developer is the client—that is, it invokes the
service and receives the results.
–OR–
From a browser. With this technique, Developer formulates the URL necessary to
invoke the service and passes that URL to your browser. Your browser actually
invokes the service and receives the results. When you develop services for browser‐
based clients—especially ones whose output will be formatted using output
templates—you will want to test those services at least once using this technique.
...and complex
Records and
Record Lists.
You can manually type your input values into the Input dialog box or, if you saved the
input values from an earlier test, you can load them from a file.
Note: If your service takes variables that are not string‐based (Objects), you will not be able
to enter those values in the Input dialog box (such values do not even appear in the Input
dialog box). To test this type of service, you must also create a service that generates input
values for your service. Then you need to construct a test harness—a flow service that
executes both the service that produces the test data and the service you want to test—and
use that harness to test your service.
1 Open the service and execute it as described in “Testing Services from Developer” on
page 249 or “Testing Services from a Browser” on page 257.
2 For each variable listed in the Input dialog box, type an input value. If the service takes
complex variables such as a String Lists, Records, or Record Lists, use the following
buttons to specify the variableʹs individual elements.
Insert a blank row above the currently selected row.
Add a column to the variable.
Delete the selected row from the variable.
Delete the selected column from the variable.
Note: You might want to consider creating an input file for each set of data that you
routinely test your service against. This will provide you with a ready‐made set of test
cases against which to verify the service when it is modified by you or other
developers in the future. Many sites establish a special directory on their
development server just for holding sets of test data that they generate in this manner.
1 Open the service and execute it as described in “Testing Services from Developer” on
page 249 or “Testing Services from a Browser” on page 257.
2 Enter input values into the Input dialog box as described in “Entering Input for a
Service” on page 250.
3 When you are finished entering values, click Save.
4 In the Save File dialog box, specify the name of the file to which you want the values
saved.
Variables that exist in the Input dialog box, but not in the file are set to null.
Besides loading values that were saved from the Input dialog box, you can also load
values that were saved using pub.flow:savePipelineToFile or the Save Pipeline commands
on the Results tab. In addition, you can change values in the pipeline during testing.
For information about saving the state of the pipeline, see “Saving and Restoring the
Pipeline” on page 275. For information about modifying values in the pipeline, see
“Modifying the Current Pipeline” on page 274.
1 Open the service and execute it as described in “Testing Services from Developer” on
page 249.
2 When the Input dialog box appears, click Load. The Load File dialog box appears.
3 Select the file containing the input values that you want to load.
Results from a service you run in Developer are displayed on the Results tab
To examine the
contents of a
variable, select it in
the top pane...
The upper half of the Results tab displays all the variables in the pipeline. To view the
contents of a particular variable, you select the variable in the upper half. Its contents are
shown in the lower half.
When viewing the Results tab, keep the following points in mind:
The Results tab represents the contents of the pipeline.
The Results tab shows all variables placed in the pipeline by the service, not just those
that were declared in the service’s input/output parameters.
Variables that a service explicitly drops from the pipeline do not appear on the Results
tab.
You can browse the contents of the Results tab, but you cannot edit it directly.
You can save the contents of the Results tab to a file and use that file to restore the
pipeline at a later point. For additional information about saving and restoring the
contents of the Results tab, see “Saving and Restoring the Pipeline” on page 275.
If you run a service and an error occurs, results are not displayed in the Results tab.
However, you can click the Details button in the error message box to examine the
state of the pipeline at the point where the exception occurred.
When debugging a flow service in step mode, you can use the Results tab to examine
the state of the pipeline after each flow step. You can optionally load a different
pipeline or modify the existing pipeline between steps. For information about loading
a pipeline in the Results tab, see “Saving and Restoring the Pipeline” on page 275. For
information about modifying an existing pipeline, see “Modifying the Current
Pipeline” on page 274.
When you use a breakpoint or the Trace to Here command to halt execution of a flow
service, you can use the Results tab to examine the pipeline at that point where you
halted the flow. You may also optionally load a different pipeline or modify the
existing pipeline at this point. For information about loading a pipeline in the Results
tab, see “Saving and Restoring the Pipeline” on page 275. For information about
modifying an existing pipeline, see “Modifying the Current Pipeline” on page 274.
Variables whose object types are not directly supported by the Developer will appear
in the Results tab, but because Developer cannot render the values of such objects, a
value does not appear in the Values column. Instead, the Values column displays the
object’s Java class message.
Variables that contain com.wm.util.Table objects appear as Record Lists in the Results tab.
1 Display the Results tab and select the element that you want to copy. (When copying
elements from the lower half, you can select a group of contiguous elements by
pressing the SHIFT key and selecting the first and last element in the group that you
want to copy.)
2 Select the Copy command from the Edit menu or right‐click and select Copy.
3 Select the field into which you want to paste the information, then select the Paste
command from the Edit menu or right‐click and select Paste. (If the Paste command is
not available, it indicates that the information cannot be pasted into the selected field.)
Run-Time Exceptions
If a service that you run from Developer throws an exception, Developer reports the error
in the following message box:
You can click the Details button to display the call stack and the pipeline at the point where
the error occurred.
The Details button shows the Call Stack and the Pipeline
Note: You can improve performance and memory usage in Developer by caching SAP BC
elements, such as services and schemas. For details, see “Caching Elements” on page 50.
Now let’s assume that CHILD_B is a flow service that calls three Java services: CHILD_B1,
CHILD_B2, and CHILD_B3. If CHILD_B3 throws an exception, the call stack will look like this:
Note that the call stack is LIFO‐based. That is, the top entry in the stack identifies the last
(i.e., most recent) service invoked. The bottom entry identifies the parent service—the one
that you originally invoked from Developer. If the parent itself throws the exception, it
will be the only entry in the call stack.
Note: Services invoked from within a Java service are not reported in the call stack, even if
they throw the exception.
If you are developing services that will be invoked by browser‐based clients, particularly
ones whose output will be formatted using output templates, you will want to test those
services using Run in Browser command to verify that they work as expected.
1 In the Service Browser, select the service that you want to run.
2 From the Test menu, select Run in Browser. If you have unsaved edits, Developer
prompts you to save them.
3 If the service has input parameters, type the input values for each variable in the Input
dialog box or click the Load button to retrieve the values from a file. If you need
procedures for this step, see “Entering Input for a Service” on page 250.
Note: Only Strings and String Lists are passed to the browser.
4 If you want to pass empty variables (variables that have no value) to the service, select
the Include Empty Values check box. When you select this option, empty Strings are
passed with a zero‐length value. If you do not select this option, Developer excludes
empty variables from the query string that it passes to the browser.
5 If you want to save the input values that you have entered, click Save. Input values
that you save can be recalled and reused in later tests. For additional information
about saving input values, see “Saving Input Values to a File” on page 251.
6 Click OK. Developer builds the URL to invoke the service with the inputs you have
specified, launches your browser, and passes it the URL.
— If the service executes successfully, its results appear in your browser. (If an
output template is assigned to the service, the template will be applied to the
results before they are returned.)
— If the service experiences an error, an error message is displayed in the browser.
1 In the Service Browser, select the service that you want to run.
2 From the Test menu, select Send XML File. If you have unsaved edits, Developer
prompts you to save them.
3 In the Select Test Mode dialog box, specify whether you want the service to run in Trace
mode or Step mode and click OK.
4 In the Open File dialog box, select the XML file that you want to submit to this service
and click OK. Developer submits the file to the server, which parses it into a node
object and passes it to selected service.
— If the service executes to completion, its results appear on the Results tab. For
more information about the Results tab, see “Viewing the Results of the Service”
on page 253.
— If the service experiences an error, an error message displays. Click Details in the
message box to view the call stack and the state of the pipeline where the error
occurred. For additional information about errors that occur while testing a
service, see “Run‐Time Exceptions” on page 255.
Command Description
Trace Executes flow steps one after another to the end of the service and
visually marks steps as they execute. For information about using
this command, see “Using the Trace Tools” on page 262.
Trace to Here Executes flow steps one after another up to a specified point and
visually marks steps as they execute. For information about using
this command, see “Using the Trace Tools” on page 262.
Trace Into Executes flow steps one after another to the end of the service and
visually marks steps as they execute, including steps in child
flows. For information about using this command, see “Tracing
into a Child Flow” on page 263.
Step Executes the next flow step and then halts. For information about
using this command, see “Using the Step Tools” on page 264.
Step Into Opens a child flow or a MAP step so that you can debug the
individual flow steps within it. For information about using this
command, see “Stepping though a Child Flow” on page 265 and
“Using the Step Tools with a MAP Step” on page 266.
Important! The debug commands are only available for flow services. When a Java service
is selected, these commands are not available.
When you first enter debug mode, processing always starts from the first step in the flow
service. Completed steps are marked with a gray outline. A step that is “in process” or is
the next in line to be processed is marked with a green outline. When you step though a
flow service or you halt execution using a breakpoint or the Trace to Here command, the
green outline indicates which step will execute when you resume processing.
The example below shows a flow service that is being executed using the Step command.
As you can see, the BRANCH on ‘PaymentType’ step has three targets. The gray outline shows
which path was executed. The green outline indicates that BRANCH on ‘/AuthorizationCode’ is
the step that will execute when the next Step command is performed.
Executing the Run command
Refreshing Developer’s session on the server
Editing the flow service or any other service
The service throws an exception
When a session is reset, trace lines are cleared and the point of execution is set back to the
top of the flow service.
The following actions do not reset a debugging session:
Setting breakpoints
Examining the contents of any of the other tabs associated with the service
Saving or restoring the contents of the Results tab
1 If the service is not already displayed in the Flow Editor, select it from the Service
Browser.
2 On the Test menu, click Trace.
— If the service is already in debug mode, Developer traces the remaining steps,
starting from the current point of execution (the step outlined in green.)
— If the service is not in debug mode, Developer starts the trace at the top of the
flow. If you have any unsaved changes, Developer prompts you to save those
changes before it starts the trace. If the service takes input, you will be prompted
for its input values.
1 If the service is not already displayed in the Flow Editor, select it from the Service
Browser.
2 In the Flow Editor, select the flow step up to which you want to trace. (Developer will
trace all steps up to, but not including, the one you select.)
Note: If the point to which you want to trace resides in a child of the service that you
are testing, you must use the breakpoint feature to trace to that point. For information
about setting breakpoints, see “Setting Breakpoints” on page 266.
3 Select Trace to Here from the Test menu.
— If the service is already in debug mode, Developer starts at the current point of
execution (the step outlined in green) and traces to the selected step. If the
selected step is before the current point of execution, the trace starts at the top of
the flow.
— If the service is not in debug mode, Developer starts the trace at the top of the
flow service and traces to the selected step. If you have any unsaved changes,
Developer prompts you to save those changes before it starts the trace. If the
service takes input, you will be prompted for its input values.
4 When Developer reaches the selected flow step, it halts. At this point, you may do any
of the following:
— Examine the contents of the Results tab.
— Modify, save, and/or restore the contents of the Results tab.
— Use Step or Step Into to execute subsequent flow steps one at a time.
— Select another step in the flow service and use Trace to Here to trace to that point.
— Select Trace to trace the remainder of the service.
— Select Reset to clear the debugging session and reset the starting execution point
to the top of the service.
1 If the parent service you want to test is not already displayed in the Flow Editor, select
it from the Service Browser.
2 On the Test menu, click Trace Into.
— If the service is already in debug mode, Developer starts the trace at the current
point of execution (the step outlined in green) and traces the service and its
children until it reaches a breakpoint or the end of the flow.
— If the service is not in debug mode, Developer starts the trace at the top of the
flow and traces the service and its children until it reaches a breakpoint or the end
of the flow. If you have any unsaved changes, Developer prompts you to save
those changes before it starts the trace. If the service takes input, you will be
prompted for its input values.
Note that at any point while stepping through a flow service, you can do any of the
following:
Examine the contents of the Results tab.
Modify, save, and/or restore the contents of the Results tab.
Select a step in the flow service and use Trace to Here to trace to that point.
Select Trace to trace the remainder of the service.
Select Reset to clear the debugging session and reset the starting execution point to the
top of the service.
1 If the service that you want to step through is not already displayed in the Flow
Editor, select it from the Service Browser.
2 Select Step from the Test menu.
— If the service is already in debug mode, Developer executes the current step (the
step outlined in green) and then stops.
— If the service is not in debug mode, Developer enters debug mode and selects the
first step in the flow service. To execute that flow step, select Step again. If you
have any unsaved changes, Developer prompts you to save those changes before
it enters debug mode. If the service takes input, you will be prompted for its input
values.
1 Select the parent flow service and step or trace to the flow step that invokes the child
flow. See “To step through a flow service” on page 265 or “To trace to a specified
point” on page 263 if you need procedures for this step.
2 Select Step Into from the Test menu. Developer opens the child flow service and selects
(but does not execute) the first step.
3 Select Step from the Test menu to execute the first step in the child service. Repeat this
step for each flow step that you want to individually execute within the child.
4 If you want to return to the parent flow service without stepping through the entire
child, select Step Out from the Test menu. This command will trace the remaining steps
in the child flow, return to the parent, and then select, but not execute the next step in
the parent flow.
Notes:
— While you are debugging the child, you may use Trace to Here or set a breakpoint
to execute up to particular point in the child.
— If you select Trace or Trace Into while you are debugging the child, Developer
traces the remaining steps in the child and returns to the parent automatically.
— If you select Step on the last step in the child flow service, Developer
automatically returns you to the parent.
— You can use Step Into to step into a child flow that is nested within a child that you
have stepped into.
— If you select Step Into on a step that is not a flow service, Step is executed.
1 Select the parent service that contains the MAP step and then step or trace to the MAP
step. (i.e., make the MAP step the current flow step. It must have the green outline.)
See “To step through a flow service” on page 265 or “To trace to a specified point” on
page 263 if you need procedures for this step.
2 Select Step Into from the Test menu. Developer drops into the Pipeline Editor and
selects (but does not execute) the first transformer in the MAP step.
3 Select Step from the Test menu to execute the first transformer. Repeat this step for
each transformer that you want to individually execute within the MAP step.
4 If you want to return to the parent without stepping through the entire MAP, select
Step Out from the Test menu. This traces the remaining transformers in the MAP,
returns to the parent, and selects, but does not execute the next step in the parent
flow.
Notes:
— If you select Trace or Trace Into while you are debugging the MAP, Developer
traces the remaining steps in the MAP and returns to the parent automatically.
— If you select Step on the last transformer in the MAP, Developer automatically
executes that transformer and returns you to the parent flow.
— You can use Step Into to step into a transformer that is a flow service.
— If you select Step Into on a transformer that is not a flow service, Step is executed.
Setting Breakpoints
A breakpoint is a point in a flow service where you want processing to halt when you
execute that flow service with certain debug modes. Breakpoints can help you isolate a
section of code or examine data values at a particular point in the execution path. For
example, you might want to set a pair of breakpoints before and after a particular segment
of a flow so that you can examine the pipeline (the Results tab) before and after that
segment executes.
When working with breakpoints, keep the following points in mind:
Breakpoints are not persistent. They exist only during the life of the Developer session
on the current server in which you set them. When you close Developer or refresh the
session on the current server, your breakpoints are cleared. (Note that resetting debug
mode does not clear your breakpoints.)
Breakpoints are also local to your Developer session on the current server. Breakpoints
that you set on your machine do not affect other developers or users who might be
executing or debugging services in which you have set breakpoints.
Breakpoints are only recognized when you execute a service with the Trace Into
command from Developer. If you execute a service using any of the other testing or
debugging commands, breakpoints are ignored.
If you are caching services using the Caching tab in Preferences, and your flow service
has a breakpoint, you cannot clear the cache of the flow service until the breakpoint is
removed. For more information about caching, see “Configuring a Service’s Use of
Cache” on page 88.
1 In the Service Browser, select the flow service in which you want to set a breakpoint.
2 In the Flow Editor, select the step that will function as the breakpoint. (During
debugging, processing will halt immediately before this step).
3 From the Test menu, select Set Breakpoint. The step’s icon turns red, indicating that it is
a breakpoint.
1 In the Service Browser, select the flow service in which you want to clear a breakpoint.
2 In the Flow Editor, select the breakpoint step.
Note: Transformers in a MAP step execute in an arbitrary order—you cannot assume an
order of execution. Consequently, some of the transformers in the MAP step might
execute before Developer reaches the breakpoint—even if the transformers appear below
the breakpoint in the Pipeline Editor. Likewise, transformers above the breakpoint might
not execute before the breakpoint is encountered. (These will execute when you resume
tracing.) Executed transformers have a gray outline.
1 In the Service Browser, select the flow service in which you want to set a breakpoint.
2 In the Flow Editor, select the MAP step containing the transformer that will function
as the breakpoint.
3 In the Pipeline Editor, select the transformer that will function as the breakpoint.
(During debugging, processing will halt immediately before this transformer.)
1 In the Service Browser, select the flow service in which you want to clear a breakpoint.
2 In the Flow Editor, select the MAP step that contains the transformer from which you
want to clear a breakpoint.
3 In the Pipeline Editor, select the transformer from which you want to clear a
breakpoint.
1 Click on the toolbar or select Breakpoints from the Test menu.
2 If you want to go to a specific breakpoint, select it and then click Go to Breakpoint.
3 If you want to clear a breakpoint, select it and then click Remove.
Note: Remember, breakpoints are not persistent. They only exist during the Developer
session on the current server in which you set them. When you refresh or close your
session on the current server, your breakpoints are cleared.
Disabling a step is useful in many testing and debugging situations. For example, you
might want to disable one or more steps to isolate a particular segment of a flow, similar
to the way you might “comment out” a section of source code in a program you are
testing.
Be aware that disabling a step sets a persistent attribute that is saved in the flow service.
Once you disable a step, it remains disabled until you explicitly re‐enable it with
Developer.
Important! The run‐time effect of disabling a step is the same as deleting it. Disabling a key
step or forgetting to re‐enable a disabled step can break the logic of a service and/or cause
the service to fail. Developer allows you to disable any step in a flow service, but it is your
responsibility to use this feature carefully.
1 In the Service Browser, select the flow service that you want to edit.
2 In the Flow Editor, select the step that you want to disable.
3 Select Disable Step from the Compose menu.
–OR–
Right‐click the step, and select Disable Step.
The step dims, indicating that it is disabled.
1 In the Service Browser, select the flow service that you want to edit.
2 In the Flow Editor, select the disabled step that you want to re‐enable.
3 Select Enable Step from the Compose menu.
–OR–
Right‐click the step, and select Enable Step.
The step dims, indicating that it is disabled.
Disabling Transformers
You can also use the Compose Disable Step command to disable a transformer in a MAP
step. Transformers that you disable are not executed at run time. In fact, SAP BC Server
does not execute any of the maps between pipeline variables and the variables for a
disabled transformer.
Disabled transformers appear dimmed when viewed in Developer.
Note: When you disable the MAP step, Developer automatically disables all of the
transformers in a MAP step
Important! The run‐time effect of disabling a transformer is the same as deleting it.
Disabling a transformer or forgetting to re‐enable a disabled transformer can break the
logic of a service and/or cause the service to fail. Developer allows you to disable any
transformer or step in a flow service, but it is your responsibility to use this feature
carefully.
1 In the Service Browser, select the flow service that you want to edit.
2 In the Flow Editor, select the MAP step containing the transformer that you want to
disable.
3 On the Pipeline tab, select the transformer you want to disable.
4 Select Disable Step from the Compose menu.
–OR–
Right‐click the step, and select Disable Step.
The transformer dims, indicating that it is disabled.
1 In the Service Browser, select the flow service that you want to edit.
2 In the Flow Editor, select the MAP step containing the disabled transformer that you
want to enable.
3 On the Pipeline tab, select the disabled transformer that you want to enable.
4 Select Enable Step from the Compose menu.
–OR–
Right‐click the step, and select Enable Step.
1 In the Service Browser, select the flow service that you want to edit.
2 In the Flow Editor, select the INVOKE or MAP step that contains the link with the
condition you want to disable.
3 On the Pipeline tab, select the link with the condition that you want to disable.
4 Right‐click the link that connects the variables, and select Properties.
5 In the Link Properties dialog box, click the General tab, and clear the Copy only if check
box. Developer dims the field containing the conditional expression.
6 Click OK.
1 In the Service Browser, select the flow service that you want to edit.
2 In the Flow Editor, select the INVOKE or MAP step containing the link with the
condition you want to enable.
3 On the Pipeline tab, select the link with the condition that you want to enable.
4 Right‐click the link that connects the variables, and select Properties.
5 In the Link Properties dialog box, click the General tab, and select the Copy only if check
box. Developer enables the condition.
6 Click OK.
You can manually save the contents of the Results tab when you run or debug a
service using Developer.
You can programmatically save the pipeline at run time by invoking
pub.flow:savePipelineToFile at the point where you want to capture the pipeline.
When you save a pipeline, it is saved in a file in XML format. The file you create can be
used to:
Manually load the pipeline into Developer’s Results tab.
Dynamically load the pipeline at run time using the pub.flow:restorePipelineFromFile
service.
Load a set of input values into the Input dialog box when testing a service with
Developer.
You can view a pipeline file with an ordinary text editor. When saving the pipeline, keep
the following points in mind:
Only XML‐codable variables are saved. This includes, Strings, String Lists, String
Tables, Records, and Record Lists. Variables that are not XML‐codable are not saved.
Empty variables and null variables are saved.
1 Display the Results tab and click anywhere in the top area of the tab.
2 Select the Save Pipeline command from the File menu and select one of the following
commands:
Note: If you intend to use the pipeline file to dynamically
restore the pipeline using pub.flow:restorePipelineFromFile, use
Save Pipeline to Server to save the file to the server (see
below).
Tip! You can also select these commands from the right‐click menu on the Results tab.
3 Depending on your action in the previous step, do one of the following:
Key Description
filename A string that specifies the name of the file to which you want
the file saved. If you do not specify a fully qualified path, the
file is saved relative to <sapbc>\server\pipeline.
4 Save the service. (If you are using your own IDE, you will need to recompile the
service, reregister it on SAP BC Server, and reload its package.)
5 Execute the service.
For additional information about pub.flow:savePipelineToFile, see the SAP BC Built‐In Services
Guide.
With the pub.flow:savePipelineToFile service at run time.
From the Input dialog box when you are testing a service with Developer.
Restoring a pipeline is useful when you simply want to inspect the values in a particular
pipeline file (perhaps one that contains the pipeline from a failed service). Additionally, it
is useful in many testing situations. For example, you can use it to replace the existing
pipeline with a different set of values when stepping though a flow service with the
debugging tools.
There are two ways to restore the contents of the pipeline:
You can manually load the saved pipeline into the Results tab in Developer.
You can programmatically load a saved pipeline at run time by invoking
pub.flow:restorePipelineFromFile at the point where you want to modify the pipeline.
1 Display the Results tab. (If you simply want to inspect a saved pipeline, create a new,
empty flow service and display its Results tab.)
2 Select the Load command from the File menu and select one of the following:
Select... To...
Load Pipeline Locally Load a pipeline file from your local file system.
Load Pipeline from Server Load a file that resides in the default pipeline directory
on SAP BC Server.
Tip! You can also select these commands from the right‐click menu on the Results tab.
3 Depending on your action in the previous step, do one of the following:
Key Description
filename A String that specifies the name of the pipeline file. If you do
not specify a fully qualified path, the file is assumed to be
relative to <sapbc>\server\pipeline. For example, if you set
filename to “badPipeline.xml”, restorePipelineFromFile expects to
find that file in <sapbc>\server\pipeline\badPipeline.xml.
merge A String that specifies whether you want the contents of the
file to replace or be merged with the existing pipeline.
Set merge to... To...
false Replace the existing pipeline with the one
from the file.
true Merge the contents of the file into the existing
pipeline.
4 Save the service. (If you are using your own IDE, you will need to recompile the
service, reregister it on SAP BC Server, and reload its package.)
5 Execute the service.
For additional information about pub.flow:restorePipelineFromFile, see the SAP BC Built‐In
Services Guide.
debugging. For information about writing information to the log file, see “Writing
Information to server.log” on page 281.
If you do not explicitly set the debug switch when you start the server, the default value
specified in the watt.debug.level parameter is used. SAP ships the server with
watt.debug.level set at 4.
Once you start the server, the debug level is set. Once the server is running, you can
change the debug level using the Server Administrator. If you do not know the debug
level under which your SAP BC Server operates, see your SAP BC Server administrator.’
Important! Debug levels above 6 produce lots of detail and can generate an extremely large
log file very quickly. You should not run your server at this level except for brief periods
when you are attempting to troubleshoot a particular issue. You may also optionally
redirect server.log messages to the console instead of a file using the –log none start‐up
switch. For more information about this switch and debug levels, see “Starting the SAP
BC Server” in the SAP BC Administration Guide
Dump the contents of the entire pipeline to the log using pub.flow:tracePipeline.
To use pub.flow:debugLog, take the following general steps:
1 Invoke pub.flow:debugLog at the point where you want the service to write a message to
the server log.
2 Set the following parameters:
Key Description
message A String that specifies the message that you want written to
server.log. This can be a literal string that you assign to message,
however, for debugging purposes, it is often useful to map this
parameter to a pipeline variable whose run‐time value you want to
capture.
Key Description
function Optional. A String that identifies your service. The String you
specify will appear in the second column of the message that
debugLog writes to server.log. The purpose of this label is to identify
which component posted the message to the log.
If you do not assign a value to function, debugLog uses the string
“‐‐‐‐‐‐” as the label. However, keep in mind that assigning a value
to function will make it easier for you to locate your service’s
message when you examine the log file. Although you can assign a
text string of any length to function, only the first 6 characters
appear in the log.
level Optional. A String containing a value from 1 to 10, specifying the
debug levels under which this message is to be posted to the log. If
the server is running at a debug level lower than the value set in
level, the message is not put into the log file.
If you do not specify level, 1 is assumed, which means that the
message is posted to the log file regardless of which debug level
the server is running at. For more information about debug level,
see “Server Debug Levels” on page 281.
3 Save the service. (If you are using your own IDE, you will need to recompile the
service, reregister it on SAP BC Server, and reload its package.)
4 Execute the service.
For additional information about pub.flow:debugLog, see the SAP BC Built‐In Services Guide.
To use pub.flow:tracePipeline, take the following general steps:
1 Invoke pub.flow:tracePipeline at the point where you want the service to dump a copy of
the pipeline to the server log.
2 Set the following parameters:
Key Description
level Optional. A String containing a value from 1 to 10, specifying the
debug levels under which the pipeline will be posted to the log. If
the server is running at a debug level lower than the value set in
level, the pipeline is not written to the log file.
If you do not specify level, 4 is assumed, which means that the
pipeline will not be dumped to the log file unless the server is
running at debug level 4 or higher. For more information about
debug level, see “Server Debug Levels” on page 281.
3 Save the service. (If you are using your own IDE, you will need to recompile the
service, reregister it on SAP BC Server, and reload its package.)
4 Execute the service.
For additional information about pub.flow:tracePipeline, see the SAP BC Built‐In Services
Guide.
Basic Concepts
In addition to using the built‐in services that SAP provides, you can create customized
services in a variety of program languages. This allows you to create a library of custom
code that can be accessed and executed from a flow service or from a client application.
This chapter describes how to create your own services using Java, C/C++, and Visual
Basic.
Important! Java is the native language for services. When you create services in other
languages, you must wrap them to appear as a Java class to SAP BC Server.
When a service is invoked, SAP BC Server passes the IData object to it. The service
extracts the actual input values it needs from the elements within the IData object. For
example:
public final static void myservice (IData pipeline)
throws ServiceException
{
IDataCursor myCursor = pipeline.getCursor();
myCursor.first( "inputValue1" );
String myVariable = (String) myCursor.getValue();
myCursor.destroy();
.
.
return;
}
If you use the utility class IDataUtil, the coding you don’t have to deal with the cursor
directly. Sometimes this might be useful and the coding above would look as follows,
with the slightly different semantcis that it makes sure that a key in the pipeline remains
unique, when adding new values:
public final static void myservice (IData pipeline)
throws ServiceException
{
IDataCursor myCursor = pipeline.getCursor();
A service returns output by inserting it into an IData object. Any information that is
produced by the service and must be returned to the calling program, needs to be written
to the IData object. For example:
public final static void myservice (IData pipeline)
throws ServiceException
{
IDataCursor myCursor = pipeline.getCursor();
myCursor.first( "inputValue1" );
String myVariable = (String) myCursor.getValue();
.
.
myCursor.last();
myCursor.insertAfter( "outputValue1", myOutputVariable );
myCursor.destroy();
return;
}
After you position the cursor on the element with which you want to work, you can use
the getValue or setValue methods to read or write the value of that element, respectively.
These classes also provide methods for inserting new elements, getting key names, and
deleting elements.
For more information about using the cursor classes, see the data package in the SAP BC
Java API Reference at <sapbc>/developer/doc/api/index.html.
myCursor.last();
myCursor.insertAfter("VA", new Double("0.045"));
myCursor.insertAfter("MD", new Double("0.05"));
myCursor.insertAfter("DE", new Double("0.0"));
}
For more information about using the IDataFactory class, see the data package in the SAP
BC Java API Reference at : <sapbc>/developer/doc/api/index.html.
The folder name represents the fully qualified Java class name. As of Business
Connecector 4.8 the class name itself can be prefixed with ‘JSBC_’. This avoids name
clashes of classes with Java packages if you have another nested folder that contains
Java Services as well.
Since Java class names cannot contain the “.” character, services that reside in nested
folders are implemented in a class that is scoped within a Java package. For example, a
service named recording.accounts:createAccount is made up of a Java method called
createAccount in a Java class called accounts within the recording package. In case of a prefixed
class name the class name would be .JSBCaccounts.
All Java services that reside in the same folder are methods of the same class.
When you build a Java service with Developer, it automatically combines your service
into the class file associated with the folder in which you created it. However, if you build
a Java service in your own IDE, you will need to add the class file to the server yourself.
And, if you want that service to be recognized by Developer, you must insert special
comment code in your source code.
Before you create a Java service, you must:
Make sure the package in which you want to create the service already exists. If the package
does not already exist, use Developer or the Server Administrator to create it. See
online help for step‐by‐step procedures.
Make sure the folder in which you want to create the service already exists. If the folder does
not already exist, use Developer to create it. See Developer’s online help for step‐by‐
step procedures.
Make sure that all Java, C, and WebTap services are unlocked or locked by you in the folder in
which you want to create the new service. For details, see the SAP BC Cooperative
Development Guide
Important! All Java services that belong to the same folder reside in the same Java class file.
This class has the same name as the folder.
Developer
automatically
generates required
code for you.
The required code at the top of the Source tab defines a static and final method with a
single input parameter–an IData object. The block of required code at the bottom returns
the pipeline to the caller.
When you build a Java service, you type (or paste) your code in the text box on the Source
tab. The following example shows a service that gets two values from the pipeline and
uses them to compute a sales tax. It puts the computed tax into the pipeline.
You use the Source tab to write the body of your service
You use the Shared tab to specify the common attributes of the class
The Extends field allows you to specify a super class for the implementation. You are not
required to specify a super class.
Note: It is useful, but not necessary, to extend the class com.wm.app.b2b.server.Service.
This class includes static methods for various common tasks, like retrieving the current
session ID and formatting error messages.
The Implements field specifies the names of Java interfaces that you want to implement in
the extended class.
The Import field specifies the names of additional Java packages whose classes are
available to the current class. When you create a Java service with Developer, several Java
packages are automatically added to the import list.
The Source field allows you to define global variables and methods that are shared by all
services in the current folder. This is useful for building shared data structures and
supporting functions that are not intended to be exposed as services. For example, you
might use the Source field to define an account table and the methods to used to access it
for a set of services that create, get, and delete account information.
Note: Because services are implemented as static methods, most shared code is usually
static as well.
1 On the File menu, click New.
2 Select Java Service and click Next.
3 In the New Java Service dialog box, next to Folder, select the folder into which you want
to save this service.
4 In the Name field, type a name for the service.
5 Click Finish.
6 If you know the set of inputs and outputs your program uses, specify these using the
Input/Output tab.
Note: You can use Developer to automatically generate Java code that gets and puts
those input and output values in the pipeline. For more information about
automatically generating Java code, see “Generating Java Code from Service Input
and Output Parameters” on page 296.
7 Type the code for your service on the Source tab. For information about Java classes
provided by SAP, see the SAP BC Java API Reference in
<sapbc>/developer/doc/api/index.html.
8 If you want to make additional methods and/or structures available to the service,
complete the following fields on the Shared tab.
1 Click to add a new row to the list.
2 Type the name of a valid Java class name (fully qualified if
necessary). You do not need to type the “implements”
keyword.
1 Click to add a new row to the list.
2 Type the name of a valid Java class name (e.g.
com.wm.util.Table) or a package import specification (e.g.
java.util.*). You do not need to type the “import” keyword.
Source Data structures, methods, and other Java code that you want to
make available to all services in this folder.
9 When you finish specifying your code on the Source and Shared tabs, click on the
toolbar to save and compile the service.
Developer will generate the following Java code for your service:
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
pipelineCursor.first( "State" );
StringState = (String) pipelineCursor.getValue();
pipelineCursor.first( "Amount" );
StringAmount = (String) pipelineCursor.getValue();
pipelineCursor.destroy();
// pipeline
IDataCursor pipelineCursor_1 = pipeline.getCursor();
pipelineCursor_1.last();
pipelineCursor_1.insertAfter( "Tax", "Tax" );
pipelineCursor_1.destroy();
When Developer generates code from the service input/output parameters, it puts the
code on the Clipboard. From there, you can paste it into your program (on the Source tab
or in your own IDE) and modify it as necessary.
Note: SAP BC Server returns everything that your service puts into the pipeline, regardless
of what is declared as the its input/output parameters. Declaring a serviceʹs input and
output parameters does not filter what variables the service actually receives or returns at
runtime. It simply provides a formal description of what the service requires as input and
produces as output.
The following procedure describes how to generate code from a the input/output
parameters defined for a service.
1 Open the Java service for which you want to generate code (if you are creating the
Java service in your own IDE, use Developer to create a new, empty Java service that
you will use only for the purpose of declaring a set of input/output parameters).
2 Select the Input/Output tab and define the inputs and outputs for this service if they are
not already specified. For more information about defining inputs and outputs for a
service, see “To declare input and output parameters for a service” on page 86.
3 If you want to generate code for a subset of the variables on the Input/Output tab, select
those variables by pressing CTRL and clicking the variable names with your mouse.
4 On the Compose menu, click Generate Code.
5 Select For Implementing This Service and click Next.
6 Specify the following options.
7 Click Finish. Developer generates code and places it on the Clipboard.
8 Paste the contents of the Clipboard into your source code.
Whether the service runs in stateless mode.
Whether the results of the service are maintained in cache.
Whether an output template is applied to the service when it is invoked by a browser.
You specify these options on the Settings tab. For information about using these options,
see “Specifying Run‐Time Parameters” on page 87 and “Assigning an Output Template to
a Service” on page 91.
The ns directory contains information about the services in that package. An “entry” in
the namespace directory corresponds to a service or a folder. The contents of each entry
depend on what kind of entry it is.
Service entries contain information about properties of the service (for instance,
statelessness), the input and output parameters of the service (if they have been
defined), as well as Java or XML source if it’s available for that service.
Folder entries contain information about the folder–this is usually limited to Java
source for the services in that folder, if it’s available.
For Java services, information about the service is stored in the namespace directory,
however the compiled code for that service (i.e., the class file) is stored in the code
subdirectory. The following shows the directory path to the class files in the purch
package.
<sapbc>\server\packages\purch\code\classes\recording\accounts.class
When you use Developer to build a Java service, it automatically updates and maintains
the folder and service information in the name space. However, if you build a Java service
in your own IDE, you need to use a utility called jcode to compile your service and
generate the necessary files in the namespace.
Important! Although you may want to examine the contents of the namespace directories
on your SAP BC Server, do not modify this information by hand. It must only be modified
using the appropriate SAP tools or utilities. Inappropriate changes—especially to the ns
directory of the WmRoot package—can disable your server.
Note: Services can throw ServiceException. Do not call Service.throwError.
Additionally,
Your Java class must import the following Java packages.
com.wm.data.*;
com.wm.app.b2b.server.ServiceException;
com.wm.app.b2b.server.Service;
Your Java class must be public.
We also recommend, for performance reasons, that you make your class final.
Stage 2 Specify the input and output parameters (signature) of the service. During this
stage, you define the service’s inputs and outputs (if you know these).
You can use the Developer to generate the input and output code that
you can paste into your program (see “Generating Java Code from
Service Input and Output Parameters” on page 296.)
Shared code within the class
Service definitions and service inputs and outputs
The following code fragment shows the tags used to mark the beginning and end of the
import section.
.
.
.
// --- <<B2B-START-IMPORTS>> ---
import com.wm.data.*;
import java.util.*;
// --- <<B2B-END-IMPORTS>> ---
.
.
You use similar tags to mark the beginning and end of other components in your source
code. For a complete example, see “jcode Examples” in Appendix F. For additional
information about the jcode utility, see the next section “Using the jcode Utility”.
Fragment Mode (for pulling apart source code and storing fragments and signatures in
the namespace).
Composite Mode (for rebuilding the source files from fragments in the namespace).
You must use the make and fragment modes to run your services on SAP BC Server and
edit the source code from Developer.
Important! Before you can compile a service using jcode, you must set the environment
variable B2B_SERVER_HOME to point to the directory in which SAP BC Server is
installed.
Make Mode
You use this mode to examine source files for one or more folders in a package and
compile those that have been modified since they were last compiled. The jcode utility
will report which files were compiled, as well as any errors that were encountered during
the process.
To make all the code in a package, type the following on the command line:
jcode makeall Package
To compile source files, the jcode utility invokes the JDK Java compiler, javac using the
following command:
javac –classpath pathName –d classDir fileList
Where pathName is the classpath to use for the compile, classDir is the destination
directory for the compiled classes, and fileList is a list of the names of source files to
compile.
If you do not have the JDK installed, or you want to use another compiler, you can set
SAP BC Server’s watt.server.compile property to a new command line (using the arguments
described above). For instance, to use IBM’s jikes, you would set this property to:
jikes +E –nowarn –classpath pathName –d classDir fileList
Fragment Mode
You use this mode to update the Java code fragments and service signatures (input and
output parameters) in the namespace based on the jcode tags in the source code file. The
original source file is not modified, but namespace information is updated and the source
code for the service becomes available through Developer.
To fragment all the code in a package, type the following on the command line:
jcode fragall Package
To fragment only the code for a single folder (i.e. a single Java source file), type the
following on the command line:
jcode frag Package Folder
Composite Mode
Composite mode is the opposite of fragment mode. You use this mode to build a source
file based on the code fragments currently defined in the namespace.
Important! The existing source file, if there is one, is overwritten by the source file produced
by jcode. User locks in Developer will not prevent this, since the jcode utility operates
independently of locking functionality.
To construct a source file based on the current information in the namespace, type the
following on the command line:
jcode comp Package Folder
Important! If your Java source code contains any non‐ASCII characters, set the property
watt.server.java.source=Unicode | UnicodeBig | UnicodeLittle. The default
value is file.encoding. When Unicode is set, the compile command line specified in the
property watt.server.compile.unicode is used. The default value of this property is
“javac -encoding Unicode -classpath {0} -d {1} {2}”
To construct all source files for a package based on the current information in the
namespace, type the following on the command line:
jcode compall Package
This command is especially used for the migration of packages from a release prior to
Business Connector 4.8, which didn’t have the concept of the ‘JSBC_’ prefix in order to
avoid name clashes for the compiler.
Important! The existing sources file, if there are ones, are overwritten by the source files
produced by jcode. User locks in Developer will not prevent this, since the jcode utility
operates independently of locking functionality.
To update (make and frag) all the code in all packages on SAP BC Server, type the
following at the command line:
jcode upall
To force a make and frag on all packages on SAP BC Server, type:
jcode hailmary
Note: As of BC 4.8, it is possible to attach a debugger without restarting the server, if the
server is running with the SAP JVM. This is a very helpful feature for development
purposes, even for tracking problems on productive systems, because you do not need to
restart the server.
Preparing Debugging
If you develop your own services, make sure to compile them with the debug option –g so
that all relevant information is included in the class files.
For development servers perform the following steps:
1 Create the java service in BC Developer (including the signature).
This will create the necessary BC internal files correctly.
2 Start your IDE
The following example refers to Eclipse, but can also be adapted to other IDEs.
Create a project in your IDE which uses the
<sapbc>\server\packages\<yourPackage>\code\source directory. Recompile the source directory,
otherwise you might be getting later errors like “hot code replace failed” in Eclipse.
3 Put the class file produced by compiler in the appropriate “classes” directory on SAP BC Server.
(If you compile your Java service from Developer, you can skip this step, because this
happens automatically.) To do this, locate the package in which you want the service
to reside, and then copy generated the class file to the code\classes directory in that
package or set the build output directory to:
<sapbc>\server\packages\<yourPackage>\code\classes
For example, if you have a class file called orders.class, you would copy it here:
<sapbc>\server\packages\<yourPackage>\code\classes\order.class
Be aware that a class name represents a folder in SAP BC Server. If you want to nest
the class file within a sub‐folder, you must put it in the appropriate subdirectory
within \code\classes. For example, if you wanted orders.class to represent a sub‐folder
within an folder called SGX, you would copy it here:
<sapbc>\server\packages\yourPackage\code\classes\SGX\order.class
For productive servers (in order to find a problem) do the following:
Create a project in Eclipse that contains the sources of the services you like to debug.
Thus it is possible to set a breakpoint in the services that you want to investigate.
4 If the service you want to debug is not already registered on the server, register it using the
Server Administrator. (If the service was initially created with Developer, it will already
be registered on the server.) For information about registering a service, see the SAP
BC Administration Guide.
If you have set a breakpoint, Eclipse will display the corresponding code and you can
analize the execution state. If another package than the investigated one is passed,
you can easily attach its sources to the debug configuration on the fly.
6 When finished, detach the debugger in Eclipse or in the Server UI.
A C/C++ source‐code “template” that you use to create your C program.
A make file you use to compile the finished program and place it on the server.
Before you create a C/C++ service, you must:
Make sure you have a C compiler installed on SAP BC Server that you will use to develop
and test the service.
Make sure the package in which you want to create the service already exists. If the package
does not already exist, create it using SAP BC Developer. For more information about
creating a package, see “Creating a Package” on page 57. (If you do not have
Developer or Administrator privileges, ask your server administrator to do this.)
Make sure the directory for this package contains a “code/libs” directory. When you compile
your C/C++ service, the make file places the compiled service (a DLL) in this directory.
If the package does not already have a code/libs directory, create one before you begin
building the service.
Make sure the folder in which you want to create the service already exists. If the folder does
not exist, use Developer to create it. See online help for step‐by‐step procedures.
Declare the input and output parameters for your service in a specification. When Developer
generates the starter code for your service, it creates code that extracts the specified
input values from the pipeline and assigns them to variables in your program. It also
inserts your service’s output variables into the pipeline. To do this, Developer must
know the input and output requirements of your service. You supply this information
in a specification. For information about creating a specification, see online Help.
1 On the File menu, click New.
2 Select C Service and click Next.
3 In the New C Service dialog box, in the list next to Folder, select the folder into which
you want to save this service.
4 In the Name field, type a name for the service and click Next.
5 Select the platform that describes the machine on which your SAP BC Server is
running (Developer needs to know this in order to build the right make file).
6 Select the specification for this service.
7 Click Finish.
The Source tab contains code that calls the Java wrapper for the C program
The Shared tab contains code that loads the library containing the C program
The Input/Output tab declares the input/output parameters for the service
The names of the files will match the service name you specified in Developer. After you
locate the files, do the following:
Copy the source code file to a new file (in the same directory) with the following file
name:
serviceNameImpl.c
Example
If your service name is postPO, you would…
Copy... To...
postPO.c postPOImpl.c
You create the program in the serviceNameImpl.c file, not the original file. This is the file in
which the make file expects to find your source code. (This step is taken to maintain a
copy of the original source file to which you can refer, or revert back to, during your
development.)
Set... To...
JDKDIR To the directory that contains the Java Development Kit.
SEVRDIR The directory in which SAP BC Server is installed (e.g.,
c:\<sapbc>\server).
The make file compiles your program and puts the finished DLL in the code\libs
directory in the package in which the service resides (if this directory does not exist when
you run the make file, your program will not compile successfully).
Once your program compiles successfully, you must restart SAP BC Server to reload the
code\libs directory. This makes the service available for execution and allows you to test
it with Developer. For details on testing, see “Testing and Debugging Services” on
page 247.
Requirements
To use SAP BC Server with COM or DCOM, your SAP BC Server must be running Java
Virtual Machine 1.2 or later or JView build 5.00.3177 or later (type jview /? from the
command prompt to check the build number):
Important! If you modify Visual Basic code intended for use with SAP BC Server libraries,
do not use the debug mode in the Visual Basic development environment to test your
code. (The debugger does not maintain references to SAP BC Server libraries.) Instead, use
a logging feature in your development environment to test the code.
Name Description
progid The program ID of the object that you want to invoke.
–OR–
guid The Globally Unique Identifier (GUID) of the object that you want to
invoke.
context The context for the object, which is INPROC (DLL), LOCAL_SERVER
(EXE), or REMOTE_SERVER (EXE).
server DCOM only. The TCP/IP domain name of the machine where the DCOM
object is located. For example, doc.rubicon.com or 128.111.222.001.
user Optional. DCOM only. The name of the user in which to launch the
remote COM object.
password Optional. DCOM only. The password associated with user.
domain Optional. DCOM only. The Windows domain associated with user.
The service will return a reference to the object called pDispatch or throw an error if the
object cannot be created.
Name Description
pDispatch An object reference previously obtained by the call to createObject, or
obtained in the result value of a previous call to invoke.
dispName The name of the COM method or property that you want to invoke.
accessType Optional. The type of operation (METHOD, GET, PUT, PUTREF) to be
performed on dispName. If you are invoking a DCOM object, always
set accessType to GET. Incorrect setting of this parameter will cause the
invoke to fail.
If you are unsure whether a dispName is a method or property,
examine the component’s type library using OLEVIEW or a Microsoft
development environment.
params Optional. An object array of parameters. This is exposed in Developer
as an array of Strings for usability (because Objects cannot be
manipulated in Developer), but is in reality an Object array. If you need
to pass complex or native types, you may have to create this value
within your own service.
If the invocation is successful, the return value is contained in “result.” If the result is an
object variable, it can then be the target of subsequent calls to invoke by mapping the
result to pDispatch in the next invoke.
Note: For a complete list of all the methods contained within Values and other objects in
the SAP BC COM library, click Object Browser on the View menu in Visual Basic and select
the SAP BC library. The DLL (webMethods.dll) is registered and copied into your system
directory during installation of Developer and SAP BC Server.
1 In the Service Browser, select the flow service in which you want to invoke the VB
method (if the service does not already exist, use the File New command to create it).
2 Click on the Flow Editor toolbar, select Browse and then select
win32.COM:invokeLate from the WmWin32 package.
3 Click the Pipeline tab and use the pipeline modifier to assign values to the
following variables in Service In:
Set... To specify...
$progid The name of the library and class (a standard Microsoft COM
convention) containing the method you want to invoke. Specify
the names using libraryName.className notation.
The following example shows the value you would use for the
“Hello World” example:
Example wmVBDemo.Services
Important! Make sure you use the exact combination of uppercase
and lowercase letters. Library and class names are case‐sensitive.
$methodName The name of the method you want to invoke.
The following example shows the value you would use for the
“Hello World” example:
Example helloWorld
$context One of the following values, specifying whether your COM object
is a DLL or an EXE.
Set this value... If...
INPROC The component was compiled as an
ActiveX DLL. This option tells the
server to instantiate the object in the
same process as the server.
If you are invoking the “Hello World”
example, you select this option, because
the example was compiled as a DLL.
LOCAL_SERVER The component was compiled as an
ActiveX EXE. This option tells the
server to instantiate the object as its own
process.
REMOTE_SERVER The object that you want to invoke is a
DCOM object on a remote machine.
This option tells the server to instantiate
the object as its own process.
4 Click the Input/Output tab and declare the input and output parameters for your
service.
If you are invoking the “Hello World” example, declare a String input parameter
name and a String output parameter message. For more information about declaring
input and output parameters, see “To declare input and output parameters for a
service” on page 86.
5 Click on the Service Browser toolbar to save the flow service.
6 Click on the Service Browser toolbar to test the service.
Developer prompts you for input values and then displays the results of the service
on the Results tab.
Note: If you receive an “InvocationTargetException” instead of the results of your service,
you may be running an old version of the Microsoft Java Virtual Machine.
Note: If you created early‐binding services with earlier versions of SAP BC Server (prior to
Version 4.0), you will need to update those services and respecify the input parameters for
the win32.COM:invoke service as described in step 3 of the following procedure.
1 In the Service Browser, select the flow service in which you want to invoke the VB
method (if the service does not already exist, use the File New command to create it).
2 Click on the Flow Editor toolbar, select Browse and then select
win32.COM:invoke from the WmWin32 package.
3 Click the Pipeline tab, and then use the pipeline modifier to assign values to the
following variables in Service In:
Set... To Specify...
$progid The name of the library and class (a standard Microsoft COM
convention) containing the method you want to invoke. Specify
the names using libraryName.className notation.
The following example shows the value you would use for the
“Hello World” example:
Example wmVBDemo.Services
Important! Make sure you use the exact combination of uppercase
and lowercase letters. Library and class names are case‐sensitive.
$methodName The name of the method you want to invoke.
The following example shows the value you would use for the
“Hello World” example:
Example helloWorld
$context One of the following values, specifying whether your COM object
is a DLL or an EXE.
Set this value… If…
INPROC The component was compiled as an
ActiveX DLL. This option tells the server
to instantiate the object in the same
process as the server.
If you are invoking the “Hello World”
example, you select this option, because
the example was compiled as a DLL.
LOCAL_SERVER The component was compiled as an
ActiveX EXE. This option tells the server
to instantiate the object as its own process.
REMOTE_SERVER The object that you want to invoke is a
DCOM object on a remote machine. This
option tells the server to instantiate the
object as its own process.
4 Select the Input/Output tab and declare the input and output parameters for your
service.
If you are invoking the “Hello World” example, declare a String input parameter
name and a String output parameter message. For more information about declaring
input and output parameters, see “To declare input and output parameters for a
service” on page 86.
5 Click on the Service Browser toolbar to save the flow service.
6 Click on the Service Browser toolbar to test the service.
Developer prompts you for input values, executes the service, and then displays the
results of the service on the Results tab.
Basic Concepts
SAP BC Developer enables you to automatically generate client code in a variety of
languages and for several environments. Client code is application code that invokes a
service on a SAP BC Server. It typically performs the following basic tasks:
Prompts the user for input values (if your service takes input)
Places the inputs into an input record (if your service takes input)
Opens a session on SAP BC Server
Invokes a service
Receives output from the service
Closes a session on SAP BC Server
Displays the output to the user
The client code that Developer generates can serve as a good starting point for your own
development.
Assumptions
For generating the client source code in BC Developer:
— SAP BC Server is running.
For compiling the source code on your computer:
— A fully functional JDK is installed on your computer.
— Your classpath consists of at least the following:
<sapbc>\developer\lib\client.jar
Libraries Source
IAIK ‐ S/MIME version: 2.6 Institute for Applied Information
IAIK ‐ iSaSiLk toolkit version: 4.0 Processing and Communications
IAIK JSSE Wrapper version: 1.2 (IAIK)
http://jcewww.iaik.at/
Java Naming and Directory Interface™ 1.2.1 Sun
JavaBeans Activation Framework 1.0.2
http://java.sun.com
International Components for Unicode for IBM
Java
http://www‐124.ibm.com/icu4/
Download ICU4J version 1.3.1
download/index.html
Limitations
Developer cannot generate client code for services that use input or output variables
that are of type Object or Object List.
The client code that Developer generates does not support multiple input or output
variables with the same name.
If you want to override these limitations, you will need to modify the client code that
Developer generates.
Procedure
Use the following procedure to generate Java client code that invokes a service:
1 In the Service Browser, select the service for which you want to generate client code.
2 On the Compose menu, click Generate Code.
3 In the Code Generation dialog box, select For calling this service from a client, and then click
Next.
4 In the Language field, select Java, and then click Next.
5 Specify the directory where you want Developer to place the generated client code.
Either select an existing directory or type the path for a new directory. If you type the
path for a new directory, Developer creates the directory.
6 Click Finish.
Developer generates the file that contains the Java client code (ServiceName.java) and
a Readme.txt file. The Java client code is written to the hard disk in ISO8859_1, the
character set in which the file is encoded.
Modify the generated client code to meet your site’s needs. You can update the client
code to invoke built‐in services and to use the provided Java API. For information
about the built‐in services that are available, see the SAP BC Built‐In Services Guide.
Documentation for the Java API can be found at
<sapbc>\developer\doc\api\index.html.
To complete your client application, refer to the Readme.txt file located in the same
directory as your client code.
Assumptions
SAP BC Server is running.
A platform that has the C/C++ compiler (e.g., GCC) is installed. SAP generates code
for the following platforms: Windows, Solaris, HP‐UX, Linux.
The client.jar file is in the classpath for Developer. The client.jar file is a SAP BC file
that is located in the <sapbc>/developer/lib directory.
The Make facility is installed.
Limitations
The client code that Developer generates does not support multiple input or output
variables with the same name.
If you want to override this limitation, you will need to modify the client code that
Developer generates.
Procedure
Use the following procedure to have Developer generate C/C++ client code that invokes a
service:
1 In the Service Browser, select the service for which you want to generate client code.
2 On the Compose menu, click Generate Code.
3 In the Code Generation dialog box, select For calling this service from a client; then click
Next.
4 In the Language field, select the C/C++ platform for which you are creating client code.
Click Next.
5 Identify the directory where you want Developer to place the generated client code.
Either select an existing directory or type the path for a new directory. If you type the
path for a new directory, Developer creates the directory.
6 Click Finish.
Developer generates the file that contains the C client code (ServiceName.c), a file that
contains compiling settings (ServiceName.make), and a CReadme.txt file.
Modify the generated client code to meet your site’s needs. You can update the client
code to invoke built‐in services and to use the SAP BC provided C API. For
information about the built‐in services that are available, see the SAP BC Built‐In
Services Guide. For documentation about the C API, see
<sapbc>\developer\doc\api\c\index.html.
To complete your client application, refer to the CReadme.txt file located in the same
directory as your client code.
Assumptions
SAP BC Server is running.
Visual Basic Version 5 or 6 is installed.
SAP BC Type Library 4.0 is installed.
Note: The SAP BC Type Library 4.0 is a COM object that Visual Basic uses to interact with
SAP BC Server. The SAP BC Type Library is automatically installed when you install
Developer.
Environment Setup
Your system PATH environment variable must include the following directory:
<sapbc>\developer\jvm\bin\hotspot
Limitations
The client code that Developer generates supports only input values and output
values of type String, String List, and String Table.
The client code that Developer generates does not support multiple input or output
variables with the same name.
If you want to override these limitations, you will need to modify the client code that
Developer generates.
Procedure
Use the following procedure to have Developer generate Visual Basic client code that
invokes a service.
1 In the Service Browser, select the service for which you want to generate client code.
2 On the Compose menu, click Generate Code.
3 In the Code Generation dialog box, select For calling this service from a client, and click
Next.
4 In the Language field, select Visual Basic 5/6, and click Next.
5 Identify the directory where you want Developer to place the generated client code.
Either select an existing directory or type the path for a new directory. If you type the
path for a new directory, Developer creates the directory.
6 Click Finish.
Developer generates several files, including the serviceNameReadMe.txt file. This file
contains detailed information about all the generated files. Refer to it to complete your
client application and for information about deploying your client application.
General Files
Assumptions
SAP BC Server is running.
Excel 97 or Excel 2000 is installed.
SAP BC Type Library 4.0 is installed.
Note: The SAP BC Type Library 4.0 is a COM object that Visual Basic uses to interact with
SAP BC Server. The SAP BC Type Library is automatically installed when you install
Developer.
Limitations
The client code that Developer generates only supports input values of type String
and output values of type String, String List, and String Table.
The client code that Developer generates does not support multiple input or output
variables with the same name.
If you want to override these limitations, you will need to modify the client code that
Developer generates.
Procedure
Use the following procedure to have Developer generate Excel client code that invokes a
service.
1 In the Service Browser, select the service for which you want to generate client code.
2 On the Compose menu, click Generate Code.
3 In the Code Generation dialog box, select For calling this service from a client, and click
Next.
4 In the Language field, select Excel 97/2000, and click Next.
5 Identify the directory where you want Developer to place the generated client code.
Either select an existing directory or type the path for a new directory. If you type the
path for a new directory, Developer creates the directory.
6 Click Finish.
Developer generates several files, including the serviceNameReadMe.txt file. This file
contains detailed information about all generated files.
7 Copy the wmXLTemplate.xls file, which SAP provides, to the directory that contains
the client code that Developer generated. The wmXLTemplate.xls file is located in the
<sapbc>\developer\support\Excel directory.
8 Open the wmXLTemplate.xls file. When prompted to indicate whether you want to
enable macros, select Enable Macros.
9 Follow the instructions in the wmXLTemplate.xls file to complete your client
application. See the ServiceNameReadMe.txt file for information about deploying your
client application.
Note: You cannot use Developer to generate browser‐based clients.
Assumptions
SAP BC Server is running.
The input values for the services you want to invoke are determined. You will need to
include the input values in the URL that you use to invoke a service.
Limitations
When you test a service using the Run in Browser command, only input values of the type
String and String List will be passed to the service. Input values of the type Record,
Record List, Object, and Object List will not be displayed when the Web page is served.
Item Description
1 Identifies the SAP BC Server on which the service you want to invoke
resides.
2 Specifies the required keyword “invoke”, which tells SAP BC Server that the
URL identifies a service that is to be invoked.
3 Identifies the folder in which the service to invoke resides. Separate
subfolders with periods. This field is case‐sensitive. Be sure to use the same
combination of upper and lower case letters as specified in the folder name
on SAP BC Server.
4 Identifies the service that you want to invoke. This field is case‐sensitive. Be
sure to use the same combination of upper and lower case letters as specified
in the service name on SAP BC Server.
5 Specifies the input values for the service. Specify a question mark (?) before
the input values. The question mark signals the beginning of input values.
Each input value is represented as variable=value. The variable portion is case‐
sensitive. Be sure to use the same combination of upper and lower case
letters as specified in your service. If your service requires more than one
input value, separate each variable=value with an ampersand (&).
Note: Only specify this part of the URL when using the HTTP GET method.
Note: If you are serving the Web pages that invoke services from a SAP BC Server, you can
use a relative URL to invoke the service. By doing so, you can serve the exact Web page
from several servers without having to update the URLs.
Specify the URL for the service in the ACTION attribute and “POST” in the METHOD
attribute. For example:
<FORM ACTION="/invoke/sample.webPageDemo/getProductCost" METHOD="POST">
After the user fills in the form and submits it, the Web browser creates a document that
contains the information the user supplied in the HTML form (performs an HTTP POST).
The browser invokes the URL identified in the ACTION attribute, which invokes the
service on SAP BC Server, and the browser posts the document that contains the user’s
input information to SAP BC Server. For more information about how the server creates
the IData object that it sends to the service, see “Input into the Service” on page 331.
Important! Do not use input variable names that end in List. For example, if your service
expects a list of sku values, do not name the variable skuList.
When the server receives multiple input values that are associated with the same variable
name, the String variable in the IData object contains only the value of the first variable;
the String List variable contains all values. For example, the following shows a URL that
contains two values for the variable year and the resulting IData object that the server
creates:
/invoke/sample.webPageDemo/checkYears?year=1998&year=1999
Similarly, if the HTML form contains two fields with the same name and a user supplies
values for more than one, the String variable in the IData object contains only the value of
the first variable; the String List variable contains all values. For example, the following
shows sample HTML code that renders check boxes:
<INPUT TYPE="checkbox" NAME="Color" VALUE="blue">Blue<BR>
<INPUT TYPE="checkbox" NAME="Color" VALUE="green">Green<BR>
<INPUT TYPE="checkbox" NAME="Color" VALUE="red">Red<BR>
If the browser user selects all check boxes, the document that is posted to SAP BC Server
will contain three values for the variable named Color. The following shows the IData
object that the server passes to the service:
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Overview
The SAP BC platform supports WSDL (Web Services Description Language) by providing
features that enable you to create a WSDL document from any service and create a service
(a Web Service Connector) from a valid WSDL document. A Web Service Connector is a
flow service that implements client connection information to invoke a Web Service
located on a remote server.
What Is WSDL?
Web Services Description Language (WSDL) is an XML format for describing Web
Services accessible through the Internet. A WSDL document specifies:
What work the Web Service performs.
Where the Web Service is located.
How to access the Web Service, including the protocol used to access the Web Service
and the protocol used to return a response.
What data is exchanged by the Web Service, specifically the input parameters
supplied to the Web Service and the output parameters produced by the Web Service.
A Web Service provider can create a WSDL document for the service, upload the WSDL
document to a publicly accessible server, and use a Web Services registry to publish a
URL that points to the WSDL document location. Web Service consumers can browse the
registry, discover the service, and then use the supplied URL to download the WSDL
document. The WSDL document contains all of the information the consumer needs to
create a proxy service that sends data to the Web Service, invokes the Web Service, and
receives data from the Web Service.
Element Description
<types> Contains the type definitions that describe the data exchanged by the
Web Service. The <types> element can reference entire XML Schemas
and can contain simple type definitions, complex type definitions, and
element declarations. The type definitions and element declarations
help define the input and output parameters for the Web Service.
WSDL uses XML Schema as its native type system.
<message> Specifies the data being exchanged by the Web Service. A <message>
element describes a set of input parameters or a set of output
parameters. Each <message> element can contain one or more <part>
elements. A part element associates a piece of data with a name and a
type definition or element declaration. The type definition or element
declaration referenced by the <part> element can be defined,
declared, or referenced in the <types> element.
<operation> Specifies the messages received and sent by the Web Service. Within
the <operation> element, the <input> element identifies the message
whose parts specify the input parameters to the Web Service, and the
<output> element identifies the message whose parts specify the
output parameters of the Web Service. Essentially, the operation
specifies the signature for the Web Service. An <operation> element
is declared within a <portType> element.
<portType> Defines a named set of operations. The <portType> element associates
a port type name with a set of operations. A <portType> element can
contain multiple operations.
<binding> Specifies the protocol and message format to use to access the
operations in a port type. Each <binding> element can specify only
one protocol for a port type. However, a WSDL document can define
more than one binding for a single port type. A WSDL document
should include one <binding> element for each protocol that it
supports.
<port> Associates a binding with a network address. Together, the binding
and network address specify how to invoke a Web Service. Each port
can specify only one network address for a binding. However,
multiple ports can be defined for a single Web Service. Port elements
are defined within the <service> element.
<service> Identifies all of the ports that can be used to call a Web Service. A
<service> element can contain many ports. Each port in a <service>
element represents an alternative way of calling the same Web
Service. The ports access the same Web Service (refer to the same port
type), but use different bindings (protocols) or network address to
invoke the Web Service.
In a WSDL document, the elements that describe a Web Service are enclosed in the
<definitions> element.
<xsd:complexType name="AuthenticateUserInput">
<xsd:sequence>
<xsd:element name="userName" type="xsd:string"/>
<xsd:element name="password" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="AuthenticateUserOutput">
<xsd:sequence>
<xsd:element name="isValid" type="xsd:boolean"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
A service element is a
collection of ports. <wsdl:service name="AuthenticateUserService">
<wsdl:port name="AuthenticateUserPort0" binding="tns:AuthenticateUserBinding">
<soap:address location="http://localhost:5555/soap/rpc"/>
A port element associates </wsdl:port>
a binding with a network </wsdl:service>
address.
</wsdl:definitions>
Service Signature. Specify the input and output parameters that the service expects and
produces. For some protocols, such as RPC, the WSDL generator can use the
parameters declared on the Input/Output tab to create the service signature. For other
protocols, such as SOAP message and HTTP POST, you need to select a record or
XML Schema component to describe the input and/or output signature of the service.
The record or XML Schema component describes the XML document the service
expects as input and the XML document the service produces as output.
Target Namespace. Specify the namespace to which the elements declared in the
generated WSDL document belong.
When the WSDL generator creates a WSDL document, it uses the information you
provide along with information from the service to build the WSDL document and the
supporting XML Schema definition files.
The following sections provide more information about generating a WSDL document for
each protocol.
1 In the Service Browser, select the service for which you want to generate a WSDL
document.
2 On the Compose menu, select Generate WSD. Developer opens the Generate WSD dialog
box.
Note: If you are generating a WSDL document for a service located on your
development server and you intend to distribute the document to partners, make sure
that you enter the domain name or IP address of the production server in the Host
field.
4 In the Port field, type the number of a port on the host server that you want to accept
requests for this service. The port needs to accept HTTP or HTTPS requests.
In the Port field, Developer automatically inserts the port number you used to open
the current session on SAP BC Server.
5 Under Protocol, select SOAP-RPC.
Developer automatically enters “rpc” in the Directive field. When you specify SOAP‐
RPC as the protocol, the built‐in SOAP RPC processor receives, processes, and
responds to remote procedure calls for the service.
6 Under Via Transport, do one of the following:
Select... To...
HTTP Specify that requests to invoke the service must be sent via HTTP.
HTTPS Specify that requests to invoke the service must be sent securely
using HTTPS.
Note: The transport you select must be the same as the type of requests that the port
you selected accepts. If the port accepts HTTP requests, select HTTP under Transport. If
the port accepts HTTPS requests, select HTTPS.
7 In the Target Namespace field, type the URI you want to use as the target namespace for
the WSDL document. In the generated WSDL document, the elements, attributes, and
type definitions will belong to this namespace. By default, Developer displays the
following as the target namespace:
http://host
where host is the name of the SAP BC Server to which you are currently connected.
Note: Even if you delete the target namespace that Developer automatically enters, the
WSDL generator will use http://host as the target namespaces in the WSDL document.
If you want a null target namespace, you will need to edit the generated WSDL
document.
8 Click OK. Developer displays the Generate WSD dialog box.
9 Under Select Directory for Saving WSD files, enter the directory to which you want to
save the generated WSDL document and other generated files. Either select or enter
an existing directory or type the path for a new directory. If you type the path for a
new directory, the WSDL generator creates the directory when it generates the files.
10 Click OK.
When the WSDL generator finishes generating the WSDL document and the XML
Schema definitions, SAP BC Developer displays a message listing the files that were
generated and the directory in which the files were placed.
If an error occurs during WSDL generation, SAP BC Developer displays a message
stating that an error occurred. If the WSDL generator created files before the error
occurred, SAP BC Developer displays a message listing the files that were generated
and the directory in which the files were placed.
Note: If files of the same name exist already in the selected directory, SAP BC
Developer displays a warning stating that files will be overwritten.
Note: If you select components from one or two XML Schema
definitions as the input and output for the generated WSDL,
the WSDL generator does not create a default.xsd file. Instead,
the <types> element in the WSDL document imports the XML
Schema definition(s). This only applies to WSDL documents
that use SOAP‐MSG, HTTP POST, or HTTP GET as the
protocol.
Note: If the service does not have any declared input or output,
the default.xsd is not generated.
prefix.xsd XML Schema definition containing type definitions and
element declarations for prefixed variables in the input and
output signature. The WSDL generator creates an XML
Schema definition for each unique prefix. The prefix
corresponds to the namespace in which the type definitions
and element declarations belong.
Note: Because the WSDL generator uses ST followed by a
number as the naming convention for generated XML
Schemas, avoid using ST# as the a prefix in a variable name,
i.e., ST2:myType in records.
namespaces.dtd A DTD (Document Type Definition) that lists each prefix used
in the service signature and its corresponding namespace.
These namespace and prefix declarations are used by all the
XML Schema definition files.
The WSDL generator only generates this file when more than
one XML Schema definition is generated.
Important! The generated files use <include> elements to reference the contents of other
generated files. The <include> element uses a relative path to specify the location of the
other files. For example, the <types> element in the WSDL document contains an
<include> element that uses schemaLocation="default.xsd" to reference the
default.xsd. The location is a relative path. If you move the WSDL document or the
default.xsd or rename default.xsd so that the relative path changes, make sure to update
the <include> elements with the new relative path or the new absolute path.
Note: Each service can have an explicit universal name and an implicit universal name.
You may optionally assign an explicit universal name to the service. Every service that
exists on SAP BC Server has an implicit universal name. An implicit universal name is
derived from the name of the service itself. For implicit universal names, the namespace
name is the fully qualified name of the folder in which the service resides. The local name
is the unqualified name of the service. For more information about universal names, see
“Assigning Universal Names to Services” on page 98 and the SAP BC SOAP Programming
Guide.
For the HTTP protocols, the WSDL generator uses the namespace name and local name
components of the implicit universal name as the value of the name attributes for WSDL
elements.
The following table identifies the naming conventions the WSDL generator uses to assign
a value to the name attributes for WSDL elements.
Note: The WSDL generator uses localNameInput as the
value of the type attribute. When you specify SOAP‐
MSG or HTTP‐POST as the protocol, you can select a
type definition or element declaration in an XML
Schema to describe the input signature. If you specified
a type definition as the input signature, the WSDL
generator uses the type definition name as the value of
the type attribute. If you specified an element
declaration as the input signature, the <part> element
carries the element attribute and the WSDL generator
uses the element name as the value of the element
attribute.
For HTTP‐POST and HTTP‐GET protocols, the
WSDL generator does not create an output
<message> element.
<part> composite
(in second <message> The WSDL generator assigns the type attribute the
element) value localNameOutput.
Note: Part names need to be unique only within a
<message> element. Different <message> elements can
have parts of the same name.
<portType> namespaceNamePortType
<operation> localName
<input> localNameInput
<output> localNameOutput
<binding> namespaceNameBinding
<service> namespaceNameService
<port> namespaceNamePort0
transport://host:port/soap/directive
For WSDL documents that specify HTTP‐POST or HTTP‐GET as the protocol, the
location attribute in the <address> element is used in combination with the location
attribute in the <operation> element to specify the URL used to invoke the service. For
WSDL documents that specify HTTP‐POST and HTTP‐GET as the protocol, the location
attribute in the <address> element has the following format:
transport://host:port/directive
where directive is almost always “invoke”.
The location attribute in the <operation> element specifies the fully qualified path
name of the service on the SAP BC Server and has the following format:
folder.subfolder/serviceName
If the element reference contains minOccurs="0", then the element corresponds to a
optional parameter.
If the element reference contains minOccurs="1", then the element corresponds to a
required parameter.
If the element reference contains maxOccurs="unbounded", then the parameter
corresponds to a one‐dimensional array variable (String List, Object List, Record List,
or Record Reference List).
The <sequence> elements in the localNameInput and localNameOutput complex type
definitions also contain an <any> element declaration. This declaration allows the input
XML document for the service to contain undeclared fields.
Each top‐level parameter declared in the input and output signature corresponds to a
global element declaration in the XML schema. The type declaration for an element
depends on the parameter data type.
If the parameter is a String or a String List, the type definition for the element is
determined by the Content type property. For example:
— If the Content type is a built‐in data type, such as decimal
{http://www.w3.org/2001/XMLSchema}, then the element declaration contains
type="xsd:decimal".
Note: The above is true only for top‐level Record Reference and Record Reference LIst
parameters. Elements that correspond to Record Reference and Record Reference List
parameters that are children of other parameters are defined to be of anonymous
complex type.
Note: Whenever the input or output signature for a service includes a String Table, all
multi‐dimensional variables are expressed as SOAP arrays.
Note: The WSDL generator does not support records that contain identically named
T
variables at the top level or records with recursive references (a record that references
itself). If you generate a WSDL document from a service that uses these unsupported
record structures, the resulting XML Schema definition or WSDL document may be
invalid.
The following table summarizes how the SAP BC data types correspond to components in
an XML Schema.
When a global element declaration corresponding to a
String List parameter is referenced from a <sequence>, the
maxOccurs attribute is set to "unbounded".
String Table An element of complex type, where the complex type is a
expressed as a SOAP array.
Record An element of anonymous complex type. The complex type
definition contains a <sequence> with a local element
declaration for every child parameter in the Record.
Object List An element of anyType.
When a global element declaration for an Object List is
referenced from a <sequence>, the maxOccurs attribute is
set to "unbounded".
Important! If the input or output signature of a service is described by a record that contains
unresolved links, when the WSDL generator attempts to create a WSDL document, a null pointer
exception appears in the console. The WSDL generator creates an incomplete WSDL document
and incomplete XML Schema definitions. An example of an unresolved link is a Record Reference
variable where the referenced record cannot be found. Another example is a String, String List, or
String Table variable with Content type property that cannot be found (the SAP BC schema
containing the type definition has been moved or deleted).
If you select a custom SOAP processor as the directive, make sure the service for which
you are generating the WSDL document conforms to the target service requirements for
the custom processor. The following section explains the service requirements if you want
to use the default SOAP processor to receive and send SOAP messages for the service. For
information about creating custom SOAP processors, see the SAP BC SOAP Programming
Guide.
The service might use the SOAP message‐composition services to populate
soapResponseData or build a SOAP message string.
For more information about creating a target service for the default SOAP processor, see
the SAP BC SOAP Programming Guide.
Keep the following items in mind when selecting a record or XML Schema component to
describe the input or output signature:
If you do not specify a record or XML Schema component for the input, the WSDL
generator inserts an empty <message> element to represent the input in the WSDL
document.
Important! If you do not specify a record or XML schema component to describe the
service input and you indicate that the default SOAP processor will handle requests
for this service, the WSDL document generated for this service will not be usable by
Web Service consumers. When using the default SOAP message processor, you must
select a record or XML Schema component to describe the input. For more
information, see “Service Requirements for Using the Default SOAP Processor” on
page 353.
If you do not specify a record or XML Schema component for the output, the WSDL
generator inserts an empty output <message> element into the WSDL document.
If you specified a complex or simple type definition as the input or output signature,
the <part> element for the input or output <message> element uses the type
definition name as the value of the type attribute.
If you specified an element declaration as the input or output signature, the <part>
element for the input or output <message> element carries the element attribute and
the WSDL generator uses the element name as the value of the element attribute.
If you are using the default SOAP processor, the record or XML Schema component
you select needs to contain at least one part (variable, element or type definition), and
the name of the first part must correspond to the local name component of the
service’s universal name. If the service is assigned an explicit universal name, the first
part name must match the local name for the explicit universal name. Otherwise, it
must match the local name component of the implicit universal name.
This requirement is a result of the default SOAP processors routing behavior—the
default processor routes messages to services by matching the fully expanded QName
of the message body’s first element to an explicit or implicit universal name. To
generate a usable WSDL document, the input signature must use a naming
convention that will work with the default processor. For example, if you select a
record as the input signature, the name of the first variable in the record must match
the local name component of the service’s universal name.
Note: The WSDL generator does not support records that contain identically named
T
variables at the top level or records with recursive references (a record that references
itself). If you generate a WSDL document from a service that uses these unsupported
record structures, the resulting XML Schema definition or WSDL document may be
invalid.
The following procedure explains how to generate a WSDL document that specifies SOAP
messaging as the protocol.
1 In the Service Browser, select the service for which you want to generate a WSDL
document.
2 On the Compose menu, select Generate WSD. Developer opens the Generate WSD dialog
box.
Note: If you are generating a WSDL document for a service located on your
development server and you intend to distribute the document to partners, make sure
that you enter the domain name or IP address of the production server in the Host
field.
4 In the Port field, type the number of a port on the host server that you want to accept
requests for this service. The port needs to accept HTTP or HTTPS requests.
In the Port field, Developer automatically inserts the port number you used to open
the current session on SAP BC Server.
5 Under Protocol, select SOAP-MSG.
6 Under Via Transport, do one of the following:
Select... To...
HTTP Specify that requests to invoke the service must be sent via HTTP.
HTTPS Specify that requests to invoke the service must be sent securely
using HTTPS.
Note: The transport you select must be the same as the type of requests that the port
you selected accepts. If the port accepts HTTP requests, select HTTP under Transport. If
the port accepts HTTPS requests, select HTTPS.
7 In the Directive list, select the process directive for the SOAP processor you want to use
receive, process, and send SOAP messages that invoke the service. Select default if
you want to use the default processor.
Note: The Directive list displays all of the registered soap processors on the server to
which you are currently connected. If you plan to move the service to a production
server, make sure the directive you select corresponds to a soap processor that is
registered on the production server as well.
8 Next to the Input field, click to select a record, element declaration, or type
definition to represent the input signature of the service. Developer opens the Select
Input/Output Constraint dialog box.
9 Do one of the following to describe the input signature for the WSDL document.
— If you want to describe the input signature using a record, do the following:
1 Under Choose Constraint Type, select Record.
2 In the Name field, type the fully qualified name of the record that you want to
use to describe the input signature.
—or—
Next to the Folder field, navigate to and select the record.
3 Click OK.
— If you want to describe the input signature using an element declaration or a type
definition from an XML Schema, do the following:
1 Under Choose Constraint Type, select Schema Component.
2 In the text field, after http://, type the Web location and name of the XML
Schema that contains the element declaration or type definition that you want
to use to describe the input signature.
Note: The XML Schema definition you enter must be located on the Web and must
be accessible to Web Service consumers of the WSDL.
3 Click Load. Developer groups the element declarations and type definitions
under the headings ELEMENTS, SIMPLE TYPES, and COMPLEX TYPES.
4 Expand the headings to view the global element declarations or global type
definitions in the XML Schema.
Note: If an XML Schema definition does not contain a component, the
corresponding heading does not appear. For example, if the XML Schema does
not contain simple type definitions, the SIMPLE TYPES heading does not appear.
5 Select the global element declaration, complex type definition, or simple type
definition that you want to use to represent the input signature.
6 Click OK. Developer inserts the name of the selected element or type in the
Input field.
10 Repeat steps 8 to 9 for the Output field.
11 In the Target Namespace field, type the URI you want to use as the target namespace for
the WSDL document. In the generated WSDL document, the elements, attributes, and
type definitions will belong to this namespace. By default, Developer displays the
following as the target namespace:
http://host
Where host is the name of the SAP BC Server to which you are currently connected.
Note: Even if you delete the target namespace that Developer automatically enters, the
WSDL generator will use http://host as the target namespaces in the WSDL document.
If you want a null target namespace, you will need to edit the generated WSDL
document.
12 Click OK. Developer displays the Generate WSD dialog box.
13 Under Select Directory for Saving WSD files, enter the directory to which you want to
save the generated WSDL document and other generated files. Either select or enter
an existing directory or type the path for a new directory. If you type the path for a
new directory, the WSDL generator creates the directory when it generates the files.
14 Click OK.
When the WSDL generator finishes generating the WSDL document and the XML
Schema definitions, Developer displays a message listing the files that were generated
and the directory in which the files were placed.
If an error occurs during WSDL generation, Developer displays a message stating that
an error occurred. If the WSDL generator created files before the error occurred,
Developer displays a message listing the files that were generated and the directory in
which the files were placed.
For information about the generated files and how these files correspond to the
service for which you generated the WSDL, see “What Files are Generated?” on
page 344.
Note: If files of the same name exist already in the selected directory, SAP BC
Developer displays a warning stating that files will be overwritten.
Note: If you do not use the pub.flow:setResponse service or an XML output template to
return an XML document, then an HTML document will be returned to the HTTP
request. However, most Web Service consumers expect a service described by WSDL
to return an XML document.
Selecting the Input and Output Signature for HTTP GET and POST
When you specify HTTP POST or GET as the protocol for accessing a service, you may
need to specify a record or XML Schema component to represent the input and/or output
signature of the service. The signature describes the XML documents the service expects
as input and produces as output.
You need to specify a record or XML Schema component for the signature if:
You selected HTTP POST as the protocol and specified text/xml as the input format.
You selected HTTP POST or HTTP GET as the protocol and the service returns output
to the requesting client. (If the service describes a one‐way WSDL operation, you do
not need to specify a record or XML Schema component for output.)
By selecting a record or an XML Schema component (element declaration, simple type
definition, or complex type definition), the WSDL generator can produce a meaningful,
descriptive signature for the WSDL document. Keep the following items in mind when
selecting a record or XML Schema component to describe the service input or output:
If you do not specify a record or XML Schema component for the input, the WSDL
generator creates an empty <message> element to represent the input in the WSDL
document.
If you do not specify a record or XML Schema component for the output, the WSDL
generator creates a WSDL document describing a one‐way operation. Because a one‐
way operation does not expect a response, the WSDL generator does not create an
output <message> element.
If you specified a complex or simple type definition as the input or output signature,
the <part> element for the input or output <message> element carries the type
attribute and the WSDL generator uses the type definition name as the value of the
type attribute.
If you specified an element declaration as the input or output signature, the <part>
element for the input or output <message> element carries the element attribute and
the WSDL generator uses the element name as the value of the element attribute.
Note: The WSDL generator does not support records that contain identically named
T
variables at the top level or records with recursive references (a record that references
itself). If you generate a WSDL document from a service that uses these unsupported
record structures, the resulting XML Schema definition or WSDL document may be
invalid.
The following procedure explains how to create a WSDL document that specifies HTTP
POST or HTTP GET as the protocol.
To generate a WSDL document that specifies HTTP POST or HTTP GET as the protocol
1 In the Service Browser, select the service for which you want to generate a WSDL
document.
2 On the Compose menu, select Generate WSD. Developer opens the Generate WSD dialog
box.
3 In the Host field, type the numeric IP address or the domain name of the SAP BC
Server on which the service will reside. You do not need to specify http:// or https:// as
part of the host name. The WSDL generator automatically adds http://or https:// when
it compiles the network address for the service.
In the Host field Developer automatically inserts the name of the server on which the
service currently resides.
Note: If you are generating a WSDL document for a service located on your
development server and you intend to distribute the document to partners, make sure
that you enter the domain name or IP address of the production server in the Host
field.
4 In the Port field, type the number of a port on the host server that you want to accept
requests for this service. The port needs to accept HTTP or HTTPS requests.
Developer automatically inserts the port number you used to open the current session
on SAP BC Server.
5 Under Protocol, select one of the following:
Select... To...
HTTP-POST Specify HTTP POST as the protocol to communicate with the
service.
HTTP-GET Specify HTTP GET as the protocol to communicate with the
service.
6 Under Via Transport, do one of the following:
Select... To...
HTTP Specify that requests to invoke the service must be sent via HTTP.
HTTPS Specify that requests to invoke the service must be sent securely
using HTTPS.
Note: The transport you select must be the same as the type of requests that the port
you selected accepts. If the port accepts HTTP requests, select HTTP under Transport. If
the port accepts HTTPS requests, select HTTPS.
7 In the Directive field, specify the invoke directive used to invoke a service on SAP BC
Server. Developer automatically displays “invoke” as the directive.
Important! For most server configurations, this value should not be changed.
8 In the Path field, specify the path name of the service in the folder.subFolder/serviceName
format. Separate subfolders with a “.” (period). Separate the service name from the
folder name with a “/” (forward slash). Developer automatically enters the path name
of the service.
Note: If you plan to move the service to a different folder after generating the WSDL
document, make sure the path you specify represents the final location of the service
at production time.
9 If you selected HTTP-GET in step 5, skip to step 12.
10 If you selected HTTP-POST in step 5, in the Input format list, select the format in which
the service expects input.
Select... To...
text/xml Specify that input to the service needs to be supplied in an XML
document.
If you select text/xml, you need to select a record or XML Schema
component to describe the input signature of the service.
URL encoded Specify that input to the service needs to be submitted in
name=value pairs in the URL that requests the service.
If you select URL encoded, the WSDL generator uses the input
signature on the Input/Output tab of the service to create the input
message for the WSDL document.
11 If you selected text/xml as the input format in step 9, do one of the following to
describe the input signature for the WSDL document.
— If you want to describe the input signature using a record, do the following:
Note: If an XML Schema definition does not contain a component, the
corresponding heading does not appear. For example, if the XML Schema does
not contain simple type definitions, the SIMPLE TYPES heading does not appear.
5 Select the global element declaration, complex type definition, or simple type
definition that you want to use to represent the input signature.
6 Click OK. Developer inserts the name of the selected element or type in the
Input field.
12 To describe the XML document the service produces as output, follow step 11 for the
Output format field.
13 In the Target Namespace field, type the URI you want to use as the target namespace for
the WSDL document. In the generated WSDL document, the elements, attributes, and
type definitions will belong to this namespace. By default, Developer displays the
following as the target namespace:
http://host
Where host is the name of the SAP BC Server to which you are currently connected.
Note: Even if you delete the target namespace that Developer automatically enters, the
WSDL generator will use http://host as the target namespaces in the WSDL document.
If you want a null target namespace, you will need to edit the generated WSDL
document.
14 Click OK. Developer displays the Generate WSD dialog box.
15 Under Select Directory for Saving WSD files, enter the directory to which you want to
save the generated WSDL document and other generated files. Either select or enter
an existing directory or type the path for a new directory. If you type the path for a
new directory, the WSDL generator creates the directory when it generates the files.
16 Click OK.
When SAP BC Server finishes generating the WSDL document and the XML Schema
definitions, Developer displays a message listing the files that were generated and the
directory in which the files were placed.
If an error occurs during WSDL generation, Developer displays a message stating that
an error occurred. If the WSDL generator created files before the error occurred,
Developer displays a message listing the files that were generated and the directory in
which the files were placed.
For information about the generated files and how these files correspond to the
service for which you generated the WSDL, see “What Files are Generated?” on
page 344.
Note: If files of the same name exist already in the selected directory, SAP BC
Developer displays a warning stating that files will be overwritten.
Tip! Because a Web Service Connector is a flow service, you can invoke, test, debug, and
lock a Web Service Connector the same way you would a flow service.
The following procedure explains how to create a Web Service Connector from a WSDL
document.
1 On the File menu, click New. The Wizard starts.
2 In the New dialog box, select Web Service Connector, and click Next.
3 In the Folder tree, select the folder in which you want to save the Web Service
Connector and its supporting SAP BC elements, and click Next.
4 In the New Web Service Connector dialog box, under Choose a .wsd or .wsdl file by entering
the URL or selecting a local file, do one of the following:
— If you want to create a Web Service Connector from a .wsd or .wsdl file that
resides on the Internet, enter the URL of the file. (The URL must begin with
http:// or https://.)
— If you want to create a Web Service Connector from a .wsd or .wsdl file that
resides on your local file system, click to navigate to and select the file.
5 Click Finish.
Developer creates the Web Service Connector and its supporting SAP BC elements
and saves everything in the folder you specified. For information about the SAP BC
elements that Developer generates, see “What Elements Are Generated?” on
page 367.
While creating the Web Service Connector, Developer validates the WSDL document.
If Developer cannot create a Web Service Connector from the WSDL document or
cannot completely generate the Web Service Connector because of an invalid WSDL
document or missing WSDL elements, Developer displays error messages or warning
messages. For more information about the error and warning messages that occur
during Web Service Connector generation, see “WSDL Errors and Warnings” on
page 647.
Note: After Developer generates the Web Service Connector, you may need to edit the Web
Service Connector. For example, you might need to set user name and password values
for invoking the Web Service on the remote server.
Note: When creating the record for the input
message, Developer inserts the _port variable
into the record. The Web Service Connector
uses the _port variable as the switch value in
the BRANCH on '/_port' step to determines which
network address and binding to use to invoke
the Web Service.
SAP BC schema Each namespace to which the element
declarations, attribute declarations, and type
definitions that define the message parts
(input and output signature) belong. The SAP
BC schema name follows the naming
convention schema_messageName.
Note: In the input and output messages for WSDL documents, a multi‐dimensional part is
expressed as a SOAP Array type. Because of the flexibility of SOAP Array type, the Web
Service Connector is only guaranteed to accurately process SOAP Array types in WSDL
documents created by the WSDL generator in SAP BC Server. Other WSDL documents
may or not use SOAP Array types in a form that SAP BC Server can understand..
A <service> element that contained one <port> named
AuthorizeCreditCardPortType.
A single <operation> element named AuthorizeCreditCard.
On the Input/Output tab for the Web Service Connector, notice that the Web Service
Connector uses references to the input and output records to define the service signature.
Developer inserts flow steps into the Web Service Connector by following an internal
template for inserting input data into the service request, sending the request, processing
the response, and adding service output values to the pipeline. The template that
Developer follows depends on the protocol specified in the WSDL document. The
following illustration shows the Web Service Connector generated for the Web Service
that performs credit card authorization.
This SEQUENCE
corresponds to a binding
for the SOAP RPC
protocol.
Note: The $default step handles cases where the value of the _port variable at run time does
not specify a valid port name. The $default port corresponds to the first named <port>
element in the WSDL document.
A client can FTP an XML document to a service.
A client can Email an XML document to a service.
A client can send the XML document as an e‐mail attachment.
import com.wm.app.b2b.client.*;
import com.wm.util.*;
import com.wm.data.*;
import java.io.*;
public class ArbitraryXMLClient
.
.
.
//--Load XML into orders string
1 String orders = YourLoadXMLMethod(orderFile);
//--Put input values into IData object
IData inputs = IDataFactory.create();
IDataCursor inputsCursor = inputs.getcursor();
inputsCursor.last();
2
inputsCursor.insertAfter("orders", orders);
inputsCursor.insertAfter("authCode", authCode);
//--Submit request to server
c.connect("localhost:5555", "null", null);
3 IData outputs = c.invoke("purch", "postOrder", inputs);
c.disconnect();
.
.
.
On the server, purch:postOrder should be coded to pass the XML document in orders to
pub.web:stringToDocument. This will produce a node object that can be subsequently queried
or converted to an IData object. For information about the services that you can use to
manipulate node objects, see pub.web:queryDocument and pub.web:documentToRecord in the SAP
BC Built‐In Services Guide.
import com.wm.app.b2b.client.*;
import com.wm.util.*;
import com.wm.data.*;
import java.io.*;
public class ArbitraryXMLClient
{
public static void main(String args[])
throws Exception
{
//--Read XML document from a specified file (or from stdin)
Context c = new Context();
IData inputs = IDataFactory.create();
IdataCursor inputsCursor = inputs.getCursor();
Reader in = null;
if(args.length > 0)
{
in = new InputStreamReader(new
FileInputStream(args[0]));
}
else
{
in = new InputStreamReader(System.in);
}
char[] buf = new char[8192];
int count = 0;
StringBuffer sb = new StringBuffer();
while((count = in.read(buf)) != -1)
{
sb.append(buf, 0, count);
}
//--Assign XML document to string variable
String xmldata = sb.toString();
//--Put XML document into $xmldata in IData object
inputsCursor.last();
inputsCursor.insertAfter("$xmldata", xmldata);
//--Submit request to server
c.connect("localhost:5555", "null", null);
IData outputs = c.invoke("sales", "getOrder", inputs)
c.disconnect();
//--Display the returned output values
System.out.println(outputs);
}
The service invoked by this client must be a service that takes a node as an input variable
(e.g., queryDocument, documentToRecord), since this is what SAP BC Server produces when it
receives this request.
Important! The example above shows a Java‐based client; however, any type of SAP BC
client can be used., even a browser‐based client. With a browser‐based client, you would
post the XML document as the value portion of a $xmldata=value pair. You would most
likely construct the XML document with Javascript. You may post other name=value pairs
with the request.
Address the request to the URL of an service (e.g.,
http://rubicon:5555/invoke/purch/postOrder)
Set the Content‐Type header field to text/xml
Contain an XML document in the body of the message. The document must be the
only text that appears in the body of the request. Do not assign it to a name=value
pair.
Important! When you submit the XML document, place an extra carriage return/new line
(\r\n) at the end of it to indicate the end of the document.
The following example describes the values that you set if you use pub.client:http to POST an
XML document to a service.
headers.Content‐Type text/xml
data.string The XML document that you want to post.
–OR–
data.bytes
You will also set any optional HTTP parameters, such as authorization information, that
are required by your application.
The service to which you want to pass the document must take a node as input.
Important! Note that the root directory for this operation is your SAP BC Server’s
namespace directory (ns), not the root directory of the target machine. Therefore, if you
want to FTP a file to a service in the Purchasing package, you use
\ns\Purchasing\ServiceName as the path to that service, not
\<sapbc>\server\ns\Purchasing\ServiceName.
3 Copy the XML document to this directory using the following command:
put XMLDoc.xml
Where XMLDoc.xml is the name of the file that you want to pass to SAP BC Server.
Example put PurchaseOrder.xml
Note that the document you FTP to SAP BC Server is never actually written to the
server’s file system. The document you send and the output file it produces (see
below), are written to a virtual directory system maintained in your SAP BC session.
The name of the output file to which results are written is:
XMLDoc.xml.out
Where XMLDoc.xml is the name of the XML file initially FTPed to the service. You
retrieve this document using the FTP “get” command. For example, if you put a
document called PurchaseOrder.xml on SAP BC Server, you would use the following FTP
command to get its results:
Example get PurchaseOrder.xml.out
Important! We recommend that you make each document name that you FTP to SAP BC
Server unique (perhaps by attaching a timestamp to the name) so that you do not
inadvertently overwrite other FTPed documents or their results during an FTP session.
When you end the FTP session, SAP BC Server automatically deletes the original file and
its results from your session.
Set the email’s Content-Type header to text/xml
Specify the name of the service that will process the document in the email’s subject
line. If you leave the subject line empty, the document will be processed by the global
service if one is defined or, if not, by the default service assigned to the email port (if
one has been assigned). For information about specifying the port’s default service,
see the SAP BC Administration Guide.
The service that will process the XML document must take a node as input.
The following example describes the values that you would set if you used pub.client:smtp to
email an XML document to a service. (For more information about using this service, see
the SAP BC Built‐In Services Guide.)
attachments.contenttype A String set to: text/xml
attachments.content The byte [] or a String containing the XML document.
–OR–
attachments.filename A String specifying the fully qualified name of the file
containing the XML document.
If the service has an output template assigned to it, that template is applied to the
results.
Important! By default, the email port does not return any results from requests that it
receives. If you want the port to return results, you must explicitly configure it to do so.
For information about configuring the email port to return results, see your SAP BC
Administration Guide.
Basic Concepts
To successfully use SAP BC Server’s load and query services, you should understand the
following terms and concepts.
What Is Parsing?
Parsing is the operation that the server performs to convert an HTML or XML document (a
string) into a Document object whose elements can be addressed and extracted by services.
SAP BC Server automatically parses documents that you fetch with the loadDocument
service.
What Is a Node?
A node is a Document object or an element of a Document object. Services that require a
node as input or produce a node as output have the variable name node declared as an
input or output parameter.
Important! You may use a Document object anywhere a node variable is specified; however,
you cannot use a node when a document variable is specified. Because a node is a subset of
a Document object, it does not include certain document‐specific elements that are
inherently part of a Document object.
What Is a Query?
With respect to XML and HTML documents, a query is an expression, written in the XML
Query Language (XQL) or the webMethods Query Language (WQL) that you use to
extract (filter) information from XML or HTML documents. (WQL was referred to as
“WOM” in earlier releases of SAP BC Server.)
Note: If you want to fetch a document from a local file system, do not use loadDocument.
Instead, use the pub.file:getFile service.
Important! The following procedure explains how to manually insert and specify the
loadDocument service. If you are constructing a “load and query” service, however, you
may want to use the wizard instead. This wizard allows you to build a load and query
sequence by pointing to a URL or recording the actions in a browser. For information
about using the wizard to create a load and query sequence, see “Load and Query
Shortcuts” on page 427.
1 In the Service Browser, select the service in which you want to insert loadDocument.
2 Click on the Flow Editor toolbar, and select loadDocument. (If loadDocument does
not appear on the menu, click Browse and select pub.web:loadDocument from the list next
to Folder.)
3 Click the Pipeline tab if it is not already displayed.
4 Complete the following steps to specify the URL of the document that you want to
retrieve.
1 In Service In, select url.
2 Click on the toolbar.
3 Type the URL, starting with http: or https:, and then click OK.
Examples
The following string would retrieve the specified document via http:
http://www.rubicon.com/orders/orders.xml
The following string would retrieve the document via https:
https://www.rubicon.com/orders/orders.xml
Do one of the following:
Use the Map modifier to assign a pipeline variable to url.
–OR–
Do one of the following:
Use the Map modifier to assign a pipeline variable to method.
–OR–
Select get or
post from the list.
Do one of the following:
Use the Map modifier to assign a pipeline variable to the type, user, and/or pass
elements as needed.
–OR–
Important! If you include your data with the string in url, do not specify a value in data.
The data variable is a Record that contains several predefined elements. Each element
allows you to specify data in a different way. (Note that some elements are valid for only
one HTTP method—GET or POST.)
Note: If you submit data using the args or table element, loadDocument automatically sets the
HTTP Content‐Type header to application/x-www-form-urlencoded. If you want to
specify a different Content‐Type, use the string or bytes element to submit your data, not
args or table.
Insert the “&” character between each name=value pair that it
constructs from the args (for POST and GET). You do not have
to include this character in the values you specify.
Insert the “?” character at the beginning of the query string it
generates from args for the GET method. You do not have to
include this character in the values you specify.
Important! If you need to specify multiple values for a single variable
(e.g., a=b&a=c&a=d), use the table element.
Note: When you use more than one element to submit data with
loadDocument, args is appended first, table is appended second, and
string is appended last.
The following procedure describes how to use the Pipeline Editor to
assign data to args in a flow service.
1 Select the loadDocument step in the Flow Editor, and then click
the Pipeline tab.
2 In Service In, select args.
3 Click on the toolbar and select String.
4 Type the name portion of the first “name=value” pair, and
press ENTER.
5 Click to make that element a child of args.
6 If you want to assign a hard‐coded value to this element, do the
following:
Insert the “&” character between each name=value pair that it
constructs from table (for both POST and GET). You do not
have to include this character in the values you specify.
Insert the “?” character at the beginning of the query string its
generates from table for the GET method. You do not have to
include this character in the values you specify.
Important! When you use args and table to submit data with
loadDocument, the service appends args first and table second. The
service appends string last.
The following procedure describes how to use the Pipeline Editor
to assign data to table in a flow service.
1 Select the loadDocument step in the Flow Editor, and then click
the Pipeline tab.
2 In Service In, select table.
3 If you want to assign a set of hard‐coded values to table, do the
following:
2 Click twice to create two columns (0 and 1).
3 Click to create an empty row.
4 Select cell 0 and type the name of the name=value pair that
you want to submit to the Internet resource in url. (If you
are sending an unnamed variable, leave this cell empty.)
5 Select cell 1 and type the value of the name=value pair that
you want to submit to the Internet resource in url. (If
specifying an unnamed variable, type the variable’s
value.)
6 Repeat steps 3 – 5 for each variable that you want to
specify.
7 Click OK.
4 If you want to assign a pipeline variable to table, click and
map the element to the appropriate variable in Pipeline In.
(Note that the variable you map to table must be a two‐column
table of strings.)
Important! When you use more than one element to submit data
with loadDocument, args is appended first, table is appended second,
and string is appended last.
Important! loadDocument only uses the bytes when method is set to
POST.
Note: When you use bytes and another element (args, table, or string)
to submit data with loadDocument, the service appends the data
from the args, table, or string element to url. The service appends
args to url first, table second, and string last. The service encodes the
data from the bytes element in the body of the post.
Important! In most cases, the default headers that loadDocument uses are adequate. You
should not add or change request header fields unless you are thoroughly familiar with
the HTTP protocol.
If you want to assign specific values to header fields used by loadDocument, keep the
following points in mind:
When you specify the value of a header field, you override whatever default value
SAP BC Server is configured to use for HTTP requests. For example, if you set the
User‐Agent header field to BC/3.0, the server uses that value instead of the default
value specified by the watt.net.userAgent parameter.
The loadDocument service automatically determines the value of the Content‐Length
header field. You cannot specify a value for Content‐Length.
Be aware that when you submit data using the args or table elements, loadDocument
automatically sets the Content‐Type header field to application/x-www-form-
urlencoded. You cannot override this setting using the headers variable. If you want
to explicitly specify a content type in headers, make sure to use the string or bytes
element to submit your data, not args or table.
Certain header fields are automatically derived from other input parameters assigned
to loadDocument. For example, the Authorization header field is automatically derived
from your auth parameter setting. Except for the Content‐Length header field and the
Content‐Type header field (which, as described above, you cannot override when
submitting data via args or table), a value that you specify in headers overrides the
value that loadDocument might otherwise derive from other parameter settings.
The loadDocument service does not validate data that you specify in headers. It simply
passes it on to the target server in the request header. Make sure you specify header field
names and their values correctly. For a complete list of valid request header fields, see
http://www.w3.org for the latest HTTP specification published by the W3C.
To specify request headers in headers, create a string element for each header that you
want to specify, where:
The name of the element defines the name header field (e.g., User‐Agent, If‐Modified‐
Since, Mail_Address), and…
The value of the element specifies the value you want assigned to that field.
The following procedure describes how to use the Pipeline Editor to assign values to
headers in a flow service.
1 Select the loadDocument step in the Flow Editor, and then click the Pipeline tab.
2 In Service In, select headers.
3 Click on the toolbar and select String.
4 Type the name of the header field that you want to specify. (You do not need to type a
colon after the field name—loadDocument will automatically insert the colon when it
inserts this field into the request header.)
5 Click to make the element a child of headers.
6 If you want to hardcode the value of this element, do the following:
7 If you want to assign a value from the pipeline to this element, click and map the
element to the appropriate variable from Pipeline In.
8 Repeat steps 3 – 7 for each header field that you want to submit.
The following procedure describes how to use the Pipeline Editor to assign values to
encoding in a flow service.
1 Select the loadDocument step in the Flow Editor, and then click the Pipeline tab.
2 In Service In, select encoding.
3 If you want to hardcode the value of this element, do the following:
3 Click OK.
4 If you want to assign a value from the pipeline to this element, click and map the
element to the appropriate variable from Pipeline In.
Do one of the following:
Use the Map modifier to assign a pipeline variable to expandDTD. The pipeline
variable must set expandDTD to a value of true or false. (This value is case‐
sensitive.)
Value Description
autoDetect Parses the document based on its <!DOCTYPE HTML …> or <?xml
version=…?> tag. If it cannot determine what type of document it has,
it parses it as an HTML document.
false Parses the returned document as HTML.
true Parses the returned document as XML.
If you know what type of document loadDocument will receive, we suggest that you
explicitly set isXML instead of using autoDetect. It will cut processing time, because the
server will not have to examine the document to determine its type. The default value is
autoDetect.
Do one of the following:
Use the Map modifier to assign a pipeline variable to isXML. The pipeline variable
must set isXML to a value of autoDetect, true, or false. (This value is case‐
sensitive.)
Value Description
bytes Passes the parsed document as a byte array. You use this setting when
the output from loadDocument will be used as input to a service that
operates on whole documents (e.g., pub.web:queryDocument and
pub.web:documentToRecord).
stream Passes the parsed document as an input stream. You use this setting
when the output from loadDocument will be used as input to a service that
can incrementally process a document (e.g., pub.web:getNodeIterator).
If you do not explicitly set loadAs, loadDocument sets it to bytes.
Do one of the following:
Use the Map modifier to assign a pipeline variable to loadAs. The pipeline variable
must set loadAs to a value of bytes or stream. (This value is case‐sensitive.)
Value Description
false The service does not fail based on the HTTP status code returned by the
remote server. This is the default value
true The service fails if the remote server returns an HTTP error. The
exception message contains the HTTP error code, which is determined by
the W3C HTTP specification.
Do one of the following:
Use the Map modifier to assign a pipeline variable to failOnHTTPError. The
pipeline variable must set failOnHTTPError to a value of true or false. (This value is
case‐sensitive.)
Common reasons for loadDocument to fail include:
url does not begin with http: or https:
isXML is true, but the document contains poorly‐formed HTML.
You have attempted to access a protected document without authorization (i.e.,
missing or incorrect user auth/user and/or auth/pass settings).
loadDocument receives a syntactically incorrect document that cannot be parsed.
An “Out of Memory” error.
An HTTP error (e.g., the server cannot locate the requested document).
Network timeout.
method is not GET or POST.
An HTTP error, such as “404 file not found” occurs.
The means that you use to obtain an HTML or XML document, convert it to a node, and
pass it to the queryDocument service is a design decision that you must make before you
begin building your flow.
In an XML document, you might use an XQL query that looks like this to extract the
phone number from an element called supplierInfo in a SalesOrder document:
/SalesOrder[0]/supplierInfo[0]/phoneNum[0]/text()
The queryDocument service allows you to use either language to define a query. It also
allows you to make this choice on a query‐by‐query basis—i.e., you can extract some
information from the document using XQL and other information with WQL.
The language that you use is largely determined by personal choice and the needs of your
application. Each language has a few specific features that the other does not. When you
build your service, you can test your queries using either language to decide which
provides the better results.
For a description of WQL, see Appendix B, “webMethods Query Language” on
page 571.
For a description of XQL, see The XML Query Language (XQL), at
http://www.w3.org/TandS/QL/QL98/pp/xql.html. (You can also refer to the XQL
overview in <sapbc>\developer3\doc\ExampleXQL.txt.)
Note: Although you can define queries without loading a sample document, having one
allows you to create your queries faster and more accurately.
To load a sample document into Developer, you execute your flow in “trace” mode (i.e.,
on the Test menu, click Trace). When you do this, Developer displays the parsed document
on the Variables. (The Variables tab only appears when a queryDocument service is selected in
the Flow Editor.)
Symbol Description
An HTML or XML element (e.g., <poNum>…</poNum>). If an element
contains additional nodes, the symbol appears next to it. Click this
symbol to view additional nodes within an element.
An element attribute (e.g., name=”Intro”).
A comment.
The Sample View tab displays the results of the selected query
Important! The following procedure explains how to manually insert and specify the
queryDocument service. If you are building a “load and query” sequence, you may want to
use the wizard to build your flow instead. It allows you to quickly create a load and query
service from a URL that you specify or by recording actions you make in an Web browser.
For information about using the wizard to create a load and query service, see “Load and
Query Shortcuts” on page 427.
1 In the Service Browser, select the flow in which you want to insert the queryDocument
service.
2 In the Flow Editor, select the point where you want to invoke queryDocument, click
in the Flow Editor toolbar and select queryDocument from the list. (If
queryDocument does not appear on the list, click Browse and select
pub.web:queryDocument from the list next to Folder.)
3 Do one of the following to load your sample XML or HTML document into
Developer:
— If your flow passes a parsed XML or HTML document to queryDocument via a
loadDocument or stringToDocument step, select the Trace command on the Test
menu to execute the flow. (Make sure that the variables in the loadDocument or
stringToDocument service are already correctly specified so that it will generate
node successfully.)
— If your flow expects the server to pass a parsed XML document to it, select the
Send XML File command from the Test menu, and then do the following:
1 In the Select Test Mode dialog box, select Trace and click OK.
2 In the Select File dialog box, select your sample XML file and click Open.
4 When the trace finishes executing, click the Flow tab, select the queryDocument step in
the Flow Editor, and then select Document View on the Variables tab.
5 Create a query for each piece of information that you want to extract from the
document. See “Specifying a Query” on page 406 for detailed procedures.
6 If you use a namespace prefix to qualify element names in your query (e.g.,
/GSG:supplierInfo/name/text()), AND you want to map that prefix to a specific
namespace in the document, use the following procedure to assign the prefix to the
document’s namespace. (If you do not use namespace prefixes in your queries OR the
prefixes you use match the ones used in the document, you can skip this step.)
1 Click the Pipeline tab.
3 Click and specify the following:
Note: When nsDecls is a single IData object, the key identifies the prefix, and the value
identifies the URL. When it is a Vector, nsDecls contains a collection of IData objects
as defined above. When it is a String[][2], the first column is the prefix and the second
is the URI.
4 Click OK.
5 Repeat steps 3 and 4 for each namespace prefix that you need to define. When
you are finished, click OK to close the Input for dialog box.
Specifying a Query
You use the Variables tab to define the queries that queryDocument will execute to populate a
set of variables. The left side of the tab displays the list of variables that you want
queryDocument to populate. The right side of the tab contains the controls you use to build a
query that will populate a variable.
To examine and/or edit the query for a particular variable, you select the variable from the
list on the left side and view and/or adjust the settings (Query, Type, Allow Null, and so forth)
on the right.
The Variables tab defines the variables that queryDocument will produce
There are two ways you can define a variable (and the query that will populate it) for
queryDocument:
You can manually type the query into the Variables tab.
–OR–
You can create the query by “pointing” to the node you want to extract.
1 If the toolbar on the Variables tab is not active, click anywhere in the variable’s list box
(the white area on the left side of the tab) to activate it.
2 Click on the toolbar to create a new variable in the list.
3 Type a name for the variable and press ENTER.
4 Set the following options:
5 In the Query field, type your query and then press ENTER.
Important! When querying an XML document, make sure to type node names exactly
as they are specified in the document. For XML, node names are case‐sensitive!
(HTML node names are not.)
Developer automatically executes the query when you press ENTER. If you have a
sample document loaded, you can click the Sample View tab to display the result.
Important! To use the following procedure, you must load the source document in the
\
Document View tab. If you have not already done this, run the Test Trace command (if
queryDocument receives the node from a loadDocument or stringToDocument service) or
Test Send XML File (if queryDocument receives input directly from the server) before you
begin.
Important! The following procedure produces a query in Developer’s default query
language. To view and/or change your current default language, on the Edit menu, click
Preferences, click the General tab, and adjust the QueryDocument setting.
1 On the Document View tab, select the node for which you want to generate a query.
2 Right‐click and select Create New Variable from Node.
3 Type a name for the variable that will hold the results of the query, and press ENTER.
4 Set the following options:
5 If necessary, edit the query in the Query field. Press ENTER when you finish editing to
re‐execute the query. To view the results, click the View Sample tab. For additional
information about creating queries, see “Using WQL and XQL” below.
<?xml version="1.0"?>
<bitterrootboards>
<snowboard>
<name>Globe</name>
<type>Freeride/Freestyle</type>
<sku>A</sku>
<length>149</length>
<width>28.5</width>
<price>279</price>
<availability>true</availability>
</snowboard>
<snowboard>
<name>Pro Series</name>
<type>Freeride/Powder/Extreme</type>
<sku>B</sku>
<length>156</length>
<width>28.9</width>
<price>399</price>
<availability>false</availability>
</snowboard>
</bitterrootboards>
The arrays are indexed numerically, beginning with 0. To extract a particular element, you
specify its address within the array of which it is a member. For example, the following is
the WQL query for the first snowboard element in the previous example:
doc.snowboard[0].text
An object property specifies the type of information that you want to extract from that
element. In the WQL example above, the .text suffix specifies that you want to extract
the text contained within doc.snowboard[0]. This suffix is the object property. This
property can either be one of webMethods predefined properties or one of the element’s
attributes (e.g., WIDTH, ALIGN, HREF).
You use the .text property as follows:
doc.name[0].text
The following table describes the set of predefined properties in the webMethods Query
Language. Note that each property has two names. This provides an alternative name you
can use in cases where an element has an attribute with the same name as the WQL
property (the attribute name takes precedence over a WQL property name when the two
names are the same).
Element Attributes
In addition to the predefined properties provided by the webMethods Query Language,
you can also specify an attribute name as a property. When you specify an attribute name
as a property, the query returns the value of that attribute. For example, in the following
XML element:
<part name="Widget" sku="123456" quantityonhand="5000">
</part>
You would use the following query:
doc.part[0].sku
To extract the following from the SKU attribute:
"123456"
To extract multiple members from an object array, you can specify those objects using
special index notation as shown in the following examples.
For a complete description of the index value options, see Appendix B, “webMethods
Query Language” on page 571.
<snowboard>
<name>Trauma</name>
<type>Freestyle/Pipe/Park</type>
<sku>E</sku>
<length>153</length>
<width>29.4</width>
<price>367</price>
<availability>true</availability>
</snowboard>
Can be referenced in either of the following ways:
doc.name[1].text
doc.snowboard[1].name[0].text
The index value varies, depending on which parent elements you include in the reference.
The first container in a WQL query is always doc, which references a node.
Besides table references, other queries can create a table as a result. For example, the
following query gets all bolded text from all list items in an HTML document:
doc.ul[0].li[].b[].text
Its result may be one or more bolded items from each list item. To hold this type of output,
the variable must also be a String Table.
Note: References that combine more than two arrays are collapsed into two‐dimensional
tables.
Returns every bitterrootboards element that contains the string “Pro Series” anywhere
within it.
Wildcard Symbols
Pattern‐matching strings used in place of an index value can include the following
wildcards:
Note: Match strings are case‐sensitive.
Examples
This example will return every bitterrootboards element that contains the string “Pro
Series” anywhere within it. For information about regular expressions, see Appendix D,
“Regular Expressions” on page 585.
Attribute Matching
By default, match strings are compared with the .text property of the specified elements;
however, you can match on other properties by specifying that property and a match
string as shown in the following example.
doc.a(HREF='*webmethods.com*').src
This example extracts all hypertext links to “*webmethods.com*”.
Important! When you want to search a specific property, you must enclose the property
assignment statement in parentheses, not brackets.
To get the text from all table cells having a width value of 8% from all elements named
“sku”, you would use the following:
doc.sku.td(width='8%').text
Returns all of the text from the specified snowboard element. If you want to extract only a
portion of the returned text, you can apply a mask to the text property to eliminate
unwanted information. For example, the following object reference:
doc.snowboard[1].text['&list*']
Eliminates the word “list” and every character that follows it.
The following table describes the symbols you use to construct a mask:
A mask pattern is matched against the text of an object reference until the pattern is
exhausted, and any remaining characters will be included in the result.
Examples
This example will eliminate the word “list” and every character that follows it from the
result. For information about regular expressions, see Appendix D, “Regular
Expressions” on page 585.
You can use the following query:
doc.p[0].line[2].text
You can also reference lines of text within a <PRE> element in the same way. For example,
to get the second line in the following segment of preformatted text:
<PRE>
ITEM DESC QTY UPRICE TOTAL
06-5449 1” ITC Casing 250 .43 $ 107.50
010-13 #4 PVC Line 50 23.50 $1175.00
00901R Tak Connector 25 3.50 $ 87.50
</PRE>
You use the following query:
doc.pre[0].line[1].text
Like other elements, you can use numeric ranges or pattern‐matching strings as the index
to the line array.
Examples
The combination of character ranges and line array allows you to create very complex
queries and gives you tremendous flexibility in getting specific data from text objects. For
example, the following query:
doc.pre[0].line[*connector*].text[43-50]
Gets the text from columns 43 through 50 of any line in the first preformatted element
containing the string “connector.”
The collection of all elements with a certain tag name is expressed using the tag name
itself. This can be further qualified by indicating that the scope is the current context “/”,
but the current context is assumed and need not be noted explicitly.
Example
To select all poNum elements, the following are equivalent:
/poNum
poNum
You use the text() method as follows:
/SalesOrder/poNum[0]/text()
The following table describes the set of predefined methods in XML Query Language.
Element Attributes
In addition to the predefined methods provided by XQL, you can also specify an attribute
name in a query. When you specify the “@” character and an attribute name, the query
returns the value of that attribute. For example, in the following XML element:
<part name="Widget" sku="123456" quantityonhand="5000">
</part>
You would use the following query:
part[0]/@sku
To extract the following from the SKU attribute:
"123456"
If you want to extract all values of all attributes within an element, you use the at (@) and
asterisk (*) wildcard characters. This is useful if you want to treat attributes as fields in a
record. For example, in the following XML element:
<part name="Widget" sku="123456" quantityonhand="5000">
</part>
You would use the following query:
part[0]/@*
To extract the following from the part element:
"Widget" "123456" "5000"
Important! Attributes cannot have path operators nor indices appended to them in a query.
Such queries will result in syntax errors.
<buyerInfo>
<companyName>Global Sporting Goods</companyName>
<accountNum>GSG-970414-0A</accountNum>
<phoneNum>(216) 741-7566</phoneNum>
<faxNum>(216) 741-7533</faxNum>
<addr>
<streetAddr1>10211 Brookpark Rd
</streetAddr1>
<city>Cleveland</city>
<state>OH</state>
<postalCode>22130</postalCode>
</addr>
<purchEmail>buyers@GSG.com</purchEmail>
<purchRep>Caroline Wielman</purchRep>
</buyerInfo>
<supplierInfo>
<companyName>Bitterroot Boards, LLC</companyName>
<vendorNum>8444 99731 Q64500</vendorNum>
<phoneNum>(406) 721-5000</phoneNum>
<faxNum>(406) 721-5001</faxNum>
<addr>
<streetAddr1>Suite 441</streetAddr1>
<streetAddr2>1290 Antelope Dr</streetAddr2>
<city>Missoula</city>
<state>MT</state>
<postalCode>59801 1290</postalCode>
</addr>
<salesEmail>orders@GSG.com</salesEmail>
<salesRep>Marc Norgaard</salesRep>
</supplierInfo>
<order>
<lineItem>
<stockNum>BK-XS160</stockNum>
<desc>Extreme Spline 160 Snowboard- Black
</desc>
<qty>10</qty>
<uPrice>149.00</uPrice>
<extPrice>14900.00</extPrice>
</lineItem>
Can be referenced in either of the following ways:
//companyName[1]/text()
//supplierInfo[0]/companyName[0]/text()
The index value varies, depending on which parent elements you include in the reference.
The first several characters are path operators. You use these operators to “drill‐down”
levels in the document you are querying. The “/” operator before an element indicates the
immediate child; the “//” operator indicates any descendant from the current context. See
the examples below.
Using Wildcard Characters for Child Elements
You can specify all child elements of a parent element by using an asterisk (*) character.
See the examples below.
Filtering Elements that Contain a Specific Child Element
You can specify elements that contain a particular child element. See the examples below.
Note: You can also filter elements using Boolean logic. For details, see “Specifying
Elements with Boolean Expressions” on page 425.
You can also use the “/” character to specify the text of a child element. For example, the
following query returns every supplierInfo element that contains “Bitterroot Boards,
LLC” in the companyName elements in the document:
//supplierInfo[companyName/text()='Bitterroot Boards, LLC']
If you want to return all elements that contain a certain string in any form, you can use the
following regex(pattern) function. For example, the following query returns the text of all
AcctNum elements that contain the string “0100” anywhere within them:
//AcctNum[regex("0100")]/text()
Returns every companyName element with the namespace “buyerInfo” anywhere in the
document.
Note: For the purposes of comparison, value( ) is implied if omitted. Keep in mind that the
value is treated as a string unless you specify otherwise. To compare numeric values, use
the integer( ) or float( ) method on both sides of the expression. For example,
//uPrice[float(.)<float('9.99').
In addition, when an element reference is used in a comparison, you must only specify
one element for comparison. For example, //LineItem[qty>/PO/AcctNum[]] is not a
valid query, because all AcctNum elements are specified for comparison.
A syntax error in a query string.
A query fails the “Allows Nulls” test.
The node variable does not exist or it is null.
The following table describes the set of default variables the wizard can produce when it
builds a load and query service.
Important! Default variables are not usually used by the service you build (although you
may use them if they suit your purpose). They are provided primarily as guides for
locating and examining information in a document during the development stage. You
usually delete the default variables after you finalize the variable list for queryDocument.
Edit the input values for the loadDocument and/or queryDocument service.
Insert additional steps into the flow.
Copy the loadDocument and queryDocument services into another flow.
1 On the File menu, click New.
2 In the New dialog box, select Flow Service, and click Next.
3 In the New Flow Service dialog box, next to Folder, select the folder in which you want to
save the service.
4 In the Name field, type a name for the service, and click Next.
5 Select Load and Query an HTML Page and click Next. (Even though the option refers to an
HTML document, you can use this option with XML documents, too.)
6 In the URL field, type the URL of the resource you want to query and click Next. (The
URL you specify must begin with http: or https:.)
Example http://www.rubicon.com/orders/orders.html
7 Do one of the following, depending on whether you are creating this service for an
HTML or XML document:
— If you are querying an HTML document and you want Developer to generate a
set of default variables for an HTML document, select one or more of the
following options.
Select… To create…
Title A String containing the title of the document.
Anchors A String List containing all the HREF= values from the
document.
Paragraphs A String List containing the text of every paragraph in the
document.
Tables A String List containing the text from every table in the
document.
Forms A Record List containing information about each form in the
document.
Lists A String List containing the text from all of the list items in the
document.
8 Do one of the following depending on whether you want Developer to automatically
test (execute) the service it builds for you.
— If you want Developer to execute the service immediately after it builds it, select
one of the following options and then click Finish.
— If you do not want Developer to execute the service immediately after it builds it,
select No and then click Finish.
Important! If your service accesses a protected resource, it will not execute successfully
using any of the execution options in the preceding step. This is because the loadDocument
service does not have the auth values it needs to retrieve the requested document
successfully. To create a load and query for a protected resource, select No in the
preceding step. Then, after Developer generates the service, assign the appropriate
username and password to the auth variable and execute the service manually from the
Test menu
The Browser Recorder is useful for generating flows for complex Web sites and for
capturing the URLs of documents that are accessed through Javascript or derived from an
image map.
1 On the File menu, click New.
2 In the New dialog box, select Flow Service and click Next.
3 In the New Flow Service dialog box, next to Folder, select the folder into which you want
to save this service.
4 In the Name field, type a name for the service, and click Next.
5 Select Record in Browser and click Next.
6 In the URL field, type the URL of the HTML page you want to query and click Record.
(The URL you specify must begin with http: or https:.)
The wizard will launch your Internet browser and display the requested page. From
this point forward, the wizard will capture the URLs of each page you visit via a
hypertext link or an HTML form. The URLs of pages you visit are shown on the URLs
Visited list.
Note: You may want to arrange the windows on your screen so that you can see the
wizard and your browser simultaneously.
Important! The Browser Recorder cannot capture URLs that you type directly on the
address line in your browser. If you want the Browser Recorder to record the address
of a page that you visit, you must access that page through a hypertext link or an
HTML form.
7 When you are finished recording, click Next.
8 If you want Developer to generate a set of default variables for an HTML document,
select one or more of the following options, and then click Next.
Select… To create…
Title A String containing the title of the document.
Anchors A String List containing all the HREF= values from the document.
Paragraphs A String List containing the text of every paragraph in the
document.
Tables A String List containing the text from every table in the document.
Forms A Record List containing information about each form in the
document.
Lists A String List containing the text from all of the list items in the
document.
9 Do one of the following, depending on whether you want Developer to automatically
test (i.e., execute) the service it builds for you.
— If you want Developer to execute the service immediately after it builds it, select
one of the following options and then click Finish.
— If you do not want Developer to execute the service immediately after it builds it,
select No and then click Finish.
Note: Regardless of how you generate them, database flow services are all standard flow
services that call the pub.db:execSQL service. To examine a flow you have generated,
open it in the Developer.
If you want to change the SQL statement the flow service executes, open that service in
Developer and change the $dbsql parameter in the INVOKE execSQL step in the flow.
Important! The generated flow service is unable to properly call a stored procedure. It is
unable to return the result set or output parameters. If you want to call a stored
procedure, create the service in Java, C/C++, or Visual Basic and call the stored procedure
using the pub.db:call service.
The service expects input for the value to use to match rows in the Last_Name
column.
Example
To add a new row to the Addresses table and populate it with specified values,
specify the following SQL statement:
insert into Addresses (name,street,city,state,zip) values (?,?,?,?,?)
The service expects input for the values to use to populate the new row.
Template tags. The template tags you can use in an SQL statement are the same tags
you use in an output template. Besides allowing you to specify the values of
individual input parameters, template tags also allow you to dynamically construct
entire portions of the SQL statement at run time. (For a complete list of template tags,
see Building Output Templates and DSPs.)
When you use template tags in an SQL statement, it cannot be tested with the Server
Administrator. (The Server Administrator does not recognize template tags and will
not prompt you for input when you execute the service) To test a service that uses
template tags, you must open that service in Developer and add to its input
parameters any variables that are referenced in a tag. Once you do this, you can test
the service with Developer and it will prompt you for each input variable you
defined. (For information about declaring input parameters for a service, see
“Specifying Input Parameters” on page 82.)
Example
The following shows an SQL statement that selects all rows satisfying the criteria that
will be specified in a variable named condition at run time:
select * from Names where %value condition%
At run time, the server will substitute the value of condition for the %value% tag. The
following shows examples of what you might use as the value of condition:
name = 'Steve'
name like 'Jim%'
Example
To delete all rows from the Music table that meet a specified condition, specify the
following SQL statement:
delete from Music where %value outdated%
The service expects input for an input variable named outdated that it uses to replace
the entire token. Following is an example of what a user can specify for %value
outdated%:
ReleaseDate < '1950'
Format = '8-track'
1 Open the Server Administrator if it is not already open. See the SAP BC Administration
Guide if you need procedures for this step.
2 Select the Database task in the navigation area.
3 Click the Service Generation tab if it is not already displayed.
4 Select the database you want the service to access from the Source Alias list.
5 Select the package in which you want the service to reside from the list in the Package
field.
6 Type the folder name for the service in the Folder field.
7 Type the name for the service in the Service field.
8 Click Generate from SQL.
9 Enter the SQL statement you want the service to execute in the Enter SQL statement
section of the screen.
10 If you included template tags in the SQL statement, click the Process SAP BC template
tags (%value, %ifvar, etc.) in this SQL statement check box.
11 Click Evaluate. The server displays the Input Binding Generation screen.
If you specified question marks (?) in the SQL statement for input values, the server
displays a Bind parameters section of the screen. There is one Parameter n field for each
question mark you specified in the SQL statement. The first question mark you
specified corresponds to Parameter 0, the second to Parameter 1, and so forth.
12 Use this section of the screen to indicate additional information about the input
parameters that a user will supply in place of the question marks. For each Parameter n
field in the Bind parameters set the associated parameters as follows:
13 Click Generate.
Table type. The type of the tables for which you want information. You can choose
from the following common JDBC table types: Table, View, System Table, Global
Temporary, Local Temporary, Alias, and Synonym.
1 Open the Server Administrator if it is not already open. See the SAP BC Administration
Guide if you need help with this step.
2 Select the Database task in the navigation area.
3 Click the Service Generation tab if it is not already displayed.
4 Select the database you want the service to access from the Source Alias list.
5 Select the package in which you want the service to reside from the list in the Package
field.
6 Type the folder name for the service in the Folder field.
7 Type the name for the service in the Service field.
8 Click Generate from table. If you are accessing a large database, you might want to
restrict your search to the tables with which you want to work.
— To restrict your search, fill in one or more fields in the Restrictions section of the
screen, and then click Connect. For more information about how to restrict the
search, see “Restricting the List of Database Tables” on page 439.
— To search all database tables, click Connect.
9 In the Select a table section of the screen, click the table name that you want to use to
generate the service.
10 Select the database operation that you want the service to perform (Select, Insert,
Delete, or Update) from the Service type section of the screen.
11 Select the columns that you want to use as input in the Columns section of the screen.
When the service is executed, it will expect input values for each of the columns you
select. The service uses the input values as follows:
12 Click Generate SQL.
If you selected any columns for input variables, the server displays a Bind parameters
section of the screen. There is one Parameter n field for each input variable you
specified in the SQL statement.
13 Use this section of the screen to indicate additional information about the input
parameters. For each Parameter n field in the Bind parameters set the associated
parameters as follows:
14 Click Generate.
Any flow service that you create in Developer by using the INVOKE flow step
Clients
The SAP BC Built‐In Services Guide contains a list of built‐in database services and shows
input and output information for each. Your service or client must invoke the built‐in
database service that opens a connection to a database before it can invoke any of the
other built‐in database services.
1 Open the Server Administrator if it is not already open. See the SAP BC Administration
Guide if you need procedures for this step.
2 Select the Database task in the navigation area.
3 Click the Service Generation tab if it is not already displayed.
4 Select the database for which you want to issue a SQL statement from the Source Alias
list.
5 Select any package from the Package list, and type a folder name in the Folder field and
a service name in the Service field. It does not matter what you specify in these fields
because you will not be creating a service.
6 Click Generate from table.
7 If you are accessing a large database, you might want to restrict your search to the
tables with which you want to work.
— To restrict your search, fill in one or more fields in the Restrictions section of the
screen, and then click Connect. For more information about how to restrict the
search, see “Restricting the List of Database Tables” on page 439.
— To search all database tables, click Connect.
8 In the Test SQL Queries section of the screen, type the SQL statement you want to test.
9 Click Execute query.
The server displays a screen that lists the results from your SQL query.
Error Handling
Some database services return a $dbMessage output value which contains a text message
that describes the results of the service. If the service results in an error, the service also
returns standard error output values.
Clients coded in Java, C/C++, or Visual Basic
Name Joe B
The pub.db:insert service converts the inputs as follows:
import com.wm.data.*;
import com.wm.app.b2b.client.Context;
//
// connect to your integration server using an appropriate user
// name and password (doesn't have to be Administrator)
//
Context ctx = new Context();
ctx.connect ("localhost:5555", "Administrator", "manage");
//
// (1) request a DB connection by DB alias (if the DB
// changes location or something, we won't have to change
// this client code)
//
in = IDataFactory.create();
IDataCursor inCursor = in.getCursor();
inCursor.insertAfter ("$dbAlias", "Employees");
inCursor.destroy();
out = ctx.invoke ("wm.util.db", "connect", in);
//
// (2) update the Identification table to set Fonz's ID
//
// (3) look at the return values (updateCount is the
// most important in this case)
//
IDataCursor outCursor = out.getCursor();
try {
if (outCursor.first("updateCount"))
{
int uc = Integer.parseInt ((String)outCursor.getValue());
System.err.println ("Update count: "+uc);
}
else
System.err.println ("Error: no update count returned");
outCursor.destroy();
} catch (Exception e) {
// maybe something went wrong with the DB access; we
// can get more information here
outCursor.first("$error");
System.err.println ("Error: "+outCursor.getValue());
outCursor.first("$errorType");
System.err.println ("Error type: "+outCursor.getValue());
outCursor.destroy();
}
}
import com.wm.util.Values;
import com.wm.app.b2b.client.Context;
//
// connect to your integration server using an appropriate user
// name and password (doesn't have to be Administrator)
//
Context ctx = new Context();
ctx.connect ("localhost:5555", "Administrator", "manage");
//
// (1) request a DB connection by DB alias (if the DB
// changes location or something, we won't have to change
// this client code)
//
in = new Values();
in.put ("$dbAlias", "Employees");
out = ctx.invoke ("wm.util.db", "connect", in);
//
// (2) update the Identification table to set Fonz's ID
// to 6500. note that we couldn't do this from a Web
// browser because we couldn't build up the complex
// nested data structures
//
in = new Values();
in.put ("$dbAlias", "Employees");
in.put ("$dbTable", "Identification");
criteria = new Values();
criteria.put ("name", "fonzie");
in.put ("$criteria", criteria);
set = new Values();
set.put ("ID", "6500");
in.put ("$set", set);
out = ctx.invoke ("wm.util.db", "update", in);
//
// (3) look at the return values (updateCount is the
Important! You can only use the guaranteed delivery capabilities with stateless (i.e., atomic)
transactions. As a result, guaranteed delivery capabilities cannot be used with multi‐
request conversational services.
Note: For client applications, a single Job Manager runs in the client process and is shared
by multiple TContext instances. For services, a single Job Manager runs in the server
process and is shared by all TContext instances.
The default for a client application is: ./jobs
The default for a service is: <sapbc>/server/logs/jobsout
Location of the transaction Log. Specify the file in which the Job Manager maintains its
audit‐trail log of all the guaranteed delivery transaction operations it processes.
The default for a client application is: ./txout.log
The default for a service is: <sapbc>/server/logs/tx.log
Submission interval for the Job Store. Specify the number of seconds between sweeps of
the job store. The Job Manager sweeps the job store to submit transactions to a SAP
BC Server.
The default is: 60 seconds
The default is: 60 seconds
Number of Client Threads in Thread Pool. Specify the number of threads you want to make
available in a thread pool to service pending requests.
The default is: 5 threads
Identifying Transactions
It is the responsibility of the client application or service to obtain a transaction ID (tid) for
each guaranteed delivery request and to specify the transaction ID with each subsequent
request for the transaction.
The client application or service obtains the transaction ID from SAP BC Server using the
startTx( ) method, which is used to start a guaranteed delivery transaction. See “Creating
a Java Client that Uses Guaranteed Delivery” on page 454 for additional instructions and
sample code.
transient. An outage that exceeds these limits will be deemed unrecoverable by the Job
Manager and will cause the Job Manager to return an error for the request.
Handling Failures
If a non‐transient error prevents your client application or service from receiving the
results from a service request, your application will receive an error message.
Records remain in the job store for a transaction until the client application or service
explicitly ends the transaction. To avoid exhausting the job store, a client application or
service must make sure to complete all the transactions it starts, or a site must establish
administrative procedures to address failed jobs.
TContext can return the following types of errors:
AccessException. The client application or service either supplied invalid credentials or
is denied access to the requested service.
ServiceException. The service encountered an execution error.
DeliveryException. The Job Manager failed and became disabled. An administrator
should be notified to correct this problem. For client applications, code your client
application to notify an administrator when this type of error occurs. After the
problem is corrected, re‐enable the Job Manager using the TContext.resetJobMgr( )
method.
For services, guaranteed delivery notifies the administrator identified by the
watt.server.txMail configuration setting. After the problem is corrected, re‐enable the
Job Manager by executing the wm.server.tx.resetOutbound service.
IllegalRequestException. The client application or service made an invalid request; for
example, supplied an invalid transaction ID (tid) or other invalid parameter.
TXException. A failure occurred with the transaction. The transaction timed out, hit the
retry limit, or encountered a heuristic error. Typically, this type of error indicates that
the transaction became inactive either because the time‐to‐live (TTL) value elapsed or
the retry limit was met. To distinguish between these two errors, use the
isExceededRetries( ) method.
Heuristic errors will only occur if you altered the default configuration of SAP BC
Server to fail PENDING requests when SAP BC Server is restarted after a failure. Use
the isHeuristicFailure( ) method to determine if a heuristic error occurred.
Note: A heuristic error does not guarantee that your transaction was not executed, only
that its results could not be returned. Keep this in mind if you are processing transactions
that must be executed once and only once (for example, an application that enters
purchase orders or pays invoices). You might also need to implement additional
mechanisms in your client application or service to ensure that a transaction does not get
posted twice.
Important! To compile the following sample code (or any Java client that uses guaranteed
delivery), you must include the following Import statements in your Java program.
Import com.wm.app.b2b.client.*;
Import com.wm.util.*;
1 TContext tc = null;
# Step Description
1 Declare TContext Declare TContext as a variable.
2 Initialize TContext. Initialize TContext and specify the job store directory and
audit‐trail log. The Job Manager starts.
Important! Do not include this step if your client will run as
a service on a SAP BC Server. This function is
automatically performed by the server and must not be
included in your code.
# Step Description
3 Instantiate Create a new TContext object.
TContext.
4 Establish Execute connect() to specify the SAP BC Server on which
connection you want to invoke services using this context.
attributes for the
TContext instance. Note: Multiple threads can share an instance of TContext as
long as they use the same connection attributes—i.e., they
use the same SAP BC Server and user ID/password
established by that instance of TContext.
To set other connection attributes, use methods in the class
Context such as the protocol to use (HTTP or HTTPS) and
the proxy to use.
5 Start the Execute startTx() to obtain a transaction ID (tid) and
transaction. specify the transaction time‐to‐live (TTL).
6 Invoke the service. Execute invokeTx() to invoke a service.
Note that you pass the transaction ID (tid) as the first
parameter to this method.
Note: This particular example passes input and receives
output in a Values object. You could also use an IData
object to do this.
7 End the Execute endTx() to end the transaction. This method clears
transaction. the record for this transaction from the Job Managerʹs job
store.
8 Check for errors. Check for the different types of errors. Always check for
Service Exceptions last.
9 Close the session Execute disconnect to end the use of this instance of
on SAP BC Server. TContext. The application should not perform this step
until it is done because disconnect unregisters TContext
with the Job Manager.
10 Shutdown The Job Manager ends.
Important! Do not include this step if your client will run as
a service on a SAP BC Server. This function is
automatically performed by the server and must not be
included in your code.
For additional information about TContext and its methods, see the TContext class in the
SAP BC Java API Reference in <sapbc>\developer\doc\api\index.html.
/**
* Sample of a Java TContext client that uses SSL to perform a GD transaction
*/
import com.wm.app.b2b.client.*;
import com.wm.util.*;
public class TCSample {
TContext tc = null;
String privkey = "./config/privKey1.der";
String[] certFiles = {"./config/cert1.der","./config/cacert1.der"};
// initialize TContext and establish connection attributes
try {
TContext.init("./jobs", "./tx.log");
tc = new TContext();
tc.connect("localhost:5555", null, null);
tc.setSecure(true);
tc.setSSLCertificates(privKey,certFiles);
} catch (ServiceException e) {
System.err.println("Error: "+e.getMessage());
System.exit(-1);
}
// do work with TContext - get tid, call service, end tid
try {
Submit request String tid = tc.startTx(3);
System.out.println("Result="+result.toString());
tc.endTx(tid);
} catch (TXException e) {
System.err.println("Job Failed: "+e.getMessage());
System.exit(-1);
} catch (DeliveryException e) {
System.err.println("JobMgr Disabled: "+e.getMessage());
System.exit(-1);
} catch (AccessException e) {
System.err.println("Access Denied: "+e.getMessage());
System.exit(-1);
} catch (ServiceException e) {
System.err.println("Error: "+e.getMessage());
System.exit(-1);
}
// release connection and shutdown
tc.disconnect();
TContext.shutdown();
}
}
For additional information about TContext and its methods, see the TContext class in the
SAP BC Java API Reference.
Note: Internally, this service opens a session on the
server and performs startTx, so there is no need for you
to explicitly open a session on the server like you must
do in a Java guaranteed‐delivery client.
Note: Internally, this service opens a session on the
server and performs startTx, so there is no need for you
to explicitly open a session on the server like you must
do in a Java guaranteed‐delivery client.
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
Overview
SAP BC Server provides built‐in services that let you construct MIME messages, secure
them, and transport them over the Internet. It also provides services that let you extract
information from MIME messages that are passed into the pipeline, decrypting them if
necessary.
What Is MIME?
MIME—Multipurpose Internet Mail Extensions—is a standard yet flexible message
format that is used to represent messages for transmission over the Internet. The MIME
extensions were added to the Simple Mail Transport Protocol (SMTP) to allow e‐mail
transmissions to carry more than simple, 7‐bit, textual messages.
The MIME standards allow for the transmission of:
Non‐textual content such as images, audio clips, and other binary files
Messages in character sets other than US‐ASCII
Multiple files in a single transmission
Although originally developed for the SMTP protocol, MIME can be used by other
Internet technologies (such as HTTP) as a standard messaging format.
Header fields
Body
Dear Buyer,
EXP Printing has received your request for an
estimate. Your will receive a formal quote within
24 hours. Your request number is RFQ-OA000011318.
Questions? Contact customer service from 8:00am
and 6:00pm ET at 800-334-2517.
Header Fields
Header fields provide information about the structure and encoding of a message. They
consist of name:value pairs and appear at the top of the message. A MIME‐compliant
message must contain the “MIME‐Version” header field.
Besides the MIME‐Version header field, most messages have additional fields that supply
information to the agent, transport, or application that will convey or consume the
message. For example, when a MIME message carries anything other than plain, US‐
ASCII text, it must include the “Content‐Type” header field. Messages that are routed
over SMTP will also have the “Date,” “To,” and “From” header fields.
A message may also contain custom header fields that are specific to a particular agent or
application. Such application‐specific header fields must be prefixed with the characters
“X‐” to distinguish them from the standard header fields defined by the MIME and/or
transport protocols.
This chapter does not attempt to describe the purpose or use of individual header fields.
However, to use MIME effectively, you will need to understand which header fields your
solution requires and know how to set them or interpret them correctly. For information
about header fields, see the following references.
Reference URL
RFC 2076 – Common Internet Message Headers http://www.imc.org/rfc2076
RFC 822 – Standard Format of Internet Text messages http://www.imc.org/rfc822
RFC 2045 – Multipurpose Internet Mail Extensions http://www.imc.org/rfc2045
RFC 2046 – MIME Media Types http://www.imc.org/rfc2046
RFC 2047 – MIME Header Extensions for Non‐ASCII http://www.imc.org/rfc2047
RFC 2048 – MIME Registration Procedures http://www.imc.org/rfc2048
RFC 2049 – MIME Conformance Criteria http://www.imc.org/rfc2049
The Body
The body of a MIME message contains the actual content of the message. It is separated
from the last header field by a blank line—a two‐byte sequence consisting of an ASCII
carriage return (CR) and an ASCII linefeed (LF) on a line by itself.
The message body can contain any sequence of data, including additional MIME
messages. It is sometimes referred to as the payload. When you send an e‐mail message,
the body of your letter resides in the body of a MIME message. Similarly, when you attach
a file to an e‐mail message, the content of the file is carried in the body of a MIME
message.
Content-Type: text/xml
Content-Transfer-Encoding: quoted-printable Part 2 header fields
--X----B164240404-----X
If a MIME message has more than one payload, its Content‐Type header field must be set
to a multipart content type (e.g., Content-Type:multipart/mixed or Content-
Type:multipart/alternative), and it must declare a boundary‐separator. The
boundary separator is a string that delimits body parts. It must appear before and after
each part in the message. (In the example above, the string X----B164240404-----X is
the boundary separator.)
Note: You may have noticed that the string separating the body parts in the preceding
example includes a few extra characters that are not part of the separator string declared
in the Content‐Type header field. This is because the MIME format requires that two dash
characters precede each separator in the message, and two dash characters follow the last
separator string in the message.
When you build a multipart message with SAP BC Server, it automatically sets the
Content‐Type header to “multipart,” declares the separator string, and inserts the
boundary separators for you.
What Is S/MIME?
S/MIME—Secure Multipurpose Internet Mail Extensions—is a standard message format
that allows MIME messages to be exchanged securely between parties over the Internet. It
provides two security mechanisms—digital signatures and encryption—based on RSA
technology and the Public Key Infrastructure (PKI).
Digital Certificates
PKI employs a system of credentials known as digital certificates—electronic documents
that represent and identify individual users. A digital certificate is like an electronic
identification card. It positively identifies a particular individual, organization, or
application.
Besides providing information about the owner of the certificate (name, organization, e‐
mail address, and so forth), a digital certificate holds the owner’s public key. Under
public/private key technology, a certificate owner has two keys. Parties that want to
exchange messages securely with the certificate owner, use the public key published on the
owner’s certificate. Transmissions secured with a public key can only be successfully
processed with the corresponding private key—a secret key that only the certificate owner
has.
Digital certificates are issued and signed by Certificate Authorities (CAs). A CA is similar
to a notary public. Its signature vouches for the identity of the individual or organization
named on the certificate and attests to the validity of the public key. It also “seals” the
certificate with a digital signature, which certifies the certificate’s contents and prevents it
from ever being altered undetected. VeriSign® and Entrust® are examples of public CAs.
They are considered “root‐level” entities. Other intermediaries, such as financial
institutions, are also permitted to issue certificates under the authority of a root CA.
You cannot verify the authenticity of a certificate without having the certificate of the CA
that issued it. If the issuing CA is an intermediary, you must also have the certificate of its
CA. The set of certificates required to trace the authenticity of a certificate back to a
trusted CA is called a certificate chain.
Note: To authenticate a certificate, some recipients require a complete certificate chain–one
that extends all the way back to a root‐level CA–while others are satisfied with a partial
chain that goes back to a specific intermediary. Always submit a complete chain unless
you know for certain that the recipient accepts partial chains.
Digital Signatures
A digital signature is a special block of data affixed to a message that assures the identity
of the sender and the integrity of the message.
A digital signature secures a message in several ways. First, it contains the sender’s digital
certificate. This allows a recipient to identify the sender and determine whether the sender
is a trusted and authorized party. In this way, digital signatures support the identification
and authorization processes.
Second, a digital signature assures a recipient that the owner of the enclosed certificate
sent the message. A digital signature is produced using the sender’s private key. If a
recipient can successfully “decode” the signature with the public key from the sender’s
certificate, the recipient is positively assured that the message is from the person or
organization identified on that certificate. This characteristic provides both authentication
(the sending party is who it claims to be) and nonrepudiation (the sending party cannot
deny issuing the message).
Finally, a digital signature assures the integrity of the message with a message digest—a
hash code that is mathematically derived from the message itself. When a recipient opens
a signed message, it recalculates the hash code and compares its result to the original hash
code in the signature. If the values don’t match, the recipient knows that the message was
deliberately or inadvertently altered after it was signed.
Note: SAP BC Server automatically sets the Content‐Type header field when you sign a
message using the S/MIME services. Your service does not need to do this.
The following is an example of an explicitly signed MIME message. Notice that the
message has two body parts: the first part contains the payload; the second part contains
the signature.
Dear Buyer,
EXP Printing has received your request for an
estimate. Your will receive a formal quote within
24 hours. Your request number is RFQ-OA000011318.
Questions? Contact customer service from 8:00am
and 6:00pm ET at 800-334-2517.
MIAGCSqSIb3DQEHACAQExCAJBgUrDgMCGUAMIGCSqGSIb3QEHAAAoIJLlCCBK
B7QwR+MIID56ADAgECAhAHcCcPP2Kg5hngAQMAV04rMA0fGCSEsb3SIGEBBmr
.
.
.
Sy/fCuYadgb1JAANuGSYE=+nQVBolVRTUUrQGH5KKKmTRPgJBwiAMQANJyTVR
6hk=
--X----B164240404-----X--
A message can also be implicitly signed. When you use this technique, the message is
encoded within the signature block, thus preventing the message from being extracted or
read unless the signature is processed by a PKCS‐enabled recipient. For this reason,
explicit signatures are preferred, because they make the message available to non‐PKCS
recipients, too.
When a MIME entity contains an implicitly signed message, itʹs Content‐Type header
field is set to “application/pkcs7‐mime.”
The following is an example of a text message that has been implicitly signed. As you can
see, the text of the message is not visible.
Encryption
Encryption is a way to ensure privacy by assuring that a message can be read only by the
intended recipient.
Encryption is performed using a pair of keys. The sending party encrypts the message
using the recipient’s public key. The recipient decrypts the message with its private key.
Since the owner of the public key is the only one in possession of the private key, only the
owner can successfully decrypt the message.
SAP BC Server supports RC2, TripleDES and DES encryption algorithms. RC2 lets you
specify a key length of 40, 64, or 128. TripleDES uses a key length of 192. DES uses a key
length of 64 (in US versions of the product) or 40 (in non‐US versions of the product).
The following is an example of an encrypted message. Note that its Content‐Type header
field is set to “application/pkcs7‐mime” (required for encrypted messages), and that the
payload contains the encrypted message.
Note: SAP BC Server automatically sets the Content‐Type header field to the appropriate
value when you encrypt a MIME message using the S/MIME services. Your service does
not need to do this.
An encrypted message
CHN8aAsGCqSGIvcNAQcCoIIJozCCCZ8CAQEzCzAJBgUrDgMCGUAMAsGCqSGIb
6ADAgECAhAHB7QwggR+MIID5cCcPP2Kg5hngAQMAV04rMA0fGCSEsb3SIGEBB
YE=+nQVBolVSy-f0CuYadgb1JAANuGSRTUUrQGH5KKKmTRPgJBwiAMQANJyTV
D56ADAgE9UyHHwggMIICAhAHcCcPP2Kg5hngAQMAV04rMA0fGCSEsb3SIGEBB
KmTRPNJyTVMhTTEr8uYadgb1BolVRTUUrOINuGSYE=+nQVBolVRTUUrQGH5KK
.
.
.
oIIJozCMIAIhvcNAQcCIJsgYJKoCCZ8CAQEzCzAJBgUrDgMCGUAMAsGCqSGIb
CSEsb3SIGEBPP2Kg5hngB7QwggR+MIID56ADAgECAhAHcCcAQMAV04rMA0fGB
0olVRTUUrdgb1JAANuGSYE=+nQVBSy-f0CuYQGH5KKKmTRPgJBwiAMQANJyTV
MrA0fGCSEsCAhAHcCcPP29UyHHwggMIID56ADAgEKg5hngAQMAV04b3SIGEBB
NuGSYE=+nQVgb1BolVRTUUrMhTTEr8uYadOIBolVRTUUrQGH5KKKmTRPNJyTV
2AAAH=
Note: Although encryption protects a message from being read by an unintended party, it
does not assure message integrity, and does not provide authentication or
nonrepudiation. These qualities are guaranteed by digital signatures.
To encrypt a message, you must have the intended recipient’s certificate, because it
contains the public key you use to perform the encryption.
Most sites simply contact the parties with whom they want to exchange encrypted
messages and request copies of their certificates (the other parties might e‐mail their
certificates to you, for example). Then, they store the certificates in their file system, a
database, or a special repository for security information.
It does not make any difference where you maintain the certificates of the parties with
whom you want to exchange encrypted messages, as long as the certificates are in X.509
format and can be retrieved by SAP BC Server at run time.
Service Description
createMimeData Creates an empty MIME object, which you use to
compose a MIME message.
addMimeHeader Adds one or more header fields to a MIME object.
addBodyPart Adds a body part (headers and content) to a specified
MIME object.
getEnvelopeStream Generates a MIME message from a MIME object.
createSignedData Digitally signs a MIME message.
createEncryptedData Encrypts a MIME message.
createSignedAndEncryptedData Digitally signs a MIME message and then encrypts it.
Service Description
createMimeData Produces a MIME object from a MIME message stream.
getMimeHeader Retrieves the header fields from a MIME object.
getContentType Retrieves the value of the Content‐Type header field from a
MIME object.
getNumParts Reports the number of body parts in a MIME object.
getBodyPartContent Retrieves the content from a specified body part in a
MIME object.
getBodyPartHeader Retrieves the header fields from a specified body part in a
MIME object.
processEncryptedData Decrypts the contents of an S/MIME object.
processSignedData Authenticates the digitally signed contents of a specified
S/MIME object.
The following diagram illustrates this process.
For example, a mimeHeader set as follows:
Name Value
To "xprint mEstimating"
<EXPEst@exprint.com>
From "Purch01@GSX.com" <Purch01@GSX.com>
X-Doctype RFQ
X-Severity 5
Would produce the following message header fields:
To: "xprint Estimating" <EXPEst@exprint.com>
From: "Purch01@GSX.com" <Purch01@GSX.com>
X-Doctype: RFQ
X-Severity: 5
Note that you do not need to explicitly set the following message headers:
Message-ID
MIME-Version
Content-Type
Content-Transfer-Encoding
These headers are automatically generated by the service that produces the finished
MIME message or are derived from parameters that you set elsewhere in your flow. If
you explicitly set these fields in mimeHeader, they will be overwritten when the MIME
message is generated.
You can set message headers before or after adding content (performing step 3,
below). Either order is permitted, as long as you set them before you generate the
finished MIME message.
Be aware that setting message headers before adding content will cause the headers to
be included in each body part of a multipart message (i.e., in every part header in the
message). To avoid this behavior, either set the message headers after you add all the
body parts or drop the mimeHeader Record from the pipeline before you add body
parts.
Tip! Instead of using addMimeHeader to add message headers, you may alternatively
pass a mimeHeader Record to createMimeData when you create the MIME object.
Besides a mimeHeader Record, you must pass to addMimeHeader the mimeData object
produced in step 1.
The addMimeHeader service does not return an output value. It simply updates the
mimeData object that you pass to it.
3 Add one or more body parts with the pub.mime:addBodyPart service. This service adds a
single body part (both header fields and content) to the MIME object. To add multiple
body parts, execute addBodyPart once for each part that you want to add. In the finished
message, body parts appear in the order in which you add them—the first body part
you add will be the first body part in the message.
Besides the mimeData object that you produced in step 1, addBodyPart takes three other
parameters: content, contenttype, and encoding.
— content is an InputStream containing the message content (the payload). Before
invoking addBodyPart, your solution must acquire or generate this content and
place it in the pipeline as an InputStream.
The way in which you acquire the content of your message depends on your
particular solution. For example, you might acquire it from a file or from a back‐
end system. Or you might manufacture it with a custom‐built service. Regardless
of how you acquire your content, keep the following points in mind:
— Your content must exist as an InputStream in the pipeline. If it exists in some
other form—e.g., a String or a byte[ ]—you must convert it to an InputStream
before adding it to the MIME object.
— The InputStream should contain only the body of the message (the payload).
Do not put header fields in the InputStream. To specify header fields, use the
contenttype, encoding, description, and mimeHeader input parameters.
Note: If your InputStream already contains header fields, you can set the
isEnvStream parameter to “true” to tell addBodyPart to pull the header fields out
of the InputStream before adding it to the MIME object. For additional
information about using the isEnvStream parameter, see the addBodyPart
description in the SAP BC Built‐In Services Guide.
— Do not encode the content before adding it to the MIME object—simply add it
in its original form. If you want to encode the content for transport, set the
encoding parameter (see below).
— contenttype is a String specifying the value of the entity’s Content‐Type header
field. Besides type and subtype, be sure to include any parameters that the header
field requires as shown in the following example:
text/plain;charset=UTF8
For a description of standard content types, see RFC 2046 ‐ MIME Media Types at
http://www.imc.org/rfc2046.
— encoding is a String specifying the value of the entity’s Content‐Transfer‐Encoding
header field. This field also specifies the scheme in which you want the entity’s
content encoded. If you set encoding to “base64,” for example, the getEnvelopeStream
service will base64‐encode the data in content when it generates the finished
MIME message.
encoding must be one of the following values:
Value Description
7bit Specifies that content is 7‐bit, line‐oriented text that needs no
encoding.
Use this value when content contains lines of 7‐bit, US‐ASCII text
(no octets with decimal values greater than 127; no NULs).
8bit Specifies that content is 8‐bit, line‐oriented text that needs no
encoding.
Use this value when content contains lines of 8‐bit text (octets with
decimal values greater than 127; no NULs).
Note: This encoding value is not recommended for messages that
will be transported via SMTP over the Internet, because
intervening servers that cannot accommodate 8‐bit text may alter
your content. To safely transport 8‐bit text, use quoted‐printable
encoding instead.
binary Specifies that content contains binary information that needs no
encoding.
Use this value when content contains an arbitrary sequence of
octets (binary data).
Note: This encoding value is not recommended for messages that
will be transported via SMTP over the Internet, because
intervening servers that cannot accommodate binary data may
alter your content. To safely transport binary data, use base64
encoding instead.
quoted- Specifies that content contains 7 or 8‐bit, line‐oriented text that you
printable want to encode using the quoted printable encoding scheme.
base64 Specifies that content contains an arbitrary sequence of octets
(binary data) that you want to encode using the base64 encoding
scheme.
uuencode Specifies that content contains an arbitrary sequence of octets that
you want to encode using the uuencode encoding scheme.
Note: Besides the content, contenttype, and encoding, parameters described above, the
addBodyPart service has a few other optional parameters you can use. For information
about these parameters, see the addBodyPart description in the SAP BC Built‐In Services
Guide.
The addBodyPart service does not return an output value. It simply updates the
mimeData object that you pass to it.
4 Generate the finished MIME message with the pub.mime:getEnvelopeStream service. After you
finish populating the MIME object, invoke getEnvelopeStream to generate a MIME
message. This service takes the populated mimeData object and produces an
InputStream called envStream, containing the finished MIME message.
When getEnvelopeStream generates a MIME message, it does the following:
— Generates the Message‐ID, MIME‐Version, Content‐Type, and Content‐Transfer‐
Encoding message headers and inserts them at the top of the message.
— Sets the Content‐Type header to “multipart,” generates a boundary string, and
inserts it between body parts if mimeData contains multiple body parts.
Note: If mimeData contains a single body part, getEnvelopeStream will, by
default, create an ordinary, single‐part message. Some solutions, however,
want a “multipart” message even if the message contains only a single body
part. If your solution requires this structure, you can use the createMultipart
parameter to tell getEnvelopeStream to generate a multipart message regardless
of the number of body parts it finds in mimeData.
— Encodes the content for each body part according to its encoding value.
Step Description
1 This step creates an empty MIME object. It does not take any inputs. It puts an
empty MIME object named mimeData in the pipeline.
2 This step adds two application‐specific message headers in the MIME object. If
you view the pipeline, you will see that the mimeHeader input variable is set as
follows:
Name Value
X‐DocType alert
X‐Severity 9
3 This step generates the content of the message. This example uses a custom Java
service to convert a String containing the following text to an InputStream:
We were not able to process your request because the account number you gave us
has expired. Please correct the account number and resubmit your request.
In practice, you are more likely to acquire your content from a file, the network,
or a back‐end system.
4 This step adds the content produced by step 3 to the mimeData object. If you
view the pipeline, you will note that the stream output variable from step 3 is
mapped to this step’s content input variable. Because content contains a simple
text message, the contenttype and encoding parameters are set as follows:
Parameter Value
contenttype text/plain;charset=UTF8
encoding quoted-printable
isEnvStream is set to “no” because the payload is not a MIME entity.
5 This step generates the finished MIME message. It takes the mimeData object
that was populated in steps 2 and 4 and produces an InputStream called
envStream that contains the MIME message. At this point, you could pass
envStream to any process that expects a MIME message as input.
6 Because you cannot view an InputStream, this example includes a step that
converts envStream to a String so you can examine the finished message with
Developer. This technique is useful for testing and debugging.
If you examine the contents of string on the Results tab, you will see a MIME
message similar to the following:
Step Description
1 This step creates an empty MIME object. It does not take any inputs. It puts an
empty MIME object called mimeData in the pipeline.
2 This step generates the content of the message and adds it to the mimeData
object. If you view the pipeline for the addBodyPart service in this step, you
will see that the stream output variable generated by the stringToStream service
is mapped to the content input variable. Because content contains a simple text
message, the contenttype and encoding parameters are set as follows:
Parameter Value
contenttype text/plain;charset=UTF8
encoding quoted-printable
3 This step creates an XML document from a Record in the pipeline, converts that
document to an InputStream, and then adds the InputStream to the mimeData
object. Because content contains an XML document, the contenttype and encoding
parameters are set as follows:
Parameter Value
contenttype text/xml
encoding quoted-printable
4 This step gets an image file from disk and adds it to the mimeData object.
Because the file is retrieved as an InputStream, it can be mapped directly to the
mimeData object. In this case, content is an image file (binary data), so the
contenttype and encoding parameters are set as follows:
Parameter Value
contenttype image/gif;name="b2b.gif"
encoding base64
5 This step generates the finished MIME message. It takes the mimeData object
populated in steps 2–4 and produces an InputStream called envStream that
contains the multipart MIME message. At this point, you could pass envStream
to any process that expects a MIME message as input.
6 Because you cannot view an InputStream, this example includes a step that
converts envStream to a String so you can examine the finished message with
Developer. This technique is useful for testing and debugging.
If you examine the contents of string on the Results tab, you will see a MIME
message similar to the following:
Points to keep in mind when building multipart MIME messages:
By default, the Content‐Type header field is set to “multipart/mixed.” If you want to
use a different subtype, set the subtype parameter when you invoke createMimeData.
Body parts appear in the message in the order in which you add them to the MIME
object—the first part you add appears first in the message.
If you set message headers (e.g., using addMimeHeader) before you add body parts,
those header fields will also be inserted into each body part. If you do not want this to
occur, drop the mimeHeader variable from the pipeline before you perform an
addBodyPart step or execute the addMimeHeader step after adding the message’s body
parts.
The signer’s certificate
The signer’s certificate chain. If you know that the recipient trusts an intermediate CA
in your chain, you can supply a partial chain that extends back to that CA. However,
if you are not sure which CA the recipient trusts, supply a complete chain.
Note: You are not required to have the signer’s certificate chain to sign a message;
however, if you omit the chain, the recipient must produce the certificate chain when it
receives the message. If you do not supply the signer’s certificate chain, and the recipient
does not have a local copy of it, the signature verification process will fail. By including
the certificate chain with a signature, you ensure that the recipient will be able to process
the signature.
Many sites maintain these credentials in files on their SAP BC Server. (If your server uses
SSL, the server’s certificates will reside somewhere on your file system in a set of .DER
files). Some sites store them in a database or a special repository for security information.
It does not make any difference where the credentials are stored, as long as they are in
X.509 format and can be retrieved by SAP BC Server at run time.
If you cannot locate these credentials or do not have direct access to them, consult your
SAP BC Server Administrator.
Important! If you want to create a signed and encrypted MIME message, use the special
service that SAP provides for this purpose. For more information, see“Signing and
Encrypting a MIME Message” on page 489.
1 Create an InputStream that contains the MIME message that you want to sign. Use the
procedure outlined in “Creating a MIME Message” on page 474 to create the MIME
message.
2 Fetch the signer’s private key, certificate, and certificate chain. These credentials must reside
in the pipeline in the following form:
Credential Description
Private key A byte array containing the signer’s private key.
Certificate A byte array containing the signer’s certificate.
Certificate chain A list (a one‐dimensional array) of byte arrays containing the
signer’s complete certificate chain, where element 0 in the list
contains the signer’s certificate and element 1 contains the
CA’s certificate. If the certificate in element 1 is an intermediate
CA that is not trusted by the recipient, successive elements
must contain the certificates of the other intermediaries in the
chain (in order), extending back to a trusted intermediary or
the root‐level CA.
For example, a chain made up of the owner, two
intermediaries, and the root‐level CA would look as follows:
Element # Contents
0 Signer’s certificate
1 Intermediary CA Certificate
2 Intermediary CA Certificate
3 Root CA Certificate
The way in which you fetch these credentials depends on where they are stored at
your site. If they are stored in the file system, you can retrieve them using the
pub.file:getFile service. If they are stored in a special repository or a database system,
you may need to develop a customized service to retrieve them.
3 Pass the credentials and the MIME message to the pub.smime:createSignedData service. This
service takes an InputStream containing a MIME message and signs it using the
private key and the certificates that you provide. It produces an InputStream
containing the signed message.
To run this example, you must have a private key, its associated certificate, and the
certificate of the CA who signed it. When you run this service from Developer, it will
prompt you for the following:
Step Description
1 This step creates a MIME message containing a simple text message. It produces
an InputStream called envStream that contains the MIME message that will be
signed.
2 This step retrieves the signer’s private key from the file specified in
signersPrivateKeyFile. Note that the loadAs flag is set to “bytes” to load the file
into the pipeline as a byte[ ].
3 This step retrieves the signer’s certificate from the file specified in
signersCertificateFile. Note that the loadAs flag is set to “bytes” to load the file into
the pipeline as a byte[ ].
4 This step builds the certificate chain from the files specified in
signersCertificateFile and signersCACertificateFile. This example uses a custom
Java service to perform this step. You will need to develop a similar mechanism
to assemble a chain based on where your certificates are located and the number
of certificates in the chain.
5 This step generates the signed MIME message. It takes the InputStream from
step 1 and the credentials loaded in steps 2–4 and produces an InputStream
called SMimeEnvStream that contains the signed message.
6 Because you cannot view the contents of an InputStream, this example includes
a step that converts SMimeEnvStream to a String so you can examine the finished
message with Developer. This technique is useful for testing and debugging.
If you examine the contents of string on the Results tab, you will see a signed
S/MIME message similar to the following. Note that this example creates an
explicitly signed message—the message is in one body part and the digital
signature is in another.
Important! If you want to create a signed and encrypted MIME message, use the special
service that SAP provides for this purpose. For instructions, see “Signing and Encrypting
a MIME Message” on page 489.
1 Create an InputStream containing the MIME message that you want to encrypt. You can use the
procedure outlined in “Creating a MIME Message” on page 474 to create the MIME
message.
2 Fetch the recipient’s certificate as a byte[ ]. If the message will be sent to multiple
recipients, fetch the certificate of each recipient. Load the certificates into a list (a one‐
dimensional array) of byte[ ] such that each element in the list holds the certificate of
single recipient.
3 Pass the certificate and the MIME message to the pub.smime:createEncryptedData
service. This service encrypts the InputStream containing the MIME message and
produces a new InputStream containing the encrypted message.
Step Description
1 This step creates a MIME message containing a simple text message. It produces
an InputStream called envStream that contains the MIME message that will be
encrypted.
2 This step loads the recipient’s certificates from the files specified in
recipient1CertificateFile and recipient2CertificateFile. This example uses a custom
Java service to perform this step. You will need to develop a similar mechanism
to load the certificates of the parties to whom you want to send an encrypted
message.
3 This step generates the encrypted MIME message using the InputStream from
step 1 and the certificates from step 2. It produces a new InputStream called
SMimeEnvStream that contains the encrypted message.
4 Because you cannot view the contents of an InputStream, this example includes
a step that converts SMimeEnvStream to a String so you can examine the finished
message with Developer. This technique is useful for testing and debugging.
If you examine the contents of string on the Results tab, you will see an encrypted
S/MIME message similar to the following:
Step Description
1 This step creates a MIME message that contains a simple text message. It
produces an InputStream called envStream, containing the MIME message that
will be signed and encrypted.
2 This step loads the credentials used to sign the message. It performs the
following steps:
1 It retrieves the signer’s private key from the file specified in
signersPrivateKeyFile. Note that the loadAs flag is set to “bytes” to load the file
into the pipeline as a byte[ ].
2 It retrieves the signer’s certificate from the file specified in
signersCertificateFile. Note that the loadAs flag is set to “bytes” to load the file
into the pipeline as a byte[ ].
3 It builds a certificate chain from the files specified in signersCertificateFile and
signersCACertificateFile. This example uses a custom Java service to perform
this step. You will need to develop a similar mechanism to assemble a chain
based on where your certificates are located and the number of certificates
in the chain.
3 This step loads the recipient’s certificates from the files specified in
recipient1CertificateFile and recipient2CertificateFile. This example uses a custom
Java service to perform this step. You will need to develop a similar mechanism
to load the certificates of the parties to whom you want to send an encrypted
message.
4 This step generates the signed and encrypted MIME message. It takes the
InputStream from step 1 and the credentials from steps 2–5 and produces an
InputStream called SMimeEnvStream containing the signed and encrypted
message.
5 Because you cannot view the contents of an InputStream, this example includes
a step that converts SMimeEnvStream to a String so you can examine the finished
message with Developer. This technique is useful for testing and debugging.
If you examine the contents of string on the Results tab, you will see an encrypted
S/MIME message similar to the following:
Note: The way in which you acquire a MIME message and put it in the pipeline will
depend on your particular solution. You might retrieve it from a back‐end system, you
might read it from a file, or you might receive it from a custom content handler.
Regardless of how you acquire the message, it must be in the form of an InputStream to be
able to use it with the MIME services.
2 Convert the MIME message to a MIME object using the pub.mime:createMimeData service.
Pass the InputStream containing the MIME message to createMimeData. This service
returns a MIME object called mimeData that contains the message’s constituent
elements (header fields and content). It also returns a set of values indicating whether
the enclosed message is encrypted or digitally signed. (For information about
extracting information from an encrypted and/or signed MIME message, see
“Extracting the Payload from a Signed MIME Message” on page 496 and “Extracting
the Payload from an Encrypted MIME Message” on page 500.)
3 Extract the payload from the MIME object using the pub.mime:getBodyPartContent service.
This service takes as input the MIME object that you created in step 2. If the message
contains multiple parts, you can use the index or contentID parameter to specify which
part you want to retrieve, where:
— index is a String that specifies the index number (i.e., position number) of the part
whose content you want to retrieve. (Index 0 is the first part, Index 1 is the second
part, and so forth.)
— contentID is a String that specifies the value of the content‐ID header whose
content you want to retrieve. For example, if you wanted to retrieve the content of
from the part with the “content‐ID: AJ9994388‐0500,” you would set contentID to
“AJ9994388‐0500.”
If you don’t specify index or contentID, getBodyPartContent returns the content from the
first body part in the message.
The content of the requested body part is returned as an InputStream named content.
Step Description
1 This step acquires a MIME message. This example calls a helper service that
puts a three‐part test message in the pipeline as an InputStream. In a
production solution, it is more likely that a MIME message would be passed
into the pipeline by a content handler or a back‐end system.
2 This step takes the MIME message and creates a MIME object (mimeData)
containing the message’s headers and content. If you view the pipeline, you
will note that the InputStream produced by step 1 is mapped to this step’s input
variable.
3 This step extracts the payload from the second body part in mimeData. In this
example, the index parameter is set to 1 to select the second body part.
This step returns the payload (in this case an XML document) as an
InputStream named content.
4 This step converts the XML document in content to a String.
5 This step takes the String containing the XML document and parses it,
producing a Document object (a node) containing the XML document.
6 This step produces a Record containing the XML document’s elements and
values.
Step Description
1 This step acquires a MIME message. This example uses a helper service that
generates a three‐part MIME message and puts it in the pipeline as an
InputStream call envStream. In a production solution, it is more likely that a
MIME message would be passed into the pipeline by a content handler or a
back‐end system.
2 This step takes the MIME message and creates a MIME object (mimeData)
containing the message’s headers and content. If you view the pipeline, you will
note that the InputStream produced by step 1 is mapped to this step’s input
variable.
3 This step inspects the mimeData object and returns the number of body parts (in
this case 3) in a String called numParts.
4 This step sets the following variables that are used by the REPEAT block:
Variable Value Purpose
RepeatCounter numParts-1 Sets the counter that specifies the number of
times the REPEAT block needs to re‐execute.
Since a REPEAT block always executes once,
this counter is set to one number less than the
total number of body parts in the message.
PartIndex 0 Initializes the pointer that is used to step
through the body parts in this message.
5 This REPEAT block does the following for each body part in mimeData:
1 Extracts the content
2 Converts the retrieved content to a String
3 Appends that String to a String List
The last step in the block increments PartIndex. If you view the pipeline, you will
see that this variable is mapped to the index parameter for the
getBodyPartContent service
6 This step drops unnecessary variables, leaving only the populated String List in
the pipeline
Important! A signer’s certificate is authenticated against the set of trusted certificates in SAP
BC Server’s CA certificate directory. If your site will receive signed messages, you must
collect the certificates of CAs that you trust, store them in a directory on the file system,
and then set the server’s CA Certificate Directory parameter to point to this directory. For
information about setting this parameter, see the SAP BC Administration Guide
This poses a problem if, after running createMimeData on the InputStream, you discover that
it contains a signed or encrypted message. Since the original InputStream has been
emptied, it cannot be passed to the signature‐verification or decryption services. To solve
this problem, createMimeData returns a copy of the original InputStream in an output
variable called stream. This is the variable you pass to processSignedData if, after processing
the original message with createMimeData, you discover that it is signed.
It compares the signer’s certificate chain to the certificates in SAP BC Server’s “trusted
CA” directory to determine whether the credentials are authentic and trustworthy.
It extracts the message from the S/MIME message stream, parses it, and puts it in the
pipeline as a MIME object called mimeData.
If processSignedData is able to verify the signature, but is not able to authenticate the
certificate of the signer (i.e., the certificate could not be confirmed to be from a trusted
source), the verify flag will be true and the errorCode and errorMessage values will be set as
follows.
If processSignedData is able verify the signature and authenticate the signer’s certificate, it
does not return errorCode or errorMessage.
Note: Regardless of whether processSignedData is able to verify the signature or authenticate
the certificate, it always returns a MIME object containing the parsed message.
Note: Depending on the nature of the messages your service receives, you may want to test
the encrypted output variable after processing a signature. This will tell you whether the
message had been encrypted before it was signed. If encrypted is “true,” you will need to
decrypt the message in stream. For procedures, see “Extracting the Payload from an
Encrypted MIME Message” on page 500.
4 Extract the payload from the MIME object using the pub.mime:getBodyPartContent service. If
the enclosed message is not encrypted, processSignedData returns a MIME object that
contains the message’s constituent elements (header fields and content). At this point,
you can use getBodyPartContent to retrieve the content from the MIME object. For
information about using getBodyPartContent, see “Extracting the Payload from a MIME
Message” on page 492.
Flow Service that extracts the content from a signed MIME message
Step Description
1 This step acquires an InputStream containing a signed MIME message. This
example uses a helper service to produce a test message. In a production
solution, it is more likely that a MIME message would be passed into the
pipeline by a content handler or a back‐end system.
2 This step takes the InputStream generated in step 1 and processes the signature.
If the signature is valid, this step produces a MIME object called mimeData,
containing the parsed message. If the signature is invalid, this step returns an
empty mimeData object and sets the verify flag to “false.”
3 This step checks whether or not the signature was processed successfully by
testing the value of the output variable verify. If verify is “true,” this step extracts
the payload and converts it to a String. If verify is “false,” this step collects the
error information in the pipeline and passes it to an error‐logging service.
Note: When you process an InputStream with createMimeData, that InputStream is emptied
and is no longer available to other services. For this reason, createMimeData returns a copy
of the original message stream in the output variable called stream. You pass this variable
to processEncryptedData if the original InputStream has been emptied by createMimeData. For
additional information about InputStreams, see “Working with InputStreams” on
page 496.
process it as an ordinary MIME message as described in “Extracting the Payload from
a MIME Message” on page 492.
2 Pass the message to the pub.smime:processEncryptedData to be decrypted. You must pass
three input parameters to this service: the InputStream containing the encrypted
MIME message, the recipient’s private key and the recipient’s digital certificate. The
last two parameters must be in the form of byte arrays (i.e., byte[ ]).
Keep in mind that if the message was passed to createMimeData prior to this step, the
original InputStream will be empty. In this case, you must pass the stream output
variable produced by createMimeData to the processEncryptedData service.
Note: Depending on the nature of the messages your service receives, you may want to
test the signed output variable after decrypting the message. This will tell you whether
the message had been signed prior to being encrypted. If signed is “true,” you will
need to verify the signature of the message in stream. For procedures, see “Extracting
the Payload from a Signed MIME Message” on page 496.
3 Extract the payload from the MIME object using the pub.mime:getBodyPartContent service. If
the decrypted message is not signed, the MIME object returned by processEncryptedData
will contain the message’s constituent elements. You use getBodyPartContent to retrieve
the content from this MIME object. For information about using getBodyPartContent, see
“Extracting the Payload from a MIME Message” on page 492.
Flow Service that extracts the content from an encrypted MIME message
Step Description
1 This step acquires an InputStream containing an encrypted multipart MIME
message. This example uses a helper service to produce the test message. In a
production solution, it is more likely that a MIME message would be passed
into the pipeline by a content handler or a back‐end system.
2 This step retrieves the signer’s private key from the file specified in
recipientsPrivateKeyFile. Note that the loadAs flag is set to “bytes” to load the file
into the pipeline as a byte[ ].
3 This step retrieves the signer’s private key from the file specified in
recipientsCertificateFile. Note that the loadAs flag is set to “bytes” to load the file
into the pipeline as a byte[ ].
4 This step takes the InputStream from step 1 and the credentials from steps 2
and 3 and decrypts the message. It produces a MIME object (mimeData) that
contains the decrypted message’s constituent elements (header fields and
content).
5 This step extracts each body part from mimeData and appends it to a String list.
Flow Service that extracts the content from a signed and/or encrypted MIME message
Step Description
1 This step acquires an InputStream containing a signed and encrypted MIME
message. This example uses a helper service to produce the test message. In a
production solution, it is more likely that a MIME message would be passed
into the pipeline by a content handler or a back‐end system.
2 This step attempts to create a MIME object from the InputStream produced in
step 1.
3 This step tests the encrypted flag to see whether the message is encrypted. If it is,
it obtains the credentials needed to decrypt the message and passes those
credentials and the message to the processEncryptedData service. Note that the
stream output variable is mapped to the SMimeEnvStream input parameter,
because the original InputStream from step 1 was emptied by step 2.
Note that if encrypted is “false,” execution falls through to step 4.
4 This step tests the signed flag to see whether the message is signed. If it is, it
passes the message to the processSignedData service. Note that the stream
output variable is mapped to the SMimeEnvStream input parameter, because the
original InputStream from step 1 was emptied in step 2. (When a message is
decrypted in step 3, the processEncryptedData service produces the stream used
by this step)
Note that if signed is “false,” execution falls through to step 5.
5 This step extracts the data from the mimeData object produced by the preceding
steps.
What Is WebTap?
WebTap is a facility that acts as an intermediary between a browser‐based client and a
Web server. You use it to build services that monitor HTTP requests and conditionally
execute a prescribed set of actions based on a URL requested by a client. WebTap allows
you to build flexible, browser‐based applications that combine manual and automated
interactions, by letting you filter HTTP requests—letting some requests “pass through” to
the target server and intercepting others for special handling.
t
Important! This is the last release of SAP BC Server to support the WebTap feature. It will
not be available in future versions of the SAP BC Server.
When a browser makes a request for a WebTap service, all follow‐on requests from that
client are channeled through the WebTap service. In this capacity, the WebTap service
serves as an agent, submitting HTTP requests on the client’s behalf. (To the target server,
WebTap appears as the client, not the original requestor).
Using WebTap provides the following benefits:
It allows you to intercept a request and take some action based on the user‐supplied
data (specifically, the URL and/or name=variable arguments) associated with it.
It facilitates data‐aggregation applications by routing all follow‐on requests through a
single service, reusing the authentication and cookie context established during the
initial request.
It provides a vehicle through which multiple users can access a protected resource
through a common user account.
Important! One of the primary differences between a WebTap service and other services is
that a WebTap service passes the requested HTML document (modified slightly to ensure
that follow‐on requests get directed through the WebTap service) back to the client. It
does not load and bind the document to convert it to an IData object as regular services
do.
A WebTap service (constructed from the RelayHandler class) that optionally has a set
of “rules” associated with it defining a URL and/or name=value arguments that, when
submitted, will trigger a specified action.
Step Description
1 WebTap receives the request and compares the user‐supplied data (the URL
and any submitted name=value pairs) to the “rules” associated with the
service.
2 If the user‐supplied data matches the criteria defined in a rule, the server
checks to see whether the rule specifies a “before” action (often one or more
services). If so, that action is executed.
3 WebTap submits the request for the specified resource. (Note that if a
“before” action was executed, the resource may be different than the one
originally requested by the client.)
4 WebTap receives the response and remaps the hypertext links within it (this
ensures that all follow‐on requests are routed back through the WebTap
service). For example, if the response contained the following reference:
HREF="http://www.abc.com"
WebTap replaces that reference with:
HREF="/invoke/folder/Service?reqUrl=MapNum"
Where folder/Service is the name of the WebTap service and MapNum is an
alias (dynamically generated by WebTap) for the actual URL assigned to this
reference.
5 WebTap checks to see whether the rule defines an “after” action (usually one
or more services) for the request. If there is, that action is executed.
6 WebTap returns the HTML page (which could have been altered in the
previous step) to the client.
If you want to build an intercept service (one that takes some action when it receives a
URL), create a WebTap service that includes a set of rules defining what action you
want WebTap to take when the client submits a particular request.
WebTap allows you to specify the action you want the server to take before it submits
the request to the target server and/or before it returns the response to the client. You
can interject an action (or a series of actions) at none, one, or both of these points.
You can build a rule around a URL and/or a particular value in a name=value
argument.
You can use a standard pattern‐matching string or a regular‐expression to define a
URL and/or name=value argument that will trigger an action.
1 On the File menu, click New.
2 Select WebTap Service and then click Next.
3 In the New WebTap Service dialog box, next to Folder, select the folder in which you
want to save this service.
4 In the Name field, type a name for the service and click Next.
5 Select the type WebTap service you want to create, and then click Finish.
6 If you want to trigger specific services before and/or after WebTap submits a request
to the target service, use the Rules tab to define a rule for each reqUrl value that will
trigger an action. See “Defining WebTap Rules” on page 510 if you need procedures
for this step.
7 If you selected Custom in step 4, add your code on the Source tab and the Shared tab as
needed. For additional information about creating custom code, see “Creating a
Customized WebTap Service” on page 518.
8 To test your service, select Run in Browser from the Test menu. Developer prompts you
for the value of reqUrl, launches your browser, and invokes the service.
Important! Although Developer displays a Settings tab for a WebTap service, only a few
of its options should be used with WebTap. (The caching and stateless options must never
be used.) The following describes how to use the Settings options with a WebTap
service.
Option Description
Service Use this option only when a before service, an after service, or
Output custom code returns a Values object to the client instead of an HTML
Template document. See the rspVals variable in “Creating Before and After
Services” on page 511 for information about returning a Values
object instead of HTML.
Runtime Do not use these options. Make sure they are all disabled.
1 In the Rules tab, click to add a new, unnamed rule to the rule list.
2 Select the new, unnamed rule in the list.
3 In the Rule Name field, type a name for the rule.
4 In the URL Match field, type a pattern‐matching string describing the URL that will
trigger a before or after service.
— You can specify a pattern‐matching string using standard wildcard characters
(see page 573 for allowed wildcards). The following example would match
requests for any resource on the www.rubicon server.
Example http://www.rubicon.*
–OR–
— Use a regular expression. When you use a regular expression, you must enclose
the entire pattern‐matching string in / characters. The following example would
match any URL in which the string “rubicon” appears anywhere.
Example /.*rubicon.*/
5 If you want to match a particular set of name=value arguments for the service, use the
following steps to describe the criteria for each argument that you want to test.
3 Click OK.
4 Repeat steps 1–3 for each argument that you want to specifically match. Keep the
following points in mind when matching on arguments:
— When you specify multiple arguments in Input Match, the rule is not satisfied
unless all of them are true. (A Boolean AND is implied.)
— If you specify an argument in Input Match, the rule is not satisfied unless that
argument appears in the request and it meets the specified criteria.
— If you do not specify an argument in the Input Match list, any form of the
argument will satisfy the rule.
6 If you want this rule, when true, to trigger the execution of a service before the request
is submitted, specify the name of that service in the Service Before field.
7 If you want this rule, when true, to trigger the execution of a service after it receives a
request from the target server, specify the name of that service in the Service After field.
after services. You use these variables to read and/or modify data that is passed between
the client and the target server and to control the behavior of WebTap at run time.
For example, you can change the reqUrl variable in a before service to reroute the client’s
original request to a different resource. (See “A Simple Rerouting Example” on page 516
for an example of this technique.) You can also use the rspVals or rspTxt control variable to
“short‐circuit” the WebTap process and return a predefined set of outputs to the client,
instead of passing the request to the target server.
The following table describes the specification of a WebTap service. Note that it is made
up of two records: WebtapData and WebtapControl. WebtapData holds the data that
passes between the client and the target server. WebtapControl contains a set of control
variables that you use to direct the run time behavior of the WebTap service.
Note: Before using this option, verify with your
server administrator that an https port is configured
on your SAP BC Server.
node Contains a parsed representation of the HTML
document retrieved by WebTap (before URL
mapping occurs). You can use this document as
input to any service that accepts a node as input
(e.g., queryDocument).
Step Description
1 Create a new, empty flow service and assign the pub.webtap:triggerSpec
specification to it (this specification resides in the WmPublic package).
2 In the Flow Editor, insert a single MAP step.
3 On the Pipeline tab, use the modifier to set the value of WebtapControl/reqUrl
in Pipeline Out to the URL that you want to reroute the client request to.
4 Save the flow service.
5 Create a standard WebTap service.
6 Define one rule that matches the URL that the client will request, and designate
the flow service you created in steps 1–4 as the before service for that rule. See
“To define a WebTap rule” on page 510 if you need procedures for this step.
7 Test this service (via Test Run In Browser) and type a URL that matches the rule
you specified in step 6. WebTap will automatically reroute you to the URL
specified in step 3.
Step Description
1 Open the WebTap service in the Developer and add the following line of code to
the Source tab.
handler.setTrace(true);
To enable tracing,
add this line to the
Source tab.
Example
The following code segment shows a WebTap service that logs an incoming request
before passing it to the rules engine.
You can also use the custom framework to define your own set of rules (i.e., test for
certain conditions in the URL or user data) by inserting code at the appropriate trigger
points.
Example
The following code fragment shows a WebTap service that contains a custom trigger
(shaded) that executes a special block of code if reqUrl contains a specified string.
For additional information about the WebTap API, see the RelayHandler class in the SAP
BC Java API Reference.
Folder is the name of the folder in which the service resides.
Service is the name of the WebTap service.
RequestedUrl is the URL of the requested resource. This part of the string must be URL‐
encoded!
Example
http://rubicon/invoke/Admin/Orders?reqUrl=http%3A%2F%2Fwww.ABCSupplies.com
maintaining your own log file or sending server statistics to a network monitoring
system.
Transaction events occur when a SAP BC Server begins and finishes processing a
guaranteed delivery transaction. There are two types of transaction events—Tx Start
and Tx End. Subscribe to transaction events to trigger event handlers that perform
specific actions (such as sending notification or logging information) when a
particular guaranteed delivery transaction begins or finishes processing.
When event handlers run, they do not generate audit events.
If an event handler throws an exception, it generates an exception event. This is true
for all event handlers but exception event handlers. When an exception event handler
throws an exception, it does not generate an exception event.
View or edit event subscriptions
Suspend event subscriptions
Delete event subscriptions
The following sections contain more information about each of these tasks.
Note: You can also use built‐in services to add, modify, and delete event subscriptions.
These services are located in the pub.event folder. For more information about built‐in
services, see the SAP BC Built‐In Services Guide.
Subscribing to an Event
You can use the Event Manager in Developer to subscribe to an event on the current
server. This action registers the event handler with the Event Manager and specifies
which events will invoke it. To access the Event Manager, select Edit Event Manager.
Use the following procedure to subscribe to an event on the current server. To perform
this procedure, you must have already:
Identified the event type you want to subscribe to
Identified the service or services that generate an event you want to subscribe to (if
you want to subscribe to an audit event, exception event, or GD Start event).
Written the event handler that will execute when the identified event occurs
1 On the Edit menu, select Event Manager.
2 In the Event Manager dialog box, in the View event subscribers for list, select the event
type to which you want to subscribe.
3 Click to add a new subscriber.
4 In the Enter Input Values dialog box, complete the following fields:
5 Click OK. Subscriptions take effect immediately.
Note: SAP BC Server saves information for event types and event subscriptions in the
eventcfg.bin file. This file is generated the first time you start SAP BC Server and is located
in the following directory: <sapbc>\server\config. Copy this file from one SAP BC Server
to another to duplicate event subscriptions across servers.
Important! *,?, and ^ are the wild‐card characters allowed in an event filter. All other
characters in the pattern string are treated as literals. Pattern strings are case sensitive.
1 On the Edit menu, select Event Manager.
2 In the View event subscribers for list, select the event type for which you want to view
subscriptions.
3 Click the subscription you want to edit, and then click .
4 Modify the fields in the Enter Input Values dialog box as needed and then click OK.
5 Repeat steps 2–4 for each subscription you want to view or edit.
6 Click OK when you finish viewing or editing event subscriptions. Your changes take
effect immediately.
1 On the Edit menu, select Event Manager.
2 In the Event Manager dialog box, in the View event subscribers for list, select the event
type for which you want to suspend a subscription.
3 Click the subscription you want to edit, and then click .
4 In the Enter Input Values dialog box, in the Enabled list, select false.
5 Repeat steps 2–4 for each event subscription you want to suspend.
6 Click OK when you finish suspending event subscriptions. Your changes take effect
immediately.
1 On the Edit menu, select Event Manager.
2 In the Event Manager dialog box, in the View event subscribers for list, select the event
type for which you want to delete a subscription.
3 Click the subscription you want to delete, and then click .
4 Repeat steps 2 and 3 for each subscription you want to delete.
5 Click OK when you finish deleting events. Your changes take effect immediately.
Create an empty flow service and name it processLogon.
The subject of the email message will contain the user ID of the
person who logged in to SAP BC Server as a member of the
Administrators group.
mailhost The network name of your mailhost (e.g., mail@mycompany.com).
body Administrators user %userid% logged into session %sessionName% with
session ID %ssnid%
The body of the email message will contain the user name, session
name, and session ID for the person who logged in to SAP BC
Server as an Administrator.
5 Click to save the service.
Use the testing and debugging tools in Developer (such as Test Run) to test and
debug the service. For more information about these tools, see “Testing and
Debugging Services” on page 247.
3 Click to add a new event subscription.
4 In the Enter Input Values dialog box, complete the following fields:
5 Click OK. Subscriptions take effect immediately.
A port cannot be started. The most common reason a port cannot start is that the port
is being accessed by another application.
A service cannot be loaded or executed due to setup errors. For a flow service, a
possible error is a missing XML metafile. For a Java service, possible errors include a
missing class file or method.
You can use alarm events to trigger event handlers that execute when the server generates
messages related to the status of the server. For example, you might want to create an
event handler that notifies the administrator when a user is denied access to the server or
to a port, when a service fails to load or execute, or when a port does not start. You can
also create event handlers to send data to a network monitoring system.
Key Description
time A String containing the date and time that the alarm event occurred, in
the format yyyy/MM/dd HH:mm:ss.SS
service A String containing the fully qualified name of the service that generated
the event. A service can generate an alarm event when a client invokes a
service that accesses information or a service on a remote server. If the
client is not a member of an allowed group for the port on the remote
server, the service will generate an alarm event.
sessionID A String containing the identification number for the session during
which the alarm event was generated. Some alarm events are not
generated during sessions. In these cases, the sessionID variable will not
contain a value.
msg A String containing the error message from the alarm event.
Tip! When you subscribe an event handler to an alarm event, you can create a filter for the
msg field to be more selective about the alarm events that trigger the event handler.
Tip! Audit events are generated regardless of whether a service executes successfully or
not. If a service throws an exception, it generates both an exception event and audit
events.
Audit events are generated by all services that execute, including nested services. For
example, a flow service that has two child services will produce six audit events: two from
the flow service itself, and two each from its children. The same is true for coded services
(such as C services or Java services).
Settings tab
Specify a service’s
Audit Level with
the Settings tab.
A service can have one of the following Audit Level values:
Additionally, the generation of audit events is contingent on the value of the server’s
watt.server.auditLog property. This property globally governs whether audit events are
generated. By default, watt.server.auditLog is set to persvc, which means that audit events
are generated based on the service’s Audit Level setting. However, you can globally
override the individual service Audit Level settings with watt.server.auditLog, as described in
the following table.
Key Description
time A String containing the date and time the event occurred, in the format
yyyy/MM/dd HH:mm:ss.SS
TID A String containing the transaction ID of the service that generated the
event.
service A String containing the fully qualified name of the service that generated
the event.
sessionID A String containing the identification number for the session of the service
that generated the event.
result A String indicating the audit point. Will be one of the following:
String Description
begin This event marks the beginning of a service.
ok This event marks the end of a service that executed
successfully.
errorInfo This event marks the end of a service that executed
unsuccessfully (that is, threw an exception). This string will
start with the characters “error” and be followed by
additional text containing specific error information about
the exception.
pipeline A copy of the state of the pipeline at the point where the event occurred.
Note that this element is only included in the input object if the Audit Level
of the service that generated the event is set to verbose or if
watt.server.auditLog is set to verbose.
userName A String containing the user name that invoked the service that generated
the event.
The audit event handlers that you build can make use of these inputs as they need to.
Keep in mind that an audit event handler is called twice each time a service runs—once
when the service starts and again when it ends. Your event handler can check the value of
the result parameter to determine whether it is processing an audit event from before or
after the service executed.
Also, if your event handler needs data from the triggering service’s pipeline, make sure
that service’s Audit Level is set to verbose. Otherwise, the pipeline element won’t be
included in the input object that is passed to your event handler.
Tip! When you subscribe an event handler to an audit event, you can create a filter for the
service field to specify the services whose audit events you want to subscribe to—that is,
you can specify which services’ audit events trigger the event handler.
Note: Keep in mind that event handlers are processed independent of the services that
trigger them. They are completely separate, asynchronous processes. Event handlers are
not designed to replace the error handling and/or error recovery procedures that you
would normally include in your service.
Exception events are always generated when an exception occurs. They are not subject to
the Audit Level settings or the watt.server.auditLog property in the same way audit events are.
(For information about these settings, see “Setting Audit Levels” on page 537.)
Services that generate exception events also generate audit events when they end
(assuming that audit events are not suppressed by the current Audit Level or
watt.server.auditLog settings).
If a nested service throws an exception, an exception event is generated by each service in
the call stack. For example, if service A1 calls service B1, and B1 throws an exception, both
B1 and A1 generate exception events (in that order).
Key Description
time A String containing the date and time that the event occurred, in the
format yyyy/MM/dd HH:mm:ss.SS
error A String containing the error message from the exception.
errorType A String containing the exception type that was thrown.
Key Description
errorDump A String containing more detailed information about the exception (if
the exception object contains dump information).
service A String containing the fully qualified name of the service that
generated the event.
user A String containing the user that requested the service that generated
this event.
callStack A Record List containing the items in the call stack. See the
pub.event:callStackItem record for the definition of the records in
callStack.
pipeline A copy of the state of the pipeline at the point when the exception
occurred.
ssnid A String containing the identification number of the session during
which the exception occurred.
threadID A String identifying the thread that invoked the service.
Tip! When you subscribe an event handler to an exception event, you can create a filter for
the service field to specify the services whose exception events you want to subscribe to—
that is, you can specify which services’ exception events trigger the event handler.
A Guaranteed Delivery Transaction generates Guaranteed Delivery Events and Transaction Events
webMethods
SAP BC Server
B2B Server webMethods
SAP BC Server
B2B Server
(local) (remote)
1 2
Service A Service B
5 4 3
Stage Description
1 Service A uses guaranteed delivery to invoke Service B on the remote SAP BC
Server. When the local server requests Service B, the local server generates a
GD Start event. By default, the GD Start event is logged to the txout.log file.
2 The remote SAP BC Server receives the request and begins executing Service
B. When the remote server begins executing Service B, the remote server
generates a Tx Start event. By default, the Tx Start event is logged to the
txin.log file.
3 The remote SAP BC Server finishes executing Service B and generates a Tx
End event. By default, the Tx End event is logged to the txin.log file.
4 The remote SAP BC Server sends the results of Service B to the requesting
client (here, the local SAP BC Server).
5 The local SAP BC Server receives the results of Service B and generates a GD
End event. By default, the GD End event is logged to the txout.log file.
For more information about guaranteed delivery, see “Using Guaranteed Delivery” on
page 449.
Key Description
time A String containing the date and time that the event occurred, in the
format yyyy/MM/dd HH:mm:ss.SS
TID A String containing the transaction identification number of the service
that generated the GD Start event.
Key Description
svcName A String containing the name of the service invoked using guaranteed
delivery.
result A String containing the status of the guaranteed delivery transaction, such
as NEW.
Tip! When you subscribe an event handler to a GD Start event, you can create a filter for
the svcName field to specify the services in a guaranteed delivery transaction that you
want to subscribe to—that is, you can specify the services that when invoked using
guaranteed delivery will trigger the event handler.
Key Description
time A String containing the date and time that the event occurred, in the format
yyyy/MM/dd HH:mm:ss.SS
TID A String containing the transaction identification number of the service that
generated the GD End event.
result A String containing the status of the guaranteed delivery transaction, such
as DONE.
Key Description
portStatusInfo A Record List containing status information for each configured port
on SAP BC Server.
String Description
time A String containing the date and time that the event
occurred, in the format yyyy/MM/dd HH:mm:ss.SS
port A String containing the number for the port.
status A String indicating the status of the port.
protocol A String indicating the type of port (for example, http,
https, ftp, or e‐mail).
primary A String indicating the primary port. By default, SAP
BC Server designates an HTTP port at port 5555 as the
primary port.
enabled A String indicating whether or not the port is enabled.
The value will be one of the following:
String Description
true The port is enabled
false The port is disabled.
Maintain a log of replicated packages
Maintain a log of the packages distributed or “pushed” to your subscribers
Maintain a log of the packages your partners pulled from you
For more information about the pub.replicator:generateReplicationEvent service, see the SAP BC
Built‐In Services Guide.
Key Description
time A String containing the date and time that the event occurred, in the
format yyyy/MM/dd HH:mm:ss.SS
action A user‐defined String describing the action (such as create or push) for
the replication event. You can use the value of the action variable to
maintain separate logs for each action type.
package A String containing the name of the released or pushed package.
service A String containing the name of the flow service that invoked the
pub.replicator:generateReplicationEvent service.
Tip! When you subscribe an event handler to a replication event, you can create a filter to
specify the package that when replicated, will trigger the event handler.
Key Description
time A String containing the date and time the event occurred, in the
format yyyy/MM/dd HH:mm:ss.SS
sessionID A String containing the identification number of the session.
userid A String containing the user ID that the <sapbc> client or developer
used to log on to SAP BC Server.
sessionName A String containing the name of the new session.
Tip! When you subscribe an event handler to a Session Start event, you can create a filter so
that only session start events generated by a specific user or by a member of a specific
group trigger the event handler.
Key Description
time A String containing the date and time that the event occurred, in the
format yyyy/MM/dd HH:mm:ss.SS
sessionID A String containing the identification number of the session.
rpcs A String containing the number of service calls performed during the
session.
age A String identifying how long the session existed (in milliseconds)
before it ended.
Key Description
time A String containing the date and time the event occurred, in the
format yyyy/MM/dd HH:mm:ss.SS
sessionID A String containing the identification number of the session.
rpcs A String containing the number of service calls performed during the
session.
age A String identifying how long the session existed (in milliseconds)
before it expired.
Note: SAP BC Server provides an agent that you can configure for use with a network
monitoring system. For information about implementing this agent, see the readme fie in
the agentInstall.jar file located in the <sapbc>\server\lib directory.
Key Description
startTime A String containing the date and time that the event occurred, in the
format yyyy/MM/dd HH:mm:ss.SS
uptime A String identifying the length of time the server has been running, in
the format yyyy/MM/dd HH:mm:ss.SS
totalMem A String identifying the total amount of used and unused storage
space available (in kilobytes) to SAP BC Server.
freeMem A String identifying the amount of unused storage space available (in
kilobytes) to SAP BC Server.
usedMem A String identifying the amount of storage used (in kilobytes) by SAP
BC Server.
freeMemPer A String identifying the percentage of free memory.
Key Description
usedMemPer A String identifying the percentage of used memory.
svrT A String identifying the number of executing services.
svrTMax A String identifying the maximum number of services that executed
concurrently during the previous poll cycle.
sysT A String identifying the number of threads in use.
sysTMax A String identifying the maximum number of threads that executed
concurrently during the previous poll cycle.
conn A String identifying the number of current sessions on SAP BC
Server.
connMax A String identifying the maximum number of connections that ran
concurrently during the previous poll cycle.
reqTotal A String identifying the total number of requests during the poll
cycle.
reqAvg A String identifying the average processing duration for a service
during the previous poll cycle.
newReqPM A String identifying the new requests per minute at the beginning of
the poll cycle.
endReqPM A String identifying the new requests per minute at the end of the
poll cycle.
errSvc A String identifying the number of services that completed with
errors since SAP BC Server started.
svcRate A String identifying the number of service starts and ends per second
during the last poll cycle.
errSys A String identifying the number of errors that were not caused by
services in the previous poll cycle.
Tx Start events occur when a SAP BC Server begins executing a service invoked with
guaranteed delivery.
Tx End events occur when a SAP BC Server finishes executing a service invoked with
guaranteed delivery.
Transaction events result from guaranteed delivery transactions. Each guaranteed
delivery transaction generates a Tx Start event and a Tx End event. In fact, the transaction
events occur between the guaranteed delivery events. A Tx Start event occurs
immediately after a GD Start event and a Tx End event occurs immediately before a GD
End event. For more information about how transaction events relate to guaranteed
delivery events, see “Guaranteed Delivery Events and Transaction Events” on page 542.
You can subscribe to Tx Start and Tx End events to trigger event handlers that log
guaranteed delivery transactions to a file or database. You might also want to use
transaction events to trigger event handlers that send notification.
Key Description
time A String containing the date and time that the event occurred, in the
format yyyy/MM/dd HH:mm:ss.SS
TID A String containing the transaction ID for the guaranteed delivery
transaction that generated the event.
result A String containing the status of the guaranteed delivery transaction, such
as NEW.
Key Description
time A String containing the date and time that the event occurred, in the format
yyyy/MM/dd HH:mm:ss.SS
Key Description
TID A String containing the transaction ID of the guaranteed delivery
transaction that generated the event.
result A String containing the status of the guaranteed delivery transaction, such
as DONE.
BRANCH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
EXIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
INVOKE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
LOOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
MAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
REPEAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
SEQUENCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
BRANCH
The BRANCH step selects and executes a child step based on the value of one or more
variables in the pipeline. You specify the variables you want to branch on by specifying a
switch value or by writing an expression that includes the variables.
Name1
if the value of choice is ‘Name1’
Name2
if the value of choice is ‘Name2’
Name of the
switch field is
choice NameN
if the value of choice is ‘NameN’
*
Otherwise
Branching on Expressions
When you branch on expressions, you set the evaluate-labels property of the BRANCH step
to true. In the label property for each child step, you write an expression that includes one
or more variables. At run time, the BRANCH step executes the first child step with an
expression that evaluates to true.
If you want to specify a child step to execute when none of the expressions are true, set the
label of the child step to $default.
Child2
if the expression of second child is true
evaluate-labels
is set to true
ChildN
if the expression of nth child is true
*
Otherwise
The BRANCH step in the following illustration uses expressions to determine which of
the four children executes. The value of the subTotal variable determines which step
executes at run time.
Properties
The BRANCH step has the following properties.
comment
Optional. Specifies a descriptive comment for the step.
scope
Optional. Specifies the name of a record in the pipeline to which you want to restrict this
step. If you want this step to have access to the entire pipeline, leave this field blank.
timeout
Optional. Specifies the maximum number of seconds that the step should run. When the
time is exceeded, the step stops and raises an exception. However, if this step contains an
INVOKE step, the INVOKE step is not interrupted when the timeout value is exceeded.
Instead, the exception is raised after the INVOKE is complete.
If you want to use the value of a pipeline variable for this property, type the variable
name between % symbols. For example, %expiration%.
If you do not want to specify a timeout period, set timeout to zero or leave it blank.
label
Optional. (Required if you are using this BRANCH step as a target for another BRANCH
or EXIT step.) Specifies a name for this instance of the BRANCH step, or a null,
unmatched, or empty string ($null, $default, blank).
switch
Specifies the name of the string variable in the pipeline that the BRANCH step uses as the
switch field to determine which child step is executed at run time. Do not specify a
variable for switch if you plan to branch on expressions.
evaluate-labels
Specifies whether or not you want to branch on expressions. When you branch on
expressions, you enter expressions in the label field for the children of the BRANCH step.
At run time, the server executes the first child step whose label evaluates to true. Select
true to branch on expressions. To branch on the switch value, select false.
The matching child step fails.
The BRANCH step does not complete before the timeout period expires.
EXIT
The EXIT step exits the entire flow service or a single flow step. Specifically, it may exit
from the nearest ancestor loop step, a specified ancestor step, the parent step, or the entire
flow service.
The EXIT step can throw an exception if the exit is considered a failure. When an
exception is thrown, user‐specified error message text is displayed by typing it directly or
by assigning it to a variable in the pipeline.
Properties
The EXIT step has the following properties.
comment
Optional. Specifies a descriptive comment for the step.
label
Optional. (Required if you are using this EXIT step as a target for a BRANCH step.)
Specifies a name for this specific step, or a null, unmatched, or empty string ($null,
$default, blank).
from
Required. Specifies the step that you want to exit from.
Note: If the label you specify does not match the label of an
ancestor flow step, the flow will exit with an exception.
signal
Required. Specifies whether the exit is to be considered a success or a failure. A SUCCESS
condition exits the flow service or step. A FAILURE condition exits the flow service or step
and throws an exception. The text of the exception message is contained in the failure-
message property.
failure-message
Optional. Specifies the text of the exception message that is displayed when signal is set to
FAILURE. If you want to use the value of a pipeline variable for this property, type the
variable name between % symbols. For example, %mymessage%.
Throw an exception when you exit a flow service or a flow step without having to
write a Java service to call Service.throwError( ).
Exit a LOOP or REPEAT flow step without throwing an exception.
INVOKE
The INVOKE flow step invokes another service. You can use it to invoke any type of
service, including another flow service.
Properties
The INVOKE step has the following properties.
comment
Optional. Specifies a descriptive comment for the step.
scope
Optional. Specifies the name of a record in the pipeline to which you want to restrict this
step. If you want this step to have access to the entire pipeline, leave this field blank.
timeout
Optional. Specifies the maximum number of seconds that the step should run. When the
time is exceeded, the step stops and raises an exception. However, the INVOKE step is not
interrupted when the timeout value is exceeded. Instead, the exception is raised after the
INVOKE is complete.
If you want to use the value of a pipeline variable for this property, type the variable
name between % symbols. For example, %expiration%.
If you do not want to specify a timeout period, set timeout to zero or leave it blank.
label
Optional. (Required if you are using this step as a target for a BRANCH or EXIT step.)
Specifies a name for this specific step, or a null, unmatched, or empty string ($null,
$default, blank).
service
Required. Specifies the fully qualified name of the service to invoke.
validate-in
Optional. Specifies validation of the input to the invoked service. If you want the input to
be validated against the input parameters of the service, select $default.
validate-out
Optional. Specifies validation of the output from the invoked service. If you want the
output to be validated against the output parameters of the service, select $default.
Note: In SAP BC version 3.x, you could set an as‐user property for a transformer. In SAP
BC Server version 4.0, this property was removed. For more information see “The As‐User
Property in SAP BC Developer 3.x” on page 97.
The specified service does not exist.
The specified service is disabled.
LOOP
The LOOP step takes as input an array variable that is in the pipeline. It loops over the
members of an input array, executing its child steps each time through the loop. For
example, you have a service that takes a string as input and a string list in the pipeline.
Use the LOOP step to invoke the service one time for each string in the string list.
You identify a single array variable to use as input when you set the properties for the
LOOP step. You can also designate a single variable for output. The LOOP step collects an
output value each time it runs through the loop and creates an output array that contains
the collected output values. If you want to collect more than one variable, specify a record
that contains the fields you want to collect for the output variable.
No
more input
array
input is members?
an array
Yes
get next
member of child child child
input array
Properties
The LOOP step has the following properties.
comment
Optional. Specifies a descriptive comment for the step.
scope
Optional. Specifies the name of a record in the pipeline to which you want to restrict this
step. If you want this step to have access to the entire pipeline, leave this field blank.
timeout
Optional. Specifies the maximum number of seconds that the step should run. When the
time is exceeded, the step stops and raises an exception. However, if this step contains an
INVOKE step, the INVOKE step is not interrupted when the timeout value is exceeded.
Instead, the exception is raised after the INVOKE is complete.
If you want to use the value of a pipeline variable for this property, type the variable
name between % symbols. For example, %expiration%.
If you do not want to specify a timeout period, set timeout to zero or leave it blank.
label
Optional. (Required if you are using this step as a target for a BRANCH or EXIT step.)
Specifies a name for this specific step, or a null, unmatched, or empty string ($null,
$default, blank).
in-array
Required. Specifies the input array over which to loop. You must specify a variable in the
pipeline that has an array data‐type; that is, string list, string table, record list, or object
list.
out-array
Optional. Specifies the name of the output variable. The value of this variable is collected
each time through the loop and placed in an output array of this name. You do not need to
specify this property if the loop does not produce output values.
The input variable is not an array variable.
A child step of the LOOP step fails during any iteration of the loop.
The LOOP step does not complete before the timeout period expires.
MAP
The MAP step adjusts the pipeline at any point in a flow. It makes pipeline modifications
that are independent of an INVOKE step.
Within the MAP step, you can:
Map (copy) the value of a pipeline input variable to a new or existing pipeline output
variable.
Drop an existing pipeline input variable. (Keep in mind that once you drop a variable
from the pipeline, it is no longer available to subsequent services in the flow.)
Assign a value to a pipeline output variable.
Perform document‐to‐document mapping in a single view by inserting transformers.
Properties
The MAP step has the following properties.
comment
Optional. Specifies a descriptive comment for this step.
scope
Optional. Specifies the name of a record in the pipeline to which you want to restrict this
step. If you want this step to have access to the entire pipeline, leave this field blank.
timeout
Optional. Specifies the maximum number of seconds that this step should run. When the
time is exceeded, the step stops and raises an exception. However, if this step contains an
INVOKE step (a transformer is essentially an INVOKE step), the INVOKE step is not
interrupted when the timeout value is exceeded. Instead, the exception is raised after the
INVOKE is complete.
If you want to use the value of a pipeline variable for this property, type the variable
name between % symbols. For example, %expiration%.
If you do not want to specify a timeout period, set timeout to zero or leave it blank.
label
Optional. (Required if you are using this step as a target for a BRANCH or EXIT step.)
Specifies a name for this specific step, or a null, unmatched, or empty string ($null,
$default, blank).
REPEAT
The REPEAT step repeatedly executes its child steps up to a maximum number of times
that you specify. It determines whether to re‐execute the child steps based on a repeat on
condition. You can set the repeat condition to one of the following:
Repeat if any one of the child steps fails
Repeat if all of the elements succeed
You can also specify a back‐off time period that you want the REPEAT flow step to wait
before it re‐executes its child steps.
reps = reps + 1
Exit
Properties
The REPEAT step has the following properties.
comment
Optional. Specifies a descriptive comment for this step.
scope
Optional. Specifies the name of a record in the pipeline to which you want to restrict this
step. If you want this step to have access to the entire pipeline, leave this field blank.
timeout
Optional. Specifies the maximum number of seconds that this step should run. When the
time is exceeded, the step stops and raises an exception. However, if this step contains an
INVOKE step, the INVOKE step is not interrupted when the timeout value is exceeded.
Instead, the exception is raised after the INVOKE is complete.
If you want to use the value of a pipeline variable for this property, type the variable
name between % symbols. For example, %expiration%.
If you do not want to specify a timeout period, set timeout to zero or leave it blank.
label
Optional. (Required if you are using this step as a target for a BRANCH or EXIT step.)
Specifies a name for this specific step, or a null, unmatched, or empty string ($null,
$default, blank).
count
Required. Specifies the number of times the REPEAT step re‐executes its child steps while
repeat-on is true. Note that count specifies the maximum number of times that the set of
child steps re‐execute. They are always executed once. For example, if you set count to 0,
children are executed once but cannot be re‐executed. If you set count to 1, children are
executed once, and can be re‐executed once more (max) if the repeat‐on condition is true.
If you want the children re‐executed as long as the specified repeat-on condition
remains true (i.e., no maximum limit), set this value to –1.
If you want to use the value of a pipeline variable for this property, type the variable
name between % symbols. For example, %servicecount%.
backoff
Optional. Specifies the number of seconds to wait between attempts to execute the child
steps. Specify zero (0) to re‐execute the child steps without a delay.
If you want to use the value of a pipeline variable for this property, type the variable
name between % symbols. For example, %waittime%.
repeat-on
Required. Specifies the condition that causes the REPEAT step to re‐execute its child steps.
Specify one of the following:
FAILURE The REPEAT step re‐executes the child steps if any of the child steps fail.
This is the default.
SUCCESS The REPEAT step re‐executes the child steps if all of the child steps succeed.
If the REPEAT step is a child of another step, the failure is propagated to its parent.
SEQUENCE
The SEQUENCE step forms a collection of child steps that execute sequentially. This is
useful when you want to group a set of steps as a target for a BRANCH step.
You can set an exit condition that indicates whether the sequence should exit
prematurely, and if so, under what condition. Specify one of the following exit conditions:
Exit the sequence when a child step fails. Use this condition when you want to ensure that
all child steps are completed successfully. If any child step fails, the sequence ends
prematurely and the sequence fails.
Exit the sequence when a child step succeeds. Use this condition when you want to define
a set of alternative services, so that if one fails, another is attempted. If a child step
succeeds, the sequence ends prematurely and the sequence succeeds.
Exit the sequence after executing all child steps. Use this condition when you want to
execute all of the child steps regardless of their outcome. The sequence does not end
prematurely.
Properties
The SEQUENCE step has the following properties.
comment
Optional. Specifies a descriptive comment for this step.
scope
Optional. Specifies the name of a record in the pipeline to which you want to restrict this
step. If you want this step to have access to the entire pipeline, leave this field blank.
timeout
Optional. Specifies the maximum number of seconds that this step should run. When the
time is exceeded, the step stops and raises an exception. However, if this step contains an
INVOKE step, the INVOKE step is not interrupted when the timeout value is exceeded.
Instead, the exception is raised after the INVOKE is complete.
If you want to use the value of a pipeline variable for this property, type the variable
name between % symbols. For example, %expiration%.
If you do not want to specify a timeout period, set timeout to zero or leave it blank.
label
Optional. (Required if you are using this step as a target for a BRANCH or EXIT step.)
Specifies a name for this specific step, or a null, unmatched, or empty string ($null,
$default, blank).
exit-on
Required. Indicates whether the SEQUENCE step should exit the sequence prematurely,
and if so, under what condition it should exit. Specify one of the following:
FAILURE Exit the sequence when a child step fails.
The SEQUENCE step executes its child steps until either one fails or until
it executes all its child steps. This is the default.
SUCCESS Exit the sequence when a child step succeeds.
The SEQUENCE step executes its child steps until either one succeeds or
until it executes all its child steps.
DONE Exit the sequence after executing all child steps.
The SEQUENCE step executes all of its child steps regardless of whether
they succeed or fail.
The SEQUENCE step does not complete before the timeout period expires.
If exit-on is set to SUCCESS, conditions that will cause a failure include:
All the child steps fail.
The SEQUENCE step does not complete before the timeout period expires.
If exit-on is set to DONE, conditions that will cause a failure include:
The SEQUENCE step does not complete before the timeout period expires.
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
Overview
The webMethods Query Language (WQL) provides the primary mechanism for mapping
data from Web documents. When a Web document is read by webMethods, the XML or
HTML markup within the document is used to parse the contents of the document into
the object model.
XML and HTML markup both consist of tag elements enclosed in angle brackets: < >. In
the process of parsing, tag elements are transformed into arrays of objects; the attributes
of tag elements become object properties. XML and HTML markup both implement
containing elements and empty elements. Containing elements have open and close tags.
Empty elements are single tags.
When a Web document is parsed, the text contained within containing elements becomes
the text property of the corresponding document object.
Data parsed from Web documents is accessed with WQL queries, which consist of one or
more indexed element arrays and an object property.
Object References
For the following object references, x and y represent numerical indexes.
doc.element[x].property
An absolute reference uses a numerical index into an element array.
doc.element[x].element[x].property
Nested element arrays scope the object reference to children elements.
doc.element[x].line[x].property
An array of lines is fabricated when the text property of a document object contains line
breaks.
doc.element[x].^.property
The parent of an element is referenced with ^.
doc.element[x].?[x].property
A ? matches any type of element array.
doc.element[].property
Empty brackets signify that all members of an element array are to be returned.
doc.element|element[].property
The | is used to signify a logical ʹORʹ. The contents of two or more element arrays can be
returned.
doc.element[x-y].property
Returns a range of elements from an array.
doc.element[x-end].property
end is a reserved word that returns the final element of an array.
doc.element[x,y,z].property
Returns items x, y, and z where x, y, and z represent numerical indexes into an element
array.
doc.element[x+y].property
Returns element x and every y element thereafter.
doc.element['match'].property
Returns an array of elements whose text property matches the match string, which can
contain the following wildcard characters:
Match strings are compared with the .text property of the indexed object. The .text
property contains the text of all child objects.
doc.element[/RegularExpression/].property
Returns an array of elements whose text property matches the specified regular
expression. For information about how to construct a regular expression, see “Regular
Expressions” on page 585.
doc.element(property='match').property
Matches the value of a specific element property.
Sibling Operators
WQL provides the following set of operators to refer to siblings of a specified element.
The examples shown in these descriptions refer to the following HTML structure:
The sibling operators are constrained by the current parent. If an operator exceeds the
boundaries of the current parent, a null value is produced for that reference.
doc.element[x].@n.property
References the nth sibling after element[x], regardless of type. Compare with
doc.element[x].+n.property, below.
Example Result
doc.td[0].b[0].@1.text Italic 0
doc.td[0].i[0].@1.text Bold 1
doc.td[0].b[0].@4.text Null
doc.element[x].@-n.property
References the nth sibling prior to element[x], regardless of type. Compare with
doc.element[x].-n.property, below.
Example Result
doc.td[1].b[end].@-2.text Bold 3
doc.td[1].i[end].@-1.text Bold 4
doc.td[1].b[end].@-3.text Null
doc.element[x].+n.property
References the nth sibling after element[x] that is of the same type as element[x]. Compare
with doc.element[x].@n.property, above.
Example Result
doc.td[0].b[0].+1.text Bold 1
doc.td[0].i[0].+1.text Null
doc.td[0].b[0].+3.text Null
doc.element[x].-n.property
References the nth sibling before element[x] that is of the same type as element[x]. Compare
with doc.element[x].@-n.property, above.
Example Result
doc.td[1].b[end].-2.text Null
doc.td[1].i[end].-1.text Italic 1
doc.td[1].b[end].-3.text Null
Object Properties
In addition to the properties derived from the attributes of a parsed XML or HTML tag
element, the following properties are available for all objects:
.text/.txt
Returns the text of an object.
.value/.val
Returns the value of an object. (Equivalent to the text of the object if the element has no
VALUE attribute.)
.source/.src
Returns the XML or HTML source of an object.
.index/.idx
Returns the numerical index of an object.
.reference/.ref
Returns a complete object reference.
Property Masking
Property masking allows for the stripping away of unwanted text from the value of an
object property.
doc.element[x].property[x-y]
Returns a range of characters from position x to y.
doc.element[x].property['mask']
Uses wildcard matching and token collecting to extract desired data from the value of an
object property.
doc.element[x].property[/RegularExpression/]
Uses a regular expression to extract desired data from the value of an object property. For
information about how to construct a regular expression, see “Regular Expressions” on
page 585.
Data Types
Data is passed in and out of a service through an IData object. An IData object is the
collection of name/value pairs on which a service operates. An IData object can contain
any number of elements of any valid Java objects, including additional IData objects and
IDataCodable objects.
Each element stored in an IData object corresponds to an SAP BC data type. The following
table identifies the data types supported by Developer.
SAP BC Data
Type Icon Description Java Data Type
String String of characters. java.lang.String
SAP BC Data
Type Icon Description Java Data Type
Object Any data type that does not Any subclass of
fall into any of the data types java.lang.Object.
described in the above rows,
Example java.util.Vector
will be shown as an Object.
Object List An array of Objects. An array of any subclass of
java.lang.Object.
Example java.util.Vector[ ]
Note: When mapping variables, SAP BC Server handles all data types except string by
reference as well. For more information about mapping variables by reference, see “What
Happens When SAP BC Server Executes a Map Between Variables at Run Time?” on
page 160.
Note: For SAP BC Server built‐in services, you can view the actual data types represented
by Object or Object List icons by looking up the service in the SAP BC Built‐In Services
Guide.
String List
String Table
Record
Record List
Record Reference
Record Reference List
Object
Object List
For detailed information and guidelines for mapping variables of different data types, see
“Mapping Variables of Different Data Types” on page 163.
values, such as String List, String Table, Record List, and Object List. For example, you can
map a String to the second element of a String List.
If you do not specify which element in the array variable that you want to map to or from,
Developer uses the default rules in the Pipeline Editor to determine the value of the target
variable. The following table identifies the default pipeline rules for mapping to and from
array variables.
value X value
Y value
Z value
X [empty] X
Y
Z
X [empty] X
Y Y
Z Z
X A X
Y B Y
Z C Z
No map occurs.
V A
W B
X C
Y
Z
Note: A source variable that is the child of a Record List is treated like an array because
there is one value of the source variable for each record in the Record List. For example:
RecordList1 StringList1
String1
Where the value of RecordList1 is... Then the value of StringList1 is…
RecordList1 StringList1
a
RecordList1 [0] b
c
String1 a
RecordList1 [1]
String1 b
RecordList1 [2]
String1 c
Important! Characters in regular expressions are case‐sensitive.
retains the first 30 characters in each matching element and discards the rest.
This example would return any paragraph containing the string
‘webMethods’ at the beginning of the element or at the beginning of any
line within that element.
$ Match the end of the string or line.
Example doc.p[/webMethods$/].text
This example would return any paragraph containing the string
‘webMethods’ at the end of the paragraph element or at the end of any
line within that element.
* Match the preceding item zero or more times.
Example doc.p[/part *555-A/].text
This example would return any paragraph containing the string ‘part’
followed by zero or more spaces and then the characters ‘555‐A’.
+ Match the preceding item 1 or more times.
Example doc.p[/part number +555-A/].text
This example would return any paragraph containing the string ‘part’
followed by one or more spaces and then the characters ‘555‐A’.
? Match the preceding item 0 or 1 times.
Example doc.p[/part ?555-A/].text
This example would return any paragraph containing the string ‘part
number’ followed by zero or one space and then the characters ‘555‐A’.
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
Syntax. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
Overview
SAP BC Server provides syntax and operators that you can use to create expressions for
use with the BRANCH step and pipeline mapping. In a BRANCH step, you can use an
expression to determine the child step that SAP BC Server executes. At run time, the first
child step whose conditional expression evaluates to “true” is the one that will be
executed. In pipeline mapping, you can place a condition on a map between variables. At
run time, SAP BC Server only performs the map if the assigned condition evaluates to
“true.”
When you write expressions, keep the following points in mind:
Operators, variable names, and strings are case‐sensitive
White space between the tokens of an expression is ignored
For more information about the BRANCH step, see “The BRANCH Step” on page 110. For
more information about applying conditions to maps between variables, see “Applying
Conditions to Maps Between Variables” on page 169.
Syntax
When you create an expression, you need to determine which values to include in the
expression. Values can be represented as variable names, regular expressions, numbers,
and strings. The following table identifies the types of values you can use in an expression
and the syntax for each value type.
Example Explanation
price Value of the price
variable.
%address/postalCode% Value of the postalCode
variable in the address
record.
%poItems[0]% Value of the first
element in the poItems
array.
String ʺstringʺ Literal string. Use this value type to compare the
value of a variable to a string.
–OR–
ʹstringʹ
Example Explanation
“Favorite Customer” Value is the literal string
“Favorite Customer”
‘Favorite Customer’ Value is the literal string
“Favorite Customer”
Note: Strings not enclosed in quotes (ʹ or ʺ) are
interpreted as variable names.
Operators
Expressions can include relational and logical operators. Relational operators are used to
compare values to each other. Logical operators are used to combine multiple expressions
into a single condition.
Relational Operators
You can use the following relational operators in expressions:
Note: When using relational operators to compare strings, SAP
BC Server considers A to be the lowest letter and Z to be the
highest. (e.g, A < B, A < Z).
Logical Operators
You can use the following logical operators in expressions to create conditions consisting
of more than one expression:
Precedence
SAP BC Server evaluates expressions in a condition according to the precedence level of
the operators in the expressions.
The following table identifies the precedence level of each operator you can use in an
expression.
4 and, &, &&
5 or, |, ||
Note: To override the order in which expressions in a condition are evaluated, enclose the
operations you want evaluated first in parentheses. SAP BC Server evaluates expressions
contained in parentheses first.
Note: When using relational operators to compare strings, SAP BC Server considers A to
be the lowest letter and Z to be the highest. (e.g, A < B, A < Z).
Note: You can enclose variable names in %, for example %buyerInfo/state%.
The following illustration shows how the examples in the above table would appear in the
pipeline.
For more information about using variables as values in expressions, see “Syntax” on
page 594.
jcode Template
The following code provides a template describing the tags (highlighted) that the jcode
utility uses to identify code segments in a Java source file. The examples explain in detail
how to specify different service properties within your Java code so that it is only
necessary to store the Java source files in a revision system.
package Folder0;
/**
* This is an example of an empty Java source code file,
* properly annotated for use with the jcode utility. The correct
* annotation is extremely important for services developed on
* versions before 4.8 that should be migrated with the jcode
* utility.
*/
import com.wm.app.b2b.server.Service;
import com.wm.app.b2b.server.ServiceException;
import com.wm.data.*;
import com.wm.util.Values
// --- <<B2B-START-IMPORTS>> ---
jcode Examples
The following are complete examples of properly commented Java source code. Check
them carefully to be aware of all options you have to provide information for services
within your Java coding using the jcode annotations.
* option:
* - required (this parameter is mandatory)
* - optional (this parameter is optional)
* name: the name of the parameter*
* recordname:
* Required parameter if and only if type is recref. It defines the
* referenced record for this parameter in the namespace,
* e.g. pub.flow:transportInfo.
* picklist:
* a comma separated list of values that are shown in a select box,
* when executing the service. If succeeded by ‘*’, it is possible to
* insert a different value as well, i.e. the picklist is editable
* comment:
* if there is a ‘#’ sign all the rest of the line is taken as
* comment for the signature field, which is shown in the properties dialog
*
* To indicate nesting, use a single "-" at the beginning of
* each line for each level of nesting.
*/
public static void createAccount (IData pipeline)
throws ServiceException
{
// --- <<B2B-START(createAccount)>> ---
// @sigtype java 3.5
// [i] field:0:required name # name of the person
// [i] field:0:required gender {male, female}
// [i] field:1:required references
// [i] recref:0:required customer recording.accounts:customerInfo
// [i] record:0:required data
// [i] - field:1:required address
// [i] - field:1:required phone
// [i] - fieldpw:0:required pin
// [o] field:1:required message
// [o] field:1:required id
IDataCursor idc = pipeline.getCursor();
idc.first("name");
/**
* There are some other special comment lines, that can
* preceed the signature fields or can make them unnecessary
* @sigtype signature version
* Specifies which method style the Java Service uses
* - java 3.0
* Stands for the classic Values service methods
* - java 3.5
* Stands for the IData service method
* @spec specification
* Allows referring to a specification defined in the namespace
* instead of specifying the signature with the signature comments.
* The specification is identified by its namespace name.
* @deprecated deprecation comment
* This annotation allows marking a service as deprecated.
* The deprecation comment will be shown in the Developer at several
* places.
* @stateless
* Marks the service to be stateless
*/
public static void createSingleAccount (IData pipeline)
throws ServiceException
{
// --- <<B2B-START(createSingleAccount)>> ---
// @sigtype java 3.5
// @spec recording:singleAccountSignature
// @deprecated use recording.account:createAccount instead
IDataCursor idc = pipeline.getCursor();
String name = IDataUtil.getString(idc, “name”);
IData data = IDataUtil.getIData(idc, “data”);
// Do something with the information here.
IDataUtil.put(idc, "message", "createSingleAccount not fully
implemented");
IDataUtil.put(idc, "id", "00000000");
idc.destroy();
// --- <<B2B-END>> ---
return;
}
/**
* == COMPLEX SIGNATURES ==
* The getAccount service. This service takes a single string
* "id", and returns a complex structure representing the
* account information. Note the use of the helper functions
* (defined below).
*/
public static void getAccount (IData pipeline)
throws ServiceException
{
// --- <<B2B-START(getAccount)>> ---
// @sigtype java 3.5
// [i] field:0:required id
// [o] record:1:required account
// [o] - field:0:required name
// [o] - field:1:required refs
// [o] - record:0:required contact
// [o] -- field:0:required address
// [o] -- field:0:required phone
// --- <<BC-COMMENT>> ---
// Line comments between the enclosing two annotation comments
// will appear in the comments text area on the Input/Output tab
// in the Developer and can be used for documenting services.
// --- <<BC-COMMENT-END>> ---
IDataCursor idc = pipeline.getCursor();
if(idc.first("id"))
{
try
{
String id = IDataUtil.getString(idc);
IData data = getAccountInformation(id);
idc.last();
idc.insertAfter ("account", data);
}
catch (Exception e)
{
throw new ServiceException(e.toString());
}
}
idc.destroy();
// --- <<B2B-END>> ---
return;
}
/**
* == SHARED SOURCE ==
* This is where the shared code lives. This includes both
* global data structures and non-public functions that aren't
* exposed as Services. Note the tags delimiting the start
* and end of the shared code section.
*/
// --- <<B2B-START-SHARED>> ---
private static Vector accounts = new Vector();
private static IData getAccountInformation (String id) {
throw new RuntimeException ("this service is not implemented yet");
}
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
Overview
You can apply content constraints to variables in the records, specifications, or service
signatures that you want to use as blueprints in data validation. Content constraints
describe the data a variable can contain. At validation time, if the variable value does not
conform to the content constraints applied to the variable, the validation engine considers
the value to be invalid. For more information about validation, see “Performing Data
Validation” on page 209.
When applying content constraints to variables, you can do the following:
Select a content type. A content type specifies the type of data for the variable value,
such as string, integer, boolean, and date. A content type corresponds to a simple type
definition in a schema.
Set constraining facets. Constraining facets restrict the content type, which in turn,
restrict the value of the variable to which the content type is applied. Each content
type has a set of constraining facets. For example, you can set a length restriction for a
string content type, or a maximum value restriction for an integer content type.
For example, for a String variable named itemQuantity, you might specify a content type
that requires the variable value to be an integer. You could then set constraining facets
that limit the content of itemQuantity to a value between 1 and 100.
The content types and constraining facets described in this appendix correspond to the
built‐in data types and constraining facets in XML Schema. The World Wide Web
Consortium (W3C) defines the built‐in data types and constraining facets in the
specification XML Schema Part 2: Datatypes (http://www.w3c.org/TR/xmlschema‐2).
Content Types
The following table identifies the content types you can apply to String, String List, or
String Table variables. Each of these content types corresponds to a built‐in simple type
defined in the specification XML Schema Part 2: Datatypes.
Note: The anyURI type indicates that the variable value plays the
role of a URI and is defined like a URI. SAP BC Server does not
validate URI references because it is impractical for applications
to check the validity of a URI reference.
hexBinary Hex‐encoded binary data.
Constraining Facets
enumeration, length, maxLength, minLength, pattern
ID A name that uniquely identifies an individual element in an
instance document. The value for ID needs to be a valid XML
name. The ID datatype represents the ID attribute type from the
XML 1.0 Recommendation.
Constraining Facets
enumeration, length, maxLength, minLength, pattern,
whiteSpace
Note: In earlier versions of SAP BC Server (SAP BC versions 3.5 through version 4.0), you
could apply the NOTATION and QName content types to variables. However, these
implementations were based on earlier drafts of XML Schema specification produced by
the W3C. In the XML Schema Recommendation, the definition of NOTATION and
QName changed. These types can only be used as the type definitions for elements or
attributes in an XML Schema definition used to validate an XML instance document.
Consequently, you can no longer apply the NOTATION and QName content types to
variables in a record, a specification, or to a service signature.
Constraining Facets
When you apply a content type to a variable, you can also set constraining facets for the
content type. Constraining facets are properties that further define the content type. For
example, you can set a minimum value or precision value for a decimal content type. Each
content type has a set of constraining facets. The constraining facets described in the
following table correspond to constraining facets defined in the specification XML Schema
Part 2: Datatypes.
Note: Previous versions of XML Schema contained the constraining facets duration,
encoding, period, precision, and scale. However, these constraining facets are not included in
the recommendation of XML Schema Part 2: Datatypes. The constraining facets duration,
encoding, and period were removed. precision was renamed totalDigits. scale was renamed
fractionDigits. If you view an SAP BC schema created from an XML Schema Definition that
used pre‐Recommendation version of XML Schema (before May 2001) the Constraints tab
and Schema tab will display the constraining facets that were available in the pre‐
Recommendation version of XML Schema.
Note: On the Constraints tab and Schema tab, the word “fixed” appears next to the name of
constraining facets with a fixed value. When a facet has a fixed value, the facet is called a
fixed facet. Fixed facets cannot be edited.
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
Overview
This appendix describes error messages that can occur during data validation, SAP BC
schema generation, or record generation.
When the validation engine in the SAP BC Server validates objects (XML documents, the
pipeline, or records), and the object does not conform to the blueprint or model, the server
generates errors and/or exceptions. You might also receive errors and exceptions when
creating an SAP BC schema. The following sections describe the errors and exceptions you
can receive when performing validation and when creating an SAP BC schema.
Validation Errors
When you perform validation using a built‐in service, SAP BC Server returns validation
errors in the errors output variable if the object is invalid. When you perform input/output
validation, SAP BC Server throws an exception if the inputs or outputs are invalid. Error
messages are contained in the exception.
Each validation error contains a code and a default message. Error codes that begin with
DT are data type validation errors—errors pertaining to the content type constraints
applied to the variables. Error codes that begin with NV are node validation errors—
errors pertaining to an XML document. Error codes that begin with VV are record
validation errors—errors pertaining to the structure of the data values (for example, an
invalid record structure).
The following table describes the validation errors you can receive when performing
XML, pipeline, or record validation.
However, the schema processor is unable to resolve the
QName using the namespace declarations in the instance
document.
NV‐014 [B2BCORE.0082.9017] %Type‐b% is not validly derived
from %Type‐a%
This error occurs when %Type‐b% is used in a context
where %Type‐a% is expected, and one of the following is
true:
%Type‐b% is not the same as
%Type‐a%
–OR–
%Type‐b% is not validly derived from %Type‐a%
NV‐015 [B2BCORE.0082.9018] %Type‐i% is an abstract type and
cannot be used directly to validate content
%Type‐i% is an abstract type that has been either declared
or nominated. Abstract types cannot be used to directly
validate the contents of an element.
NV‐016 [B2BCORE.0082.9019] %Element Decl A% is an abstract
element and cannot appear in an instance
The element declaration is an abstract element and cannot
appear in an instance document.
Validation Exceptions
At run time, the service performing validation either succeeds or fails. If the service fails,
SAP BC Server throws a validation exception. A validation exception is generated if one of
the following is true:
Errors are detected in the object (XML document, pipeline, or Record) that is passed
(e.g., null value).
The basic validation contract is violated (e.g., a binary tree is passed instead of a
record as expected).
You specify that the service should fail if the object to be validated (XML document,
pipeline, or record) did not conform to the SAP BC schema or record (e.g., failIfInvalid
= true). If this is the reason for the exception, SAP BC Server inserts the validation
errors into the exception message.
The following table identifies and describes the validation exceptions that can be
generated.
Note: You might also receive these errors and warnings when you generate a record or
flow service from an XML Schema definition, DTD, or XML document that references a
DTD. For more information about creating a record, see “Creating a Record” on page 200.
For more information about creating a flow service, see “Creating a New Flow Service” on
page 76.
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
Overview
When you use the New command to generate a Web Service Connector from a WSDL
document, SAP BC Developer displays a message stating whether the Web Service
Connector generated successfully.
If SAP BC Developer generated the Web Service Connector successfully, but warnings
occurred, SAP BC Developer displays the message
“WSDL Connector created successfully but with warnings.”
If SAP BC Developer could not create the Web Service Connector or could not create some
flow steps in the Web Service Connector, SAP BC Developer displays the message
“Error occurred while creating Web Service Connector.”
When you click the Details button, SAP BC Developer lists the name and location of the
WSDL for which you are generating a Web Service Connector, the path name to the
WSDL element for which the error or warning occurred, and the error or warning code.
Location of error or
warning within the
WSDL document.
Message code.
Name of WSDL
elements which caused
error or warning.
Note: SAP BC Developer might generate some of the flow steps in the Web Service
Connector or some of the supporting SAP BC elements (records, folders, or SAP BC
schemas) before it encounters errors or warnings. The generated elements appear in the
Service Browser.
[B2BCORE.0092.9005] Error: SOAP binding has an unsupported transport value, binding was not
created.
In the WSDL document, the transport attribute in <soap:binding> element specifies an
unsupported SOAP transport. SAP BC Developer can generate a binding for a SOAP
binding only if the transport value is http://schemas.xmlsoap.org/soap/http.
SAP BC Developer generates the Web Service Connector, but the Web Service Connector
does not contain a SEQUENCE step that corresponds to this binding. In the Web Service
Connector, the BRANCH on '/binding' step contains a child SEQUENCE step for each unique
<binding> associated with an <operation>.
[B2BCORE.0092.9006] Error: SOAP binding does not contain a transport attribute, binding was not
created.
In the WSDL document, the <soap:binding> element does not contain a transport
attribute. The transport value indicates which transport of SOAP the binding uses. It is
required for a SOAP binding. The transport attribute value must be
http://schemas.xmlsoap.org/soap/http.
SAP BC Developer generates the Web Service Connector, but the Web Service Connector
does not contain a SEQUENCE step that corresponds to this binding. In the Web Service
Connector, the BRANCH on '/binding' step contains a child SEQUENCE step for each unique
<binding> associated with an <operation>.
[B2BCORE.0092.9007] Error: SOAP binding has an unrecognized style value, binding was not created.
In the WSDL document, the <soap:binding> element specifies a value other than rpc or
document for the style attribute.
SAP BC Developer generates the Web Service Connector, but the Web Service Connector
does not contain a SEQUENCE step that corresponds to this binding. In the Web Service
Connector, the BRANCH on '/binding' step contains a child SEQUENCE step for each unique
<binding> associated with an <operation>.
[B2BCORE.0092.9009] Error: HTTP binding does not contain required verb attribute, binding was not
created.
In the WSDL document, the <http:binding> element does not contain the verb attribute.
The value of the verb attribute must be GET or POST.
SAP BC Developer generates the Web Service Connector, but the Web Service Connector
does not contain a SEQUENCE step that corresponds to this binding. In the Web Service
Connector, the BRANCH on '/binding' step contains a child SEQUENCE step for each unique
<binding> associated with an <operation>.
[B2BCORE.0092.9010] Error: HTTP binding has an unsupported verb attribute, binding was not
created.
In the WSDL document, the <http:binding> element specifies a verb attribute value
other than GET or POST.
SAP BC Developer generates the Web Service Connector, but the Web Service Connector
does not contain a SEQUENCE step that corresponds to this binding. (In the Web Service
Connector, the BRANCH on '/binding' step contains a child SEQUENCE step for each unique
<binding> associated with an <operation>.)
[B2BCORE.0092.9011] Error: Mime binding style is unsupported, binding was not created.
The WSDL document specifies a MIME binding style for the entire <binding>. SAP BC
Developer only supports the MIME binding style to describe the inputs and outputs of an
HTTP binding. SAP BC Developer cannot generate a binding when the MIME binding
style is specified outside of the HTTP binding context.
SAP BC Developer generates the Web Service Connector, but the Web Service Connector
does not contain a SEQUENCE step that corresponds to this binding. (In the Web Service
Connector, the BRANCH on '/binding' step contains a child SEQUENCE step for each unique
binding associated with an operation.)
[B2BCORE.0092.9013] Warning: The operation's binding does not have any ports, no ports were
generated for the Web Service Connector.
SAP BC Developer cannot find a <port> element that corresponds to a particular
<binding> element. A <port> element specifies a network address or endpoint for a
binding.
SAP BC Developer generates the Web Service Connector, but does not generate any MAP
steps for setting the binding and address information. In a Web Service Connector, the
BRANCH on '/_port' step contains a child portName MAP step for each <port> associated with
the <operation>. When this warning occurs, the BRANCH on '/_port' step contains no child
portName MAP steps.
[B2BCORE.0092.9014] Warning: The operation does not have any valid ports, no ports were generated
for the Web Service Connector.
The WSDL document does not contain any valid <port> elements for an <operation>.
The WSDL document might not contain any <port> elements or a <port> element might
reference a non‐existent <binding> element. (A <binding> element associates a protocol
with an <operation>.)
SAP BC Developer generates the Web Service Connector, but does not generate any
portName MAP steps for setting the binding and address information. In a Web Service
Connector, the BRANCH on '/_port' step contains a child portName MAP step for each <port>
associated with the <operation>. When this warning occurs, the BRANCH on '/_port' step
contains no child portName MAP steps.
[B2BCORE.0092.9015] Warning: Port does not have a valid binding type, port was not generated.
The WSDL document contains a <port> element that does not contain the binding
attribute.
SAP BC Developer generates the Web Service Connector, but does not generate a MAP
step for this port. In a Web Service Connector, the BRANCH on '/_port' step contains a child
portName MAP step for each <port> associated with the <operation>. The portName
MAP step sets the binding and address information for a port.
[B2BCORE.0092.9016] Warning: Port does not have a location value, port was not generated.
Within the <port> element, the <address> element does not specify a value for the
location attribute. The location attribute specifies the network address or endpoint for
the service.
SAP BC Developer generates a Web Service Connector, but without the network address,
SAP BC Developer cannot generate a MAP step for this port. In a Web Service Connector,
the BRANCH on '/_port' step contains a child portName MAP step for each <port> associated
with the <operation>. The portName MAP step sets the binding and address information
for a port.
Note: This warning is the same as [B2BCORE.0092.9019].
[B2BCORE.0092.9017] Warning: Port does not have required address element, port was not
generated.
The selected WSDL document does not contain an <address> element within the
specified <port> element. The <address> element carries an attribute that specifies the
location or network address for of the Web Service.
SAP BC Developer generates a Web Service Connector, but does not generate a MAP step
for this port. The portName MAP step sets the binding and address information for a port.
Without the <address> element, SAP BC Developer cannot set the address information
and therefore cannot generate a MAP step.
[B2BCORE.0092.9018] Warning: Port does not have required location attribute, port was not
generated.
Within the <port> element, the <address> element does not carry the location attribute.
The location attribute specifies the network address for the service.
SAP BC Developer generates a Web Service Connector, but does not generate a MAP step
for this port. The portName MAP step sets the binding and address information for a port.
Without the location attribute, SAP BC Developer cannot set the address information,
and therefore cannot generate a MAP step.
[B2BCORE.0092.9019] Warning: Port does not have a location value, port was not generated.
Within the <port> element, the <address> element does not specify a value for the
location attribute. The location attribute specifies the network address or endpoint for
the service.
SAP BC Developer generates a Web Service Connector, but without the network address,
SAP BC Developer cannot generate a MAP step for this port. The portName MAP step set
the binding and address information for a port. In a Web Service Connector, the BRANCH
on '/_port' step contains a child portName MAP step for each <port> associated with the
<operation>.
Note: This warning is the same as [B2BCORE.0092.9016].
[B2BCORE.0092.9020] Error: Operation is not referenced by any binding, Web Service Connector was
not created.
The WSDL document does not specify a <binding> element for the <operation>. Each
<operation> within a <portType> element needs to correspond to an <operation>
element within a <binding> element. Without a binding, the WSDL document does not
provide any information about how to invoke the Web Service.
SAP BC Developer does not generate a Web Service Connector for the <operation>.
[B2BCORE.0092.9021] Error: Input and Output messages missing, invalid operation, Web Service
Connector was not created.
In the WSDL document, the <operation> element within a <portType> element does not
declare an input message or an output message. An input message is declared using the
<input> element. An output message is declared using the <output> element. For SAP
BC Developer to generate a Web Service Connector for the <operation>, the
<operation> element must identify an input message—the <operation> element must
contain an <input> element.
SAP BC Developer does not generate a Web Service Connector for the <operation>.
[B2BCORE.0092.9022] Error: Input message missing, Notification operations not supported. Web
Service Connector was not created.
In the WSDL document, the <operation> element does not declare an input message, but
it does declare an output message. In other words, the <operation> element does not
contain a child <input> element, but does contain a child <output> element. This
structure corresponds to the grammar for a notification operation. SAP BC Developer
does not generate Web Service Connectors for notification operations.
[B2BCORE.0092.9023] Error: Output message precedes Input message, Solicit Response operations
not supported. Web Service Connector was not created.
In the WSDL document, the <operation> element declares an <output> element (output
message) before the <input> element (input message). This describes a solicit‐response
operation. SAP BC Developer does not generate Web Service Connectors for solicit‐
response operations.
[B2BCORE.0092.9024] Error: HTTP binding has mime multipart Input. Multipart Input is not supported.
Binding was not generated.
The <binding> element specifies a multi‐part MIME binding for the operation. SAP BC
Developer does not support this type of binding.
SAP BC Developer generates the Web Service Connector, but the Web Service Connector
does not contain a SEQUENCE step that corresponds to this binding. In the Web Service
Connector, the BRANCH on '/binding' step contains a child SEQUENCE step for each unique
binding associated with an operation.
[B2BCORE.0092.9025] Error: HTTP Binding input is of type http:urlReplacement. http:urlReplacement
is not supported. Binding was not generated.
The <binding> element specifies <http:urlReplacement> as the binding for the
operation input. SAP BC Developer does not support this type of binding for the input
message.
SAP BC Developer generates the Web Service Connector, but the Web Service Connector
does not contain a SEQUENCE step that corresponds to this binding. In the Web Service
Connector, the BRANCH on '/binding' step contains a child SEQUENCE step for each unique
binding associated with an operation.
[B2BCORE.0092.9026] Error: HTTP Binding input is of an unknown type. Binding was not generated.
The input binding specifies an unknown binding type. When the protocol is HTTP POST,
the <mime:content> element for the input binding must specify text/xml, text/plain,
or application/x-www-form-urlencoded for the type attribute. (The <mime:mimeXml>
element is also valid for the input binding.) When the protocol is HTTP GET, the input
binding must contain the child element <http:urlEncoded>.
SAP BC Developer generates the Web Service Connector, but the Web Service Connector
does not contain a SEQUENCE step that corresponds to this binding. (In the Web Service
Connector, the BRANCH on '/binding' step contains a child SEQUENCE step for each unique
binding associated with an operation.)
[B2BCORE.0092.9027] Error: HTTP Binding output mime parts are missing. Binding was not
generated completely.
The <binding> element specifies MIME binding for the output message, but the output
binding does not specify a message part for the <mime:content> element or the output
binding is missing <mime:part> elements.
SAP BC Developer generates the Web Service Connector, and generates a SEQUENCE
step that corresponds to this binding. (In the Web Service Connector, the BRANCH on
'/binding' step contains a child SEQUENCE step for each unique binding associated with an
operation.) However, SAP BC Developer does not generate a complete binding because
the output binding in the WSDL document does not provide the part name information
that SAP BC Developer needs to map out the service results to variables in the pipeline.
Specifically, the Web Service Connector does not contain the BRANCH on '/numParts' step for
this binding.
[B2BCORE.0092.9028] Error: HTTP Binding output mime part is missing its type. Binding was not
generated completely.
The <binding> element specifies MIME binding for the output message, but the
<mime:content> element for the output binding does not specify a value for the type
attribute. The type attribute specifies the MIME type.
SAP BC Developer generates the Web Service Connector, and generates a SEQUENCE
step that corresponds to this binding. (In the Web Service Connector, the BRANCH on
'/binding' step contains a child SEQUENCE step for each unique binding associated with an
operation.) However, SAP BC Developer does not generate a complete binding because
the output binding in the WSDL document does not provide the part name information
that SAP BC Developer needs to map out the service results to variables in the pipeline.
Specifically, in the Web Service Connector, the BRANCH on '/loopCount' step does not have a
child SEQUENCE step for mapping the output message part to the pipeline.
[B2BCORE.0092.9029] Warning: Generated record, {record name}, already exists in namespace.
The record that SAP BC Developer generated for the input or output message already
exists in the server namespace. SAP BC Developer will not generate a duplicate record.
[B2BCORE.0092.9030] Error: Input does not have a valid message reference, Web Service Connector
was not created.
Within the <operation> element, the message attribute for the <input> element does not
reference a <message> element within the WSDL. SAP BC Developer cannot find the
message specified by the message attribute, or the message attribute does not have a
value. SAP BC Developer does not generate a Web Service Connector for the
<operation>.
Note: The message attribute value must be a QName.
[B2BCORE.0092.9031] Error: Output does not have a valid message reference, Web Service
Connector was not created.
Within the <operation> element, the message attribute for the <output> element does
not reference a <message> element within the WSDL. SAP BC Developer cannot find the
message specified by the message attribute or the message attribute does not have a
value. SAP BC Developer does not generate a Web Service Connector for the
<operation>.
Note: The message attribute value must be a QName.
[B2BCORE.0092.9032] Error: Invalid schema definition for Input signature. Web Service Connector
was not created.
The XML Schema definition that contains element declarations or type definitions for the
<part> elements in the input message is invalid. Alternatively, the XML Schema
definition does not contain the element declarations or type definitions referenced by the
<part> elements. SAP BC Developer does not generate a Web Service Connector for the
<operation>.
Note: This error message is usually accompanied by specific SAP BC schema generation
errors. For more information about errors that occur when generating an SAP BC schema
from an XML Schema, see “SAP BC Schema Generation Errors and Warnings” on
page 643.
[B2BCORE.0092.9033] Error: Invalid schema definition for Output signature. Web Service Connector
was not created.
The XML Schema definition that contains element declarations or type definitions for the
<part> elements in the output message is invalid. Alternatively, the XML Schema
definition does not contain the element declarations or type definitions referenced by the
<part> elements. SAP BC Developer does not generate a Web Service Connector for the
<operation>.
Note: This error message is usually accompanied by specific SAP BC schema generation
errors. For more information about errors that occur when generating an SAP BC schema
from an XML Schema, see “SAP BC Schema Generation Errors and Warnings” on
page 643.
[B2BCORE.0092.9034] Warning: Found port with an invalid binding reference, the port was not
generated.
In the WSDL document, a <port> element contains a binding attribute that references a
<binding> that does not exist within the WSDL document. SAP BC Developer cannot
find the <binding> element specified by the binding attribute.
SAP BC Developer generates the Web Service Connector, but does not generate a MAP
step for this port. The portName MAP steps set the binding and address information for a
port. In a Web Service Connector, the BRANCH on '/_port' step contains a child portName
MAP step for each <port> associated with the <operation>.
Note: The binding attribute value must be a QName.
Note: The type attribute value must be a QName.
[B2BCORE.0092.9037] Error: HTTP Binding input type could not be found. Binding was not generated.
SAP BC Developer cannot determine the input MIME type for the HTTP binding.
SAP BC Developer generates the Web Service Connector, but the Web Service Connector
does not contain a SEQUENCE step that corresponds to this binding. (In the Web Service
Connector, the BRANCH on '/binding' step contains a child SEQUENCE step for each unique
binding associated with an operation.)
[B2BCORE.0092.9138] Error: Unknown binding style was found, binding was not created.
The <binding> element specifies a protocol other than SOAP, HTTP, or MIME.
SAP BC Developer generates the Web Service Connector, but the Web Service Connector
does not contain a SEQUENCE step that corresponds to this binding. (In the Web Service
Connector, the BRANCH on '/binding' step contains a child SEQUENCE step for each unique
binding associated with an operation.)
[B2BCORE.0092.9039] Error: URL encoding does not support input variables other than strings and
string lists.
The input parameters declared on the Input/Output tab contain a variable that is not a String
or a String List. When URL encoding is specified as the input format for the HTTP POST
or HTTP GET protocols, SAP BC Server uses the input parameters declared on the
Input/Output tab of the service to construct the input message for the WSDL document. For
URL encoding, the input signature can contain only String and String List variables. The
input signature should not contain Record, Record List, Objects, Object Lists, or String
Table variables because these variables cannot be represented in name=value pairs in the
HTTP request.
[B2BCORE.0092.9040] Error: PortType name is zero length, Web Service Connector was not created.
In the WSDL document, the <portType> element carries the name attribute, but the name
attribute does not have a value. SAP BC Developer does not generate a Web Service
Connector.
[B2BCORE.0092.9041] Error: Operation name is zero length, Web Service Connector was not created.
In the WSDL document, the <operation> element carries the name attribute, but the
name attribute does not have a value. SAP BC Developer does not generate a Web Service
Connector.
[B2BCORE.0092.9042] Error: text/xml does not support string tables.
When you generate a WSDL document and specify HTTP POST or HTTP GET as the
protocol, you can select a record to describe the format of the XML document expected by
or produced by the service. The record cannot contain a String Table variable because
multi‐dimensional arrays cannot be represented in an XML Schema. (SAP BC Developer
generates an XML Schema to define types for variables in the record.)
To resolve this error, remove the String Table variable from the record, or select a different
record.
[B2BCORE.0092.9043] Error: Schema Error: error text
The XML Schema definition that defines the types and elements for the input and/or
output message parts is invalid. The schema errors are listed. For information about errors
that occur when SAP BC Server processes an XML Schema definition, see “SAP BC
Schema Generation Errors and Warnings” on page 643.
[B2BCORE.0092.9102] fileName: Not a valid web service description document.
The file you selected to generate the Web Service Connector from is not a .wsdl or .wsd
file. You can only generate Web Service Connectors from files with a .wsdl or .wsd file
name extension.
Index
event handler sample 533 step layout in flow diagram view 147
event handlers 533 character ranges 419
flow services 70 checking, ACLs for services 93
built-in services child flows
for arithmetic operations 179 stepping in/out of child flows 265
for date/time transformations 179 tracing 263
for node validation 229 children of a flow step 104
for pipeline validation 222 choice content model 193
for record validation 229 circular dependencies 64
for remote services 108 class files
for string manipulation 179 location of 305
for XML validation 219 class files, location of 298
invoking 108 classes subdirectory 305
pub.schema:validate 219, 229 clearing
pub.schema:validatePipeline 222 breakpoints in flow steps 267
byte content constraint 613 breakpoints on transformers 268
clear-signing, S/MIME messages 468
C client applications
C/C++ clients creating browser-based 329
creating 322, 323 creating C/C++ 322
creating a make file 324 creating Excel 327
for database services 445 creating Java 320
C/C++ services creating Visual Basic 324
accessing databases through 442 for database services 444, 445
compiling with a make file 306 closing a session on SAP BC Server 47
creating 306, 307 coded services 288
caching collapse white space 624
definition of 88 collapsing transformers 185
elements to improve Developer performance 50 COM objects
services not suited for 89 binding options 313
services suited for 88 invoking as services 311
setting 90 using withSAP BC Platform 310
using prefetch 90 COM services
call stack 256 creating 310
CDATA content constraint. See normalizedString content invoking 313, 315
constraint combining Trace and Step commands 261
Certificate Authorities 467, 483, 484, 497 commands
certificate chains 467, 483, 484, 497 Disable Step 269, 271
certificates. See digital certificates Enable Step 269, 271
changing Load Pipeline Locally 278
level of a step 104 Reset 261
passwords 48 Save Pipeline from Server 278
position of an step 104 Save Pipeline Locally 276
creating Record 33
code for Java services 296 Record List 33
event filters 529 Record Reference 34
event filters for services 531 Record Reference List 34
event handler sample 533 representation in XML Schemas 348
event handlers 533 String 33
flow services 75, 76 String List 33
folders 76, 306 supported by SAP BC Server 578
IS schemas 195 tables 579
Java services with an IDE 301 Values objects 580
Java services with C/C++ 306 data validation
Java services with Developer 291, 295 allowing undeclared variables 213
Java services with Visual Basic 310, 312 applying constraints 211
Java services with your own IDE 298 benefits of 210
links to array variables 580 blueprints for 210
links to record variables 163 content constraints 211
packages 57 description of 210
specifications for C/C++ services 306 errors 628
version numbers for packages 61 exceptions 233, 639
Web Service Connectors 366 input/output validation
WSDL documents description of 226
default.xsd 344 performing via Input/Output tab 227
describing service signature 353 performing via INVOKE step properties 228
files produced 344 node validation
HTTP GET protocol 359 description of 229
HTTP POST protocol 359 performing 229
namespaces.dtd 345 performing
prefix.xsd 344 input/output validation 226
process overview 340 node validation 229
SOAP Message protocol 352 pipeline validation 222
SOAP RPC protocol 341 record validation 229
ST#.xsd 345 XML validation 219
URL encoding restrictions 359 pipeline validation
cursors 289 description of 222
customizing, content types 213 performing 222
record validation
D description of 229
data transformations, defined 150 performing 229
data types requiring variable existence 212
IData objects 580 structural constraints 211
mapping with Pipeline Editor 163 types of 210
Object 34 XML validation
Object List 34 description of 218
port status events 524, 545 creating filters for services 531
building handlers 545 deleting subscriptions to 532
uses 545 editing subscriptions to 531
replication events 524, 546 guaranteed delivery 542
building handlers 546 subscribing to 526
uses 546 suspending subscriptions to 532
run-time behavior 525 types of 524
session end events 547 viewing subscriptions to 531
building handlers 548 Excel clients, creating 327
default handler 548 exception events
session events 524, 546 building handlers for 540
uses 547 default audit handler 541
session expire events 547 description of 524, 540
building handlers 548 error.log file 541
default handler 549 exceptions
session start events 547 during a test 255
building handlers 547 for data validation 233, 639
default handler 547 executing services from Developer 249
stat events 524, 549 existing record. See record reference
building handlers 549 EXIT step
default handler 550 creating 131
uses 549 definition of 73, 557
subscriptions using in a flow 130
creating 526 exit-on property 125
creating filters for 529 expanding transformers 185
deleting 532 expired certificate error 497
editing 531 explicit mapping, description of 156
managing 526 explicit signatures, S/MIME messages 468
suspending 532 explicit universal name
viewing 531 use in WSDL document 345
transaction events 525, 550 exporting, elements and packages 60
Tx End events 551 expressions
building handlers 551 addressing pipeline variables in 601
default handler 552 branching on 113
uses 551 operators for 597
Tx Start events 551 syntax for 594
building handlers 551 using for pipeline mapping 169
default handler 552 extending the Java class 294
uses 551 extends (Java keyword) 294
viewing subscriptions 532 external records. See records
events external specification. See specification
See also event handlers, Event Manager externally invoked services, description of 93
creating filters 529 extract_EncryptedSMIME sample service 501
operators WmDB 54
for conditional expressions 597 WmPartners 54
logical 599 WmPublic 54
relational 597 WmWin32 55
optional variables for validation 212 parameters
or operator 599 applying constraints 211
out-array property 128 benefits of declaring 82
output element, in WSDL document 347 declaring 78, 80, 81, 86
output signature, describing for WSDL documents 353, 360 declaring for a service 82, 84
output templates parent/child relationships in a flow 104
assigning to a service 91 parsing documents 382
definition of 91 part element, in WSDL document 337, 346, 347
output variables passing XML to a service 372
declaring 84 passwords
declaring for a service 81 changing 48
declaring in a record 200 requirements 49
mapping considerations 158 patch history
mapping in the pipeline 157 removal by Integration Server 62
Overwrite Pipeline Value option 173 viewing for a package 62
pattern constraining facet 215, 624
P pattern matching
packages in event subscriptions 529
accessing documentation 58 in queries 414, 424
adding 57 PDF, viewing 23
assigning version numbers 61 Perform Variable Substitution option 173
creating 57 performing
creating circular dependencies 64 data validation
Default 54 benefits of 210
definition of 54 blueprints for 210
deleting 59 description of 210
dependencies, using with startup services 65 input/output validation 226
description of 54 node validation 229
documenting 58 pipeline validation 222
exporting 60 record validation 229
guidelines for creating 57 types of 210
identifying dependencies 63 XML documents 219
importing into Java services 294, 299 input/output validation 226
reloading 59 node validation 229
reloading vs refreshing 59 pipeline validation 222
removing dependencies 64 record validation 229
required by Java services 299 XML validation 218
sample services 54 pipeline
viewing patch history 62 adding variables to 176
extracting data from signed messages 496 using savePipelineToFile service 277
header fields 468, 469, 471 your work 40
implicit signatures 468, 469 scalar variables
invalid certificates 497 default behavior for mapping 580
message digest 468 description of 580
message integrity algorithm 468 mapping to or from array variables 580
nonrepudiation of 468 representation in XML Schemas 349
private keys 467, 470, 483, 484, 485, 500, 501 scale constraining facet 623
public keys 467, 470, 487 Schema Browser, description of 191
services 472 Schema Details area, description of 194
signature verification error codes 497 schema processor, description of 195
signing 483 schema services
signing and encrypting 489 for node validation 229
testing for encryption 500 for pipeline validation 222
testing for signature 496, 498 for record validation 229
trusted CAs 483, 484, 497 for XML validation 219
verifying signature of 496, 497, 498 Schema tab 190
Sample View tab 403 scope
SAP BC Developer of a query 414
main window 28 property 116
online help 51 Secure Multipurpose Internet Mail Extensions. See S/MIME
starting 26 security
supported data types 578 assigning ACLs to folders 95
SAP BC Server assigning ACLs to services 95
access requirements for 26 inheriting ACLs 94
closing a session 47 Internal ACL 95
connecting to 27, 47 managing for services 93
disconnecting from 47 removing ACLs from folders 97
logging on to 27 removing ACLs from services 97
notification of shutdown 48 Send XML File command 258
opening a session 47 sending XML documents
performing ACL checking 93 to a service 372
supported data types 578 via email 378, 387
SAP BC Type Library 321, 324, 327 via FTP 376
Save Pipeline from Server command 278 via HTTP 375
Save Pipeline Locally command 276 sequence content model 193
Save Pipeline to Server command 276 SEQUENCE step
savePipelineToFile service 277, 278 as target for a BRANCH 115
saving definition of 73, 568
input values to a file 251 setting exit condition 125
IS elements 40 using in a flow 125
test results 275 server. SeeSAP BC Server
from Results tab 276 server.log file 281
Y
year content constraint. See gYear content constraint
Z
zones. See drop zones
zooming
in a window 35
in on transformers 185