You can create a web service that you expose to external systems so that they can access
capabilities from a workflow
automation.
About this task
To provide a way for an external system or application
to call your services, create and publish a web service endpoint.
The web service endpoint invokes an operation that calls a particular
service or set of services.
All operations that you expose
in a web service are request-response operations. Even an operation
that is bound to a service that has no outputs is still a request-response
operation that has no output. One-way operations are not supported.
Tip: The endpoint address for a web service is in the following format:
https://host_name:port/[custom_prefix/]teamworks/webservices/process_app_name/[snapshot_name/]web_service_name.tws
If
you do not specify the snapshot_name in the endpoint URL, it points to the tip
snapshot of the default branch for the playback server or to the default snapshot for a workflow
server.
Procedure
To create the web service:
- Open the designer.
- Select the plus sign next to Exposed Automation Services and then
select Web Service from the list.
- Name the new web service.
Note: Only ASCII characters are allowed in the following:
- The name of the web service
- The target namespace of the web service (see step 4)
- The target namespace of the workflow automation, or toolkit settings (see step 4)
- The name of an operation (see step 5)
- The names of the input or output of the service flow (see step 5)
- The names of the business objects referenced by the inputs or outputs of the service flow (see
step 5)
- The properties of the business objects referenced by the inputs or outputs of the service flow
(see step 5)
- The namespace in the advanced properties of the business objects referenced by the inputs or
outputs of the service flow (see step
5)
Rationale: From the web service definition, a valid WSDL is generated
that adheres to the respective specifications.
The web service editor opens.
- In the Behavior section:
- Notice the WSDL URI in the Behavior section. You can use this URI to test the exposed web
service.
- Set the scheme used to create the target namespace for the web service in Target
namespace scheme. The target namespace depends on the scheme that you pick, the
namespace setting in the process app or toolkit settings, and the snapshot. See the table below the
scheme options for more information..
- Use process app or toolkit settings (default): Use the namespace from the
XML Settings section of the Process App Settings page
and do not include the snapshot name. This is the recommended setting because the target namespace
remains consistent across multiple snapshots.
Important: If the process application
namespace is not set, the scheme instead uses the host and port of the local machine and, if it
exists, the snapshot name.
- Use snapshot name: Use the snapshot name as well as the namespace from
the XML Settings section of the Process App Settings
page. This means that the target namespace value in the web service client targets a specific
snapshot.
Important: In the following situations, the namespace of the Web Services Description
Language (WSDL) file changes and you must obtain a new file to maintain consistency between the
namespace used by the client and the namespace on the server:
- When the application namespace is not consistent with the namespace on the server.
- When the host name and port changes and the exposed web service uses a business object defined
in the System Data toolkit, which uses a host name and port specification.
- When you create a snapshot and switch a service to the exposed web service in the new
snapshot.
- When you switch from a specific snapshot to the default snapshot or from the default snapshot to
a specific snapshot.
- Custom: Use only the value specified in the Target
namespace field.
The following table shows the resulting target namespace depending on the value you choose
for the scheme, the namespace setting for the process application, and where the web service is running.
| Combination |
Resulting URI |
- Process App namespace set to
http://xyz value
- Use process app or toolkit scheme
|
http://xyz/web_service_name.tws
|
- Process App namespace set to
http://xyz value
- Run on a snapshot that is not tip or default
- Use snapshot scheme
|
http://xyz/snapshot/web_service_name.tws
|
- Process App namespace set to no value
- Run on a tip or default snapshot
- Use process app or toolkit scheme or Use snapshot
scheme
|
http://host:port/teamworks/webservices/
proc_app/web_service_name.tws
|
- Process App namespace set to no value
- Run on a snapshot that is not tip or default
- Use process app or toolkit scheme or Use snapshot
scheme
|
http://host:port/teamworks/webservices/
proc_app/snapshot/web_service_name.tws
|
|
|
http://custom_namespace
|
- Select the SOAP version you want to use.
Note: SOAP header information is available in system variables. The
tw.system.soap.header.request variable is automatically initialized to contain the list of SOAP header entries found in the incoming request message. You can include JavaScript code with your inbound web service which accesses these SOAP header entries. You can also write JavaScript code which adds SOAP header entries to the tw.system.soap.header.response system variable. The SOAP header entries contained
in this variable are added to the outbound response message.
- For each function that you want your web service to support, add an
operation. In the Operation Detail section, name the operation. If the
service flow that provides the functionality is already defined, you can attach it to the
operation.
If this service flow does not yet exist, click
New to create it now
and attach it to the operation. For information about service flows and how to create them, see
Creating a service flow.
- Click Save or Finish
Editing.
This topic is shared by BAW, CP4BA, CP4BASaaS. Last updated on 2025-03-13 12:15