[英]CA service DESK REST api using JAVA
我們的infra團隊在機器中設置了ca服務台並分享了細節。 我需要休息調用從java程序創建事件。 在這里,我想通過提供訪問密鑰來使用基本身份驗證。 為此,我嘗試使端點url獲取訪問密鑰,然后創建事件,如下所示。
http://主機: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 / rest_access)不可用”。
任何人都可以幫助我找到如何找到ca服務台的REST URL,無論它是所有喜歡/caisd-rest
常用URL還是不同。 我的infra團隊剛安裝了CA服務台。 那么我們是否需要采取任何其他步驟來提供休息訪問?
在CA Technologies網站上檢查,它應該是http://<host>:<REST port>/caisd-rest
我遇到了同樣的問題,問題是REST未正確部署,使用此doc重新配置REST服務: REST API重新配置解決了問題。
我接受了以下步驟:
嘗試修復錯誤並使用cmd重新部署REST服務:
pdm_rest_util -undeploy
pdm_rest_util -deploy
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.