CA DESK REST api service using JAVA

Our infrared team set up a ca service center in the car and share the details. I need to make a call to create an incident from a java program. And here I want to use basic authentication by providing an access key. To do this, I tried to make the endpoint URL to get the access key, and then create the incident, as shown below.

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);

But when I try to execute the above code, getting 404 error

"The requested resource (/ caisd-rest / rest_access) is unavailable."

- URL- REST , URL- , /caisd-rest, . CA. , - ?

+4
2

CA - http://<host>:<REST port>/caisd-rest

0

, , REST , REST Service : REST API .

:

  • NX_ROOT/bopcfg/www/CATALINA_BASE_REST/webapps/caisd-rest. , , REST .
  • NX_ROOT/log/jrest.log.
  • REST cmd:

    pdm_rest_util -undeploy
    pdm_rest_util -deploy

-1

Source: https://habr.com/ru/post/1654529/


All Articles