Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8250389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:52:17+00:00 2026-06-07T23:52:17+00:00

How to get a resource URI path/location out of the Response.class? When I invoke

  • 0

How to get a resource URI path/location out of the Response.class? When I invoke my restful service with Apache CXF client API like this:

 Response res = resource.post(object);

I get back the JAX-RS Response type. CXF doesnt an own implementation of Response like Jersey or RestEasy do. So how to get the URI, where I created my object, out of Response.class?

In Jersey I am dealing with a ClientResponse.class. There I can handle this with:

 res.getLocation(); 

RestEasy has a ClientResponse.class as well and I can handle the problem like jersey does.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:52:21+00:00Added an answer on June 7, 2026 at 11:52 pm

    The Jersey ClientResponse gets the Location from the headers:

    /**
     * Get the location.
     *
     * @return the location, otherwise <code>null</code> if not present.
     */
    public URI getLocation() {
        String l = getHeaders().getFirst("Location");
        return (l != null) ? URI.create(l) : null;
    }
    

    The JAX-RS Response provides header information via getMetadata():

    public MultivaluedMap<String, Object> getMetadata() {
        if (headers != null)
            return headers;
    
        headers = new OutBoundHeaders();
    
        for (int i = 0; i < values.length; i++)
            if (values[i] != null)
                headers.putSingle(ResponseBuilderHeaders.getNameFromId(i), values[i]);
    
        Iterator i = nameValuePairs.iterator();
        while (i.hasNext()) {
            headers.add((String)i.next(), i.next());
        }
    
        return headers;
    }
    

    So what I would try is:

    response.getMetadata().getFirst("Location");
    

    (If that doesn’t work print the Metadata content. Maybe the key has another name.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the following error messages when I run the app: Description Resource Path
I cannot figure out a relative path that works for my resource. I've tried
I need to get a resource image file in a java project. What I'm
Is there a way to get the available resource translations of a .net dll?
What is the terminal command, or where is a good resource to get them,
I get: "Resource id #8 Warning: mysql_fetch_array() expects parameter 1 to be resource, string
If i wanted to get message for ViewData from resource file, depending on the
I deployed a resource adapter (XADisk) in jboss 7.1.0.final and now get an exception
I've been following the documentation at the resource below http://silex.sensiolabs.org/doc/providers/form.html But I get the
My list view is parsed from a online resource, but i cant get the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.