The BIND command binds the specified wizard-generated service code to the loaded inbound XML document or creates a new empty outbound XML document.

The SERVICE keyword value is used in a resource property lookup using the property key service.'value' and service.archive.'value' to locate the binding class and the binding jar file that contains the binding class and supporting classes generated by the JSONBinding Wizard. If the service binding archive entry does not exist, then the binding jar file must exist in the JSM jar subdirectory instead of a user-specified directory.

You will need to specify the type of bind as outbound or inbound - a READ and GET are normally associated with an inbound type, while SET and WRITE are normally associated with an outbound type.

The position of the BIND command in the code depends on whether you are intending to read data from an existing JSON document or you are intending to create a new JSON document.

If you are reading from an existing document, the code flow will be something like this:

    SERVICE_LOAD
READ
BIND TYPE(*INBOUND)
GET (one or more times)
CLOSE
SERVICE_UNLOAD


Whereas, creating an XML document would require the following sequence of commands:

    SERVICE_LOAD
BIND TYPE(*OUTBOUND)
SET (one or more times)
WRITE
CLOSE
SERVICE_UNLOAD

Syntax:

Command

Keyword

Value

Developer notes

BIND

SERVICE

value

Required. Service name.

TYPE

*INBOUND

Required. Inbound binding.

*OUTBOUND

Outbound binding.

BINDTRACE

*YES

Optional. Trace the inbound bind result.

*NO

Default.

SUBSET


Optional. See SUBSET.

FILTER


Optional. See FILTER.

Example

     BIND SERVICE(Order) TYPE(*INBOUND) BINDTRACE(*YES)

  • No labels