cxf

Apache CXF: How to secure JAX-RS web service with basic authentication

I have a Spring application that publishes some RESTful web services using Apache CXF (using jax-rs). I would like to secure access to those services using HTTP basic authentication. The username and password should be in a Spring configuration file. The main application already uses Spring Security and I would prefer not to mess with th...

Java Web Services - Is Axis Necessary?

Is AXIS or CFX necessary for Java web services? Can it be all done via the JSDK (1.6)? ...

WSDL PolicyReference to an external file

I'm getting some errors when I try to deploy a web service generated using CXF's wsdl2java to generate the Java code from a WSDL file. I've managed to trace the error down to a NullPointerException being thrown by Apache Neethi when I tries to normalize a PolicyReference. The policy reference is defined in an external XML file (a lot o...

NTLM authentication using CXF wsdl2java stubs

I have a web service protected by HTTPS with NTLM authentication and I generated a set of java stubs using CXF's wsdl2java tool by temporarily disabling authentication. I am now attempting to use the Java stubs within an applet that connects to the web service with the authentication turned back on. My intention was to edit the Java st...

What is the cause and how to fix 503 errors with this in Apache error_log: "Broken pipe: ajp_ilink_send(): send failed"

I'm having intermittent problems with a servlet running on JBoss, with Apache forwarding it all requests via mod_proxy_ajp.so. Sometimes, for REST requests, I get 503 errors from Apache. When this happens, the Apache error_log has this in it: [Mon Oct 12 09:10:19 2009] [error] (32)Broken pipe: ajp_ilink_send(): send failed [Mon Oct 12 ...

What do I need to do to accept an array parameter in webservice?

Hi I am use JAX-WS to make a web service. As parameters I am taking in two strings and an array of a objects whose type are a class in my project. I have the webservice interface and implementation created and it is similar to this: @WebMethod(operationName = "getStuff") @WebResult(name = "result") Mix getStuff( @WebParam(name =...

Accessing jax-rs (CXF) MessageContext outside service class in Spring (2.5)

Hey All, I'm trying to access the MessageContext (or WebServiceContext) in an aspect to get access to the HTTPServletRequest for logging purposes. I would like to inject the context like I did for spring-ws but I have not found a way to do it. Here is what I used for spring-ws: <beans:bean id="transportContext" class="org.springframewo...

Comparison between Sun Metro and Apache CXF for webservices development?

What are the relative strengths and weaknesses between Sun Metro and Apache CXF for webservice development in Java. Is there another framework that I should be looking at as well? ...

How to configure CXF web services so that Glassfish can monitor them

We deploy web services implemented by using the CXF framework on the Glassfish application server. Glassfish has the possibility to monitor Web Services deployed on the server through it's management console. We would like to be able to use these monitor features of Glassfish towards the web services implemented by using CXF, but when w...

WebServicice with Apache CXF and custom headers.

I created a web service using Apache cfx and spring, and works, but I need that the response include this header <?xml version="1.0" encoding="UTF-8"?> Right now the response is like this. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt; <soap:Body> <ns2:postEncuestaResponse xmlns:ns2="http://web...

Testing SOAP endpoint through junit throws SAXParseException (soapenv:Envelope)

Hi all, I've try to implement integration tests for a working application (spring, hibernate, soap, cxf). I build an SOAP-XML by hand and handle it to my endpoint. Like this: private Source createRequest(String domainName, String email, String userId, String password) { String content = ""; content += "<soapenv:Envelope xmlns:s...

how to check the path in web service

I m using cxf webservices.I have a service path @Path'/summary/abc/{xyz}/name/{login}'. I want to generate some custom error message when someone give wrong url like '/summary/ab/{xyz}/na/{login}/' ...

cxf.jaxrs: IllegalArgumentException when using JAXRSServerFactoryBean

I ran into the following issue when setting up a JAXRS test service in a unit test. This is the code (taken from an AbstractJUnit4SpringContextTests-derived test class): JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); sf.setServiceBeans(applicationContext.getBean("searchXY")); sf.setAddress("http://localhost:9000/"...

How to read the user or identifier supplied in ws-security

I am using latest Apache CXF to create a webservice. I have configured ws-security using org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor. In my passwordCallbackClass I can access the user or identifier by calling getIdentifier() method of org.apache.ws.security.WSPasswordCallback class. I am also using spring for the whole setup. I...

Jetty vs CXF / Which one to choose?

Hi, I am fairly new to the Java world and pretty overwhelmed by the beauty of choice between dozens of libraries doing more or less the same thing, or not. So with Jetty and CXF. I am looking for a web services stack that has built-in support for a wide range of transports and protocols. I was under the impression that CXF is the more...

Advantages of using a Dynamic Client with JAX-WS

What are the advantages of using a dynamic client with JAX-WS services as opposed to just using generated client classes? What are the disadvantages? **For my particular case I am using Apache CXF, I'm not sure what other libraries allow "dynamic" clients. -I thought I didn't need to add this, but... I'm looking for non-obvious(I know....

JaxWSProxyFactoryBean sharing HTTP session

Hi, We are working on one project where in we are using JaxWSProxyFactoryBean provided by CXF framework to invoke webservices. I am using SPRING configuration to create clients rather than using API directly in code. I am also setting maintain_session property to make sure session is maintained by WS clients. <jaxws:client id="userAut...

how to mime type of the url

Hi , I am using cxf as a webservice.It supports xml and json format output of the requested data.I want to know that if some exception has occured in my code then i want to return him back the error code either in xml or json format.But i dont know when to give json and xml ,it depends on the requested url that user has asked. example ...

How to start cxf service on localhost but return external address in wsdl?

I'm using cxf and jetty behind apache to expose a webservice via soap. The goal is to start jetty on http://localhost:9000 in all cases and have apache proxy to it, but have the autogenerated wsdl show a soap:address appropriate to the environment it's running in (eg http://api.testing.example.com, http://api.uat.example.com, https://ap...

grails webservices returning an object List

I'm trying to expose a webservice via grails & cxf grails plugin. this is the skeleton of the webservice: class IssueService { static expose=['cxf'] def List issueList(){ def list = Issue.list() return list } def Issue singleIssue(id){ def currentIssue = Issue.findById(id) return currentIssue ...