cxf

401 error when consuming a Web service with HTTP Basic authentication using CXF

I'm trying to consume a remote Web service that uses HTTP basic authentication, using Apache CXF, within a JUnit test. The error I am getting is: javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://localhost:8080/services/MyService?wsdl. It failed with: Server returned HTTP response code: 401 for URL: http://lo...

Apache CXF REST Services w/ Spring AOP

I'm trying to get Apache CXF JAX-RS services working with Spring AOP. I've created a simple logging class: public class AOPLogger{ public void logBefore(){ System.out.println("Logging Before!"); } } My Spring configuration (beans.xml): <aop:config> <aop:aspect id="aopLogger" ref="test.aop.AOPLogger"> ...

Problem in Apache CXF (Simple Frontend): 'Already connected'

I am using apache CXF for the first time. I am trying to establish a connection based on the CXF simple front end (Configuration notes) technology. I can't really see what I've done wrong, but I am getting a weird error (see below). I have also posted this question to [email protected], but I haven't received a response yet. Perhaps s...

How do you secure Apache CXF RESTful APIs?

Is there an easy way to secure RESTful API exposed via Apache CXF's JAX-RS implementation? Are there any hooks for security via Spring Security?. I heard of people using Basic Authentication over HTTPS, but I haven't seen any actual examples. Any ideas would be greatly appreciated. Thanks! ...

JAXB and XHTML inside XML

Hi, I'm using Apache cxf to create objects from a WSDL. Everything works fine but I have some XHTML inside the SOAP message and i don't know how to access it. The resulting xml is <folder> <id S="ID-KMEHR" SV="1.0" SL="idfolder">1</id> <patient> <id S="ID-PATIENT" SV="1.0" SL=" ">05040199</...

How to handle REST Exceptions?

Hi All, We are in the middle of a ongoing discussion about how to handle REST exceptions. Response Content type : JSON Two solutions we have: 1) Throw all the unchecked exceptions as a JSON response. 2) Send Request Invalid Response code. Arguments: When its a error, why return JSON? Just send a invalid response code. Counter Argu...

Apache CXF -Enunciate wsdl generation Error.

We are using Apache CXF code-first approach to create web-services. We have a custom soap header to pass user credentials. I am trying to pass the usercredentials in the SEI using a @webparam annotation. These are two operations in the Service class. @Path("/item/{id}") @GET public Item getItem(@PathParam("id") String id, @WebParam(n...

web service reliablility with CXF - MQ

How can I achieve reliability of web service in CXF ? It is used in financial domain and involved in payment system, so requirement is that it must be 100% reliable and secure. for security I have added username/password authentication using ws-security (intercepter). Do I need to use any Middleware (ActiveMQ) for transprot so that MQ ...

Apache CXF and Spring MVC

I have set up a CXF web service which works well. My service primarily loads data from an ftp to a db. I would like to create a web interface through which the invoker can view the progress of their package. I thought it would be easy to integrate Spring MVC with CXF but there doesn't seem to be any good solution. I searched all over t...

Cannot resolve the name 'xenc:EncryptionMethodType' to a(n) 'type definition' component.

Hello, I am trying to deploy a war file in JBOSS 5.1 with CXF-JAXB schema validation. I have a XSD which has imports as <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/&gt; <xs:import namespace="http://www.w3.org/2001...

CXF - Webservice method with parameter type as Element

Hi, I am trying to develop SOAP based webservice using CXF. My requirement is to accept any XML data structure as method parameter and then the logic to parse/handle this data would be internally taken care by webservice (A generic webservice for accepting request). Hence I want to declare the method parameter as either org.w3c.dom.Elem...

How can I check the validity of a wsdl because i got IllegalAnnotationsException ?

I have generated a java package with the wsdl2java CXF command. Now i want to deploy the wsdl to the tomcat server but I got these errors in logs when i start the server I use opebEjb. It looks like the wsdl is not valid. How can i check this? Log: Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceCo...

CXF: Cloneable classes from wsdl2java?

Hi, Is it possible to have CXF's wsdl2java emit cloneable classes? Maybe via some option or a plug-in? What I need to do is copy by value a rather complex schema structure from one object tree to another and would rather not get/set each member value by hand or touch the generated classes by hand. /Björn ...

CXF SSL Spring configuration - Empty client certificate chain

Hi everybody, I am trying to build a SSL secured Web Service client using CXF Spring configuration and I wonder how is it possible to tell to CXF to use this client certificate in my keystore. This should exists because if my keystore holds plenty of certificate how does CXF is supposed to do to find the good one? Here is my configurat...

how to depoy a jax-ws service to eclipse or tomcat?

As a web services beginner, I have tried for 2 weeks to get a hello world webservice working with maven, eclipse and tomcat. I gave up trying to get any of the code/wsdl generators to work, and I followed this tutorial http://myarch.com/create-jax-ws-service-in-5-minutes to hand code an example, which is brilliant. This results in 4 cl...

xfire: Intercepting HTTP header information

How to get HTTP header using xfire libraries? I want to intercept the call to check the authentication information. Can anyone help me please? ...

JAXB Exception: Class not known to this context

When I call a particular restful service method, which is built using CXF, I get the following error, anyone know why and how to resolve it? JAXBException occurred : class com.octory.ws.dto.ProfileDto nor any of its super class is known to this context... Following are the service method and relevant DTOs: public class Servi...

How do I secure a CXF web service using WS-Security and an AES 256 encrypted password?

I'm trying to use an AES 256 encrypted password instead of a plain text password. I'm not sure how to configure the server to use an AES encrypted password. When I try to run the client code it gets an exception org.apache.ws.security.WSSecurityException: Unknown password type encoding: http://www.w3.org/2001/04/xmlenc#aes256-cbc If an...

Using CXF's wsdl2java, is there an easier way to generate package names from xml namespaces without version numbers?

I'm using Apache CXF's wsdl2java utility to create some JAXB objects and some web service code. The schema in my WSDL has a lot of namespaces with version numbers on the end. For example: http://example.org/sample/namespace/1.0 When CXF generates my JAXB objects the packages wind up with package names like this: org.example.sample....

EodData wsdl java connection

I am stuck trying to figure out how to initiate a WSDL connection with EodData.com the wsdl address is http://ws.eoddata.com/data.asmx?wsdl I am using CXF to create a client connection: QName qname = new QName("http://ws.eoddata.com/Data", "Data"); Data data = new Data(new URL("http://ws.eoddata.com/data.asmx?wsdl"), qname); Data...