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

  • Home
  • SEARCH
  • 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 8247803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:58:32+00:00 2026-06-07T22:58:32+00:00

I have created a jax-rs restful service using cxf and annotated my scala service

  • 0

I have created a jax-rs restful service using cxf and annotated my scala service implementation to expose cors headers:

@Path("/foo/{date}")
@Produces(Array("application/xml"))
@CrossOriginResourceSharing(allowAllOrigins = true)
class Foo {
    @GET
    @Path("{id}")
    def doStuff(@PathParam("date") date: util.Date, @PathParam("id") id: Int) = ...
}

In my Spring applicationContext.xml I have registered a cors filter within the jaxrs:providers list

<bean id="corsFilter" class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"
        p:allowCredentials="true"/>

I can happily use the endpoint directly from Firefox/IE via http://localhost:8080/foo/2012-07-17/123 but I am trying to build a service which will be invoked from another web application in order to decouple the two.

When I make the request directly through Firefox I see the following:

Response Headers
Content-Length                  5699
Content-Type                    application/xml
Date                            Wed, 18 Jul 2012 16:49:09 GMT
Server                          Apache-Coyote/1.1

Request Headers
Accept                          text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding                 gzip, deflate
Accept-Language                 en-us,en;q=0.5
Cache-Control                   max-age=0
Connection                      keep-alive
Cookie                          DWRSESSIONID=Q62Vf$dv*S9sA8EaJm6jKW6$pyj; JSESSIONID=17E120C419F075B505447F151124BC18
Host                            localhost:9580
User-Agent                      Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1

And when I make the request via Ajax from a webpage on my local disk I see the following:

Response Headers
Access-Control-Allow-Cred...    true
Access-Control-Allow-Orig...    *
Content-Length                  6177
Content-Type                    application/xml
Date                            Wed, 18 Jul 2012 16:41:21 GMT
Server                          Apache-Coyote/1.1

Request Headers
Accept                          */*
Accept-Encoding                 gzip, deflate
Accept-Language                 en-us,en;q=0.5
Connection                      keep-alive
Cookie                          DWRSESSIONID=Q62Vf$dv*S9sA8EaJm6jKW6$pyj; JSESSIONID=17E120C419F075B505447F151124BC18
Host                            localhost:8080
Origin                          null
User-Agent                      Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1

I can get this to work fine in IE using prototype.js but there’s a further complication with Firefox, I assume because the webservice is projected by an NTLM servlet filter. I’ve been using jQuery for non-msie browsers in order to pass through credentials using the xhrFields property, and I can see my service being invoked in the debugger from both IE & Firefox, but my response is blank when invoked from Firefox.

Is this even possible?

  • 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-07T22:58:34+00:00Added an answer on June 7, 2026 at 10:58 pm

    It appears that Firefox does not respect the Access-Control-Allow-Origin: * header – changing the @CrossOriginResourceSharing annotation to specify the list of host/port combinations which will access the end point fixed the issue.

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

Sidebar

Related Questions

We have created a web service using JAX-WS and ProSyst OSGi. Accessing the service
In java i have created a JAX- web service, which is up and running,
I have to make a web service using JAX-RPC for a project and I
I have developed a web service using JAX-WS and in the web.xml i had
I have a number of classes exposed as JAX-RS request handlers, using javax.ws.rs.Path annotations.
I have a JAX-RPC web service that I am attempting to consume using Spring.
I have created an android application that calls (using kSOAP library) a SOAP based
I've created a jax-ws service endpoint and now I want to write a client.
I have some resources that I allocate when my web service is created that
I have a cxf JAX-WS client. I added the failover strategy. The question is

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.