Defining Service Operation Parameters for a Message Service

As part of developing a message service, you must define an operation parameter for each service operation in your service. If you plan to define an operation parameter as complex, you must import the schema (.xsd file) to your project before you begin this procedure.

Note

If you plan to use the message service in a business process service, it is recommended that you develop the message service using the Complex Type instead of Simple Type datatype property. Using a complex type datatype allows you to select the schema element in the xsd structure. Designing the message service using the xsd schema element allows better control over the exact content of the output message from the message service.

Support for the Simple Type datatype does provide developers a more convenient method to assign operation parameters when developing a message service, however, during runtime a synthetic schema element is generated. You should consider how the message output by the message service is consumed and what requirements the message must meet in determining whether to use Simple Type.

When a message service is developed using Simple Type datatype property for the operation parameter, and the message service is called from a business process, the output message contains the synthetic element tags as generated by the message producer in addition to the element content.

To add a service operation parameter:

  1. Open the message service that you want to edit using the message service editor.

  2. Select the Service Interface tab. The Service Interface page of the editor displays.

  3. On the Service Interface page, expand the Operation Parameters section or open the Properties Panel view.

  4. Click in the diagram to select the service operation to which you want to add a parameter, and select Add.

    A new parameter is added in the Operation Parameters section. The new parameter has a default name and default properties.

    Note

    If the Add button is disabled, you must delete the existing parameter before you can add a new parameter. A message service operation can have only one parameter.

  5. Save the service.

To edit the service operation parameter properties:

  1. Click to highlight the parameter in the Operation Parameters section of the Service Interface page.

    The Properties section of the editor or the Properties Panel view displays the operation parameter properties.

  2. Enter or update the following:

    Parameter Properties

    PropertyDescription

    Name

    Enter a unique and descriptive name for the parameter. It is recommended that the parameter name match the root element of the xsd if you are defining a complex type parameter.

    Description

    Enter a description of the parameter, and identify it as an input.Output parameters and fault parameters are not applicable to a message service.

    Style

    Choose from the following:
    • Input

    • Output

    • Fault

    Datatype

    Choose from the following:

    • Click Simple Type, and select an option from the drop-down list.

    • Click Complex Type, click Browse for Schema, and browse to select the appropriate root element.

      The Complex type field displays the location and name of the xsd and the root element.

      For example: "/myxsdfiles/CustomerNS.xsd#//xsd:schema[@targetNamespace='www.myNS.com']/xsd:element[@name='Customer']", where CustomerNS.xsd is the xsd file name and Customer is the element name.

    Note

    If you cannot locate the schema, verify that it has been imported into the project. You must import the schema (.xsd file) as a file system resource for the project.

    See Importing a Resource for more information.

  3. Save the service.

Next: Editing Service Interface Properties

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com