저는 REST에 익숙하며 한쪽의 sid (이미 다룹니다)와 다른 쪽의 HP의 ALM에서 JIRA로 연결할 웹 응용 프로그램을 개발하려고합니다.PHP CURL을 사용하는 HP ALM REST API 로그인
내가 지금 시도하고있는 것은 ALM에 대한 기본 인증이지만 진행이되지 않는 것입니다.
여기 내 코드입니다 :
$handle=curl_init('http://192.168.1.7:8081');
$headers = array(
'Accept: application/xml',
'Content-Type: application/xml',
'Authorization: Basic YWRtaW46MTIzNA==',
);
$username='admin';
$password='1234';
$url = 'http://192.168.1.7:8081/qcbin/authentication-point/login.jsp';
curl_setopt_array(
$handle,
array(
CURLOPT_URL=>'http://192.168.1.7:8081/qcbin/rest/domains/default/projects/Ticomsoft/defects?login-form-required=y',
//CURLOPT_COOKIEFILE=>$ckfile,
CURLOPT_POST=>true,
//CURLOPT_HTTPGET =>true,
CURLOPT_COOKIEJAR=>$ckfile,
CURLOPT_VERBOSE=>1,
//CURLOPT_POSTFIELDS=>,
//CURLOPT_GETFIELDS=>'j_username=admin&j_password=1234&redirect-url=http://192.168.1.7:8081/myUiResource.jsps',
CURLOPT_SSL_VERIFYHOST=> 0,
CURLOPT_SSL_VERIFYPEER=> 0,
CURLOPT_RETURNTRANSFER=>true,
CURLOPT_FOLLOWLOCATION=>true,
CURLOPT_HEADER=>false,
CURLOPT_HTTPHEADER=> $headers,
CURLOPT_AUTOREFERER=>true
//CURLOPT_COOKIE=>
//CURLOPT_USERPWD=>"admin:yahala"
//CURLOPT_CUSTOMREQUEST=>"POST"
)
);
$result=curl_exec($handle);
$ch_error = curl_error($handle);
$response = curl_getinfo($handle);
print_r($response);
if ($ch_error) {
echo "cURL Error: $ch_error";
} else {
//var_dump(json_decode($result, true));
echo $result;
}
curl_close($handle);
?>
내 시행 착오가 진행으로 많은 쓰레기가 볼 수 있습니다.
저에게 도움이되지 않습니다. 저를 도와주세요. 여기서 ALM은 설명서를 업그레이드했습니다. [** ALM New Documentation **] (http://alm-help.saas.hp.com/en/12.50/api_refs/REST/webframe.htm#signin-out_example.htm) – Batman