Websydian v6.1 online documentationOnline documentation - WebsydianExpress v3.0

XMLServiceProcessor

Scoped name

XMLAbstract.XMLServiceProcessor

Please note that this function is found in the WSYAPIWS model.

Purpose

ServiceProcessors are called when the runtime has identified that a request is a web service request and the ServiceProcessor is specified for the URL of the request.

An XMLServiceProcessor performs the following steps:

  1. Receive the data, save them to a file; load the content as an XML document in the XML-Parser.
  2. Identify and call the ServiceHandler function. The TransacXML object-references specifying the input and output document are transferred to the ServiceHandler.
  3. Save the XML output document to a file and return the data to the client.

The XMLServiceProcessor function can be used when the data of the request and the response are valid XML-documents.

Usage

Inherit from the abstract XMLServiceProcessor if the input and output you want to transfer are valid XML-documents - and you want to handle these documents using the TransacXML library.

Before creating your own implementation of the function you should consider whether you can use the implemented XMLServiceProcessor that is delivered with the standard WebsydianExpress installation.

If your only reason for creating a special version is that you need to use a special selection criterion that is not handled by the implemented XMLServiceProcessor, you should first investigate the "Program" selection criterion. This special criterion makes it possible for you to specify a program that handles the selection of the ServiceHandler based on you own logic.

The most common reason to create a special version of the XMLServiceProcessor function is if you need to pre-process the request data or post-process the response data. Note that if the pre/post processing is related to the SOAP standard, you might be able to use the implemented SoapServiceProcessor function instead of creating your own implementation.

Examples

You can see an example of how pre and post processing of the data can be performed in the function: XMLAbstract.SoapServiceProcessor in the WSYAPIWS model.

Special considerations

Please note that all ServicePorcessors are called dynamically based on the entries specified in the service structure tree. This means that you may not change the interface of the implemented function.

As the function uses the TransacXML patterns, it is placed in the WSYAPIWS model instead of the WSYAPI model.

The function can only be used in the Java, WinC, and WinC/iSeries versions - not in the iSeries version.

More information

Background: Understanding the service structure

Background: Handling web service requests

Background: Service Processors

Background: Selection Criteria

Background: WSYAPIWS model