我們的infra團隊在機器中設置ca服務檯並共享細節。我需要通過java程序創建其他事件。在這裏我想通過提供訪問密鑰來使用基本認證。爲此,我嘗試使端點url獲得訪問密鑰,然後創建事件,如下所示。CA服務DESK REST api使用JAVA
http://Host:port/caisd-rest/rest_access http://CAdeskHost:port/caisd-rest/in
String endpoint = "http://host:port/caisd-rest/rest_access";
HttpClient client = new HttpClient();
String encodedCredentials = new String(Base64.encodeBase64(("username" + ":" + "password").getBytes()));
PostMethod post = new PostMethod(endpoint);
post.addRequestHeader("Accept", "application/xml");
post.addRequestHeader("Content-Type", "application/xml; charset=UTF-8");
post.addRequestHeader("Authorization", "Basic " + encodedCredentials);
post.setRequestBody("<rest_access/>");
try {
System.out.println("Execute Basic Authentication request on " + endpoint);
// Execute request
int result = client.executeMethod(post);
但是,當我嘗試執行上面的代碼,得到404錯誤
「所請求的資源(/ caisd休息/ rest_access)不可用「。
任何人都可以幫助我如何找到ca服務檯的REST URL是否它是所有像/caisd-rest
一樣的普通url或者它是不同的。在這裏,我的團隊剛剛安裝了CA服務檯。那麼我們是否需要採取其他措施來提供休息通道?