|
<?
try
{// Jira WSDL
$wsdl = "http://localhost:8080/rpc/soap/jirasoapservice-v2?wsdl";
// Login info
$login = "admin";
$password = "111111";
// Create the soap Client
$client = new soapclient($wsdl);
// Login to Jira
$login = $client->login( $login,$password);
$issue = array(
"project" => "JIRASOAP",
"type" =>3 ,
"summary" => "Test: Issue created via PHP/SOAP",
"assignee"=>"admin",
"description"=>"samples Test!",
"reporter"=>"admin"
// "customFieldValues" => $remoteIssue
);
// Create the Issue
//$remoteIssue = $client->createIssue( $login,$issue);
//echo $remoteIssue;
//$content = base64_encode(file_get_contents($attachment_file));
//$attachment_file = basename($attachment_file);
//JIRAInterface::getClient()->addAttachmentsToIssue(JIRAInterface::getLogin(), $ticket_id, $attachment_file, $content);
//$content = base64_encode(file_get_contents('D:\\apache\\php\\jira\\1.txt'));
$content = base64_encode("adb");
$attachment_file = basename('1.txt');
$client->addAttachmentsToIssue($login,'JIRASOAP-16', '1.txt', base64_encode('abddd'));
//echo $client->addAttachmentsToIssue($client->login( $login,$password), 'JIRASOAP-16', $attachment_file, $content);
//echo JIRAInterface::getClient()->addAttachmentsToIssue(JIRAInterface::getLogin($login,$password), 'JIRASOAP-16', $attachment_file, $content);
//$client->addAttachmentsToIssue($token,'JIRASOAP-10', array('attach1'), array(base64_encode($fileData)));
// Log out
$logout = $client->logout($login);
if($logout == TRUE){
echo 'Logged out';
}else{
echo '<br>Failed to logout';
}
}catch(Exception $e){
echo 'Error Caught';
echo '<br>'.$e;
}
echo "hello world!";
?> |
|
|