How Do I Use the Web Services Trigger? (Magic xpi 3.x)
Invoking Magic xpi from a Web services trigger, which enables Magic xpi to function as a Web services provider, involves the following steps:
-
Installation and setup.
-
Build a Magic xpi project.
-
Define a Web services service.
-
Define the service operations.
-
Generate and deploy the service to Systinet.
-
Define a flow that will handle the request and returns a result.
-
Define a Web services trigger for the flow, based on the service that you previously defined.
-
Test the trigger using a Web services consumer.
The trigger is responsible for:
-
Receiving the request from the Web services consumer.
-
Mapping the XSD types to Magic xpi data types.
-
Checking that the issuer of the request is authorized to execute the flow. This is not done when the Authorization system property in the Project Properties is set to None.
-
Generating an XML document that contains the contents of the request. The document is based on values of arguments passed to the method (according to the XML schema generated when defining the trigger).
-
Invoking the flow.
-
Returning the value of the variable that was assigned as the return value to the Web services call.
The flow should:
-
Receive the XML document that is generated by the trigger, and contains the values of the arguments. This is done via the Data Mapper.
-
Update the variable that was assigned as the return value of the trigger.
How Do I Implement a Web Services Trigger?