405 error code while calling from Jersey REST client

krutik

I am requesting for put operation and after request performed I am redirecting to GET service URL.Here, I am facing the issue of 405 HTTP error code. However, same code works for me in the case of POST operation.

Below code is EndPoint:

@PUT
@Produces({ MediaType.APPLICATION_JSON })
public Response put(InputStream objInputStream) {
    // System.out.println("AckService.put()");

    String strOutput = "";
    Status objStatus = Status.OK;
    URI objRedirectionURI = null;

    try {
            this.submitRequest(objInputStream);
            objRedirectionURI = new URI("https://local.test.com:8443/Reply/fetch");
            System.err.println("\n\nredirecting the put request...... to get operation\n\n");
            return Response.seeOther(objRedirectionURI).build();

    } catch (Exception e) {
        e.printStackTrace();
        objStatus = Status.INTERNAL_SERVER_ERROR;
    }


}

Client:

ClientResponse response = null;   
 try {
    response = objWebResource.accept(MediaType.APPLICATION_JSON)
                    .type(MediaType.APPLICATION_JSON)
                    .put(ClientResponse.class, strInputData);

}catch (Exception e) {
    blnIsOk = false;
if(null != e.getMessage())
    lstExceptionMessage.add(e.getMessage());
e.printStackTrace();

}

Please let me know how I can resolve this.

Gergely A.

In that question I think you can find the answer: PUT-POST Rest Information

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

415 error while calling post API from jersey client

From Dev

REST API | Jersey jar | 405 error

From Dev

error while calling a rest webservice

From Dev

Error while calling External REST URL from netsuite using token

From Dev

How REST endpoints are auto subscribed while calling from Browser/REST Client?

From Dev

Error While Calling Code From other class in Asp.net

From Dev

How to return javascript code to be executed by client in Jersey Rest?

From Dev

REST api is not calling from client to webservice

From Java

REST web service: Error code should be 404 or 405?

From Dev

Getting 405 "Method Not Allowed" error using POST with @FormParam (Java web service with Jersey REST)

From Java

Error while using jersey-client in osgi - No generator was provided

From Dev

Migrating from Jersey client to RestTemplate, but it catch 401 error as HttpClientErrorException but Jersey client was not throwing this error why?

From Dev

ERROR while calling post request from rest api made with Node Js and express .the request data goes empty

From Java

Jersey Client creation Error

From Dev

Jersey Post Request 405 Error for Json Consumption

From Dev

@PUT Jersey Error 405: Method not allowed

From Dev

Jersey REST client post with authorization

From Dev

Running Rest client using Jersey

From Dev

Jersey REST client not creating database

From Dev

authorization error while calling adapter from iphone

From Dev

Error while calling java from PL/SQL

From Dev

Error while calling Fragment class from activity

From Dev

Git clone error “HTTP code 405 from proxy after CONNECT”

From Dev

CORS error while consuming calling REST API with React

From Dev

When should I return HTTP Status Code 500 (Internal Server Error) from REST application to client?

From Dev

CORS issue on localhost while calling REST service from angularjs

From Dev

Error while connecting Ubuntu server from a client

From Dev

Issue calling Rest API using ClientResponse Jersey

From Dev

Error Calling Python Code from VBA in Outlook

Related Related

  1. 1

    415 error while calling post API from jersey client

  2. 2

    REST API | Jersey jar | 405 error

  3. 3

    error while calling a rest webservice

  4. 4

    Error while calling External REST URL from netsuite using token

  5. 5

    How REST endpoints are auto subscribed while calling from Browser/REST Client?

  6. 6

    Error While Calling Code From other class in Asp.net

  7. 7

    How to return javascript code to be executed by client in Jersey Rest?

  8. 8

    REST api is not calling from client to webservice

  9. 9

    REST web service: Error code should be 404 or 405?

  10. 10

    Getting 405 "Method Not Allowed" error using POST with @FormParam (Java web service with Jersey REST)

  11. 11

    Error while using jersey-client in osgi - No generator was provided

  12. 12

    Migrating from Jersey client to RestTemplate, but it catch 401 error as HttpClientErrorException but Jersey client was not throwing this error why?

  13. 13

    ERROR while calling post request from rest api made with Node Js and express .the request data goes empty

  14. 14

    Jersey Client creation Error

  15. 15

    Jersey Post Request 405 Error for Json Consumption

  16. 16

    @PUT Jersey Error 405: Method not allowed

  17. 17

    Jersey REST client post with authorization

  18. 18

    Running Rest client using Jersey

  19. 19

    Jersey REST client not creating database

  20. 20

    authorization error while calling adapter from iphone

  21. 21

    Error while calling java from PL/SQL

  22. 22

    Error while calling Fragment class from activity

  23. 23

    Git clone error “HTTP code 405 from proxy after CONNECT”

  24. 24

    CORS error while consuming calling REST API with React

  25. 25

    When should I return HTTP Status Code 500 (Internal Server Error) from REST application to client?

  26. 26

    CORS issue on localhost while calling REST service from angularjs

  27. 27

    Error while connecting Ubuntu server from a client

  28. 28

    Issue calling Rest API using ClientResponse Jersey

  29. 29

    Error Calling Python Code from VBA in Outlook

HotTag

Archive