admin user is in both the "Users & Groups" and the "Users & Groups (ad hoc)" list for this task. Code is below (admin password obfuscated). The SOAP login works fine and returns a session ID for the admin user. The retrieval of user, case ID and delegation index from the URL querystring works fine and returns the correct values (the URL is a clickable link in a templated email sent to the assigned user, using case variables to set the querystring values in the URL). The task being reassigned is showing as status OPEN in the MySQL database, and the assigned user matches the user ID retrieved from the URL querystring. When this code runs, it returns response 35 with message "The target user destination is invalid". I don't know what that message means - if I did, I might have a better chance of debugging this.
Code: Select all<?php
ini_set("soap.wsdl_cache_enabled", "0");
// SOAP login as admin to get session ID for further SOAP calls
$client = new SoapClient('http://workflowsvr/sysworkflow/en/neoclassic/services/wsdl2');
$pass = 'md5:' . md5('<obfuscated>');
$params = array(array('userid'=>'admin', 'password'=>$pass));
$result = $client->__SoapCall('login', $params);
if ($result->status_code == 0)
$sessionId = $result->message;
else
die("<html><body>Could not log in: " . $result->message . "</body></html>");
// Get case ID, Delegation index, user from URL querystring
if ($_GET['case'])
$case = $_GET['case'];
else
$case = "";
if ($_GET['index'])
$index = $_GET['index'];
else
$index = "";
if ($_GET['currentuser'])
$currentuser = $_GET['currentuser'];
else
$currentuser = "";
// reassign the task from current user to admin user
$params = array(array('sessionId'=>$sessionId,
'caseId'=>$case, 'delIndex'=>$index, 'userIdSource'=>$currentuser,'userIdTarget'=>'000000000000000000000000000000001'));
$result = $client->__SoapCall('reassignCase', $params);
if ($result->status_code != 0)
die("<html><body><pre> Reassign Error: $result->message </pre></body></html>");
else
die("<html><body><pre> Reassigned to admin - please check</pre></body></html>");
>