Web Service Example - Creating a Web Service Request Workflow(4.3)
In this example, the Web Service Request workflow consists of the following agents:
TCP_IP: Collects the input data.
Analysis_1: Creates the UDR type WSCycle_charge and routes it to the Web Service Requester.
Web Service Requester (Processing): Sends a request to a Web Service server. Once the web server replies, the Web Service Requester forwards the reply to Analysis_2.
Analysis_2: Receives the Web Service reply. In this example we use this agent for output demonstration.
The Web Service Request workflow
Configuring the Agents
In the Workflow Editor, open the configuration views of both agents.
In the TCP_IP agent configuration view, set Port to 3210.
In the Analysis_1 agent configuration view, enter the following APL code into the text pane:
import ultra.ws.example.charge.cycles; import ultra.ws.example.charge.x1; consume { // Create a WSCycle_charge UDR WSCycle_charge udr = udrCreate(WSCycle_charge); // Creaete a Charger UDR as parameter udr.param = udrCreate(Charge); // Populate the parameter with data udr.param.chargingEvent = udrCreate(ChargingEvent); udr.param.chargingEvent.amount = 0.50; udr.param.chargingEvent.id = "0123456789"; udr.param.serviceType = "SMS"; // Route the UDR udrRoute(udr); }To enter the UDR type, click the Set To Input button in the Analysis agent.
The type bytearray appears in the UDR types list.
In the Web Service Request agent Configuration tab, click the Browse... button and enter the WS profile.
To automatically set the HTTP address, click the Extract Profile Settings button.
In the Analysis_2 Configuration view, enter the following APL code into the text pane:
consume { debug(input); }Click on the Set To Input button in the Analysis agent.
The type bytearray appears in the UDR types list.