I use the method of addAttachmentsToIssue in jira soap, but I am confused about the fourth parameters in the addAttachmentsToIssue($token,$issueKey, string[] filename, byte[][] attachments), no matter which data I pass to it, it will return the mistakes. this is my code:
$fPath = $_FILES['upload']["tmp_name"];
$fName = $_FILES['upload']["name"];
$fOpen = fopen($fPath,'rb');
$fByte = fread($fOpen,filesize($fPath));
$result = $client->call('createIssue',array($token, $issueInfo));
$issueKey=$result['key'];
$fileName=array();
$fileName[]=$fName;
$fileBytes=array();
$fileBytes[]=$fByte;
$attach=$client->call('addAttachmentsToIssue',array($token,$issueKey,$fileName,$fileBytes));
var_dump($attach);
exit;
the array returned is :
array
'faultcode' =>
<small>string</small>
'soapenv:Server.userException' (length=28)
'faultstring' =>
<small>string</small>
'org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x0) was found in the element content of the document.' (length=120)
'detail' =>
array
'faultData' =>
array
'columnNumber' =>
<small>int</small>
864
'exception' => null
'lineNumber' =>
<small>int</small>
1
'message' =>
<small>string</small>
'An invalid XML character (Unicode: 0x0) was found in the element content of the document.' (length=89)
'publicId' => null
'systemId' => null
'hostname' =>
<small>string</small>
'jira.nyc' (length=8)