Task XML adapter (WCF version)

This section describes the WCF version of the IEE Task API. The WCF version provides similar functionality to the ASMX version but enables the web service to be hosted both on the IEE application server and on IIS. Unlike the ASMX version, the WCF version supports only asynchronous task execution. It does not support inline, synchronous task execution.

The WCF version provides one web service, TaskSchedule in TaskScheduleService.svc.

The TaskSchedule web service provides an asynchronous interface to the IEE task system. A call to this service's TaskSchedule operation saves a task in IEE, and the task runs whenever the task system picks it up. The IEE task architecture operates in a hungry consumer mode. When a TaskSchedule call saves a task, it is put into the queue with all the other tasks that have been scheduled through the user interface. The returned task ID enables you to investigate the task's status using the IEE rich client Task Monitor.

Illustration of the Task XML adapter, WCF version.

The service operation takes a request as input. The following illustration shows the schema for the request. The namespace is www.itron.com.mdm.task.2010.03. Use this namespace to specify a template ID, which is the task template in IEE that will be used to run the task. The remainder of the request object consists of name and value pairs that specify the task parameters to be used when the task is executed.

Illustration showing the schema for the schedule task request.

The service operation returns a response message. The following illustration shows the schema for this response message. The response message provides the TaskID for the scheduled task in IEE. You can use the IEE rich client Task Monitor to check the task status and to view any associated log messages.

Illustration showing the schema for the schedule task response.

The following is an example of a typical Task API call to schedule an export of readings data. This call assumes that the task template has been configured in IEE and that most of the task parameters are taken from the task template. The Task API request needs to provide only the required task‑specific parameters for the task instance.

Example of a typical Task API call to schedule an export of readings data.

The following is the XML for the request:

<ns:ScheduleTask>

<ns:request>

<ns1:CorrelationID>1234</ns1:CorrelationID>

<ns1:ErrorProcessingInstructions>

<ns1:ReturnFaultInResponse>true</ns1:ReturnFaultInResponse>

<ns1:ReturnLogMessages>true</ns1:ReturnLogMessages>

<ns1:ReturnLogMessageLevel>Error</ns1:ReturnLogMessageLevel>

</ns1:ErrorProcessingInstructions>

<ns1:Locale>en-us</ns1:Locale>

<ns1:RequestingUserName>xxxxxxx</ns1:RequestingUserName>

<ns:Parameters>

<ns:Parameter>

<ns:Index>0</ns:Index>

<ns:Name>StartDate</ns:Name>

<ns:Value>2009-03-01T08:00:00Z</ns:Value>

</ns:Parameter>

<ns:Parameter>

<ns:Index>0</ns:Index>

<ns:Name>EndDate</ns:Name>

<ns:Value>2009-03-31T08:00:00Z</ns:Value>

</ns:Parameter>

<ns:Parameter>

<ns:Index>0</ns:Index>

<ns:Name>EntityID</ns:Name>

<ns:Value>104E</ns:Value>

</ns:Parameter>

</ns:Parameters>

<ns:Template>TestReadExp22</ns:Template>

</ns:request>

</ns:ScheduleTask>

The following is the SOAP XML response from this call. Note that the TaskID is the task that was scheduled in IEE. You can check the task's status by using the IEE rich client Task Monitor.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

<s:Body>

<ScheduleTaskResponse xmlns="http://www.itron.com/mdm/task/2010/03">

<ScheduleTaskResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

<CorrelationID xmlns="http://www.itron.com/mdm/common/2008/04">1234</CorrelationID>

<LogMessages xmlns="http://www.itron.com/mdm/common/2008/04">

<ServiceLogMessage>

<Category>TaskApiMessages</Category>

<ID>TaskApiMessages.SUCCESSFULLY_SCHEDULED_TASK</ID>

<Message>Successfully created and scheduled TestReadExp22 task. TaskID is 1816.</Message>

<Severity>Information</Severity>

<Source>Itron.EE.Facade.Service</Source>

</ServiceLogMessage>

</LogMessages>

<TaskID>1816</TaskID>

</ScheduleTaskResult>

</ScheduleTaskResponse>

</s:Body>

</s:Envelope>