FAQ Database Discussion Community


TXW.create() different behavior on jdk and android?

android,xml,web-services,cxf
I've created webservice on desktop (jdk, working good) and i'm trying to move it to android (make it running on android device). But i'm having some issues and after debugging for few days i've found different behaviour of the next code: Schema schema = TXW.create(Schema.class,ResultFactory.createSerializer(result)); Passed result object is almost...

How to set timeout to JAX-RS client with CXF

java,web-services,rest,cxf,httpclient
I am working on a Rest Client and I am using CXF with JAX-RS. The problem that I have is that I cannot find any way to override the default timeout values of the client. A simple client: Client client = ClientBuilder.newClient(); WebTarget target = client.target("http://localhost:8080/MyApp"); target = target.path("jsp/Test.jsp"); Response...

BeanCreationException from Spring with annotation “@Context” and “@Loggable”

java,spring,service,cxf,spring-annotations
I have web application using Spring, Apache CXF and Jetty. Spring doesn't like the addition of an annotation called @Loggable to methods in one of my classes. First, the annotation @Loggable links to the class LogAspect, which logs request and response messages: @Aspect @Component public class LogAspect { ... ......

CXF Bundles: Whats the difference?

apache,web-services,maven,cxf,ivy
I'm using maven, but I dont understand the difference between following dependencies: 1.) http://mvnrepository.com/artifact/org.apache.cxf/cxf-bundle/3.0.0-milestone2 2.) http://mvnrepository.com/artifact/org.apache.cxf/cxf-bundle-compatible/3.0.3 Option 2 seems newer, but can I use it? At the moment I use "http://mvnrepository.com/artifact/org.apache.cxf/cxf-bundle/2.7.14", but I want to upgrade to V. 3.x.x I haven't found any informations about the cxf-bundle/3.0.0-milestone2 yet, but perhaps...

CXF: Can I refer in-memory keystore for signing?

cxf,keystore
We use CXF 3 and we use WSS4J Crypto to provide keys to sing SOAP message. I wonder is it is possible to use in-memory KeyStore to store those keys (I know it is possible to use in-memory KeyStore for SSL certificates). I know that it is possible to refer...

Cannot figure out how to add a section of soap header using java cxf

java,web-services,soap,wsdl,cxf
I have been struggling with writing a java cxf client. I am able to successfully communicate with the service using SoapUI but the java client I am trying to write is not working and I believe I have narrowed it down to something missing in the soap envelope and I'm...

picketlink-sts ws-trust mustunderstand header

soap,cxf,jboss7.x,ws-trust,picketlink
Is there a way to configure picketLink-sts to accept soap requests with mustUnderstand headers? I'm using: https://github.com/picketlink2/picketlink-quickstarts/tree/master/ws-trust/picketlink-sts The request I send is: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="urn:picketlink:identity-federation:sts" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/v1.4/cd/ws-trust.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">...

CXF Conflicts Xerces Dependency

java,web-services,maven,java-ee,cxf
I have a problem with my cxf dependencies. There is a really huge project that ı working and there are lots of dependencies. My problem is with xerces dependency. There is no older versions of xerces in my pom files, but i am getting the following exception. Do you have...

CXF SOAP Client outbound message has empty body

java,cxf,soap-client
I had generated a set of classes using WSDL2Java and had built a testing client to try invoke the SOAP Service. The classes are generated, but when I call the web service, i notice that the body of the outbound message is empty. The following is some info on the...

Publishing a NonSpring webservice with CXF (“No services have been found” error)

spring,web-services,cxf
Here’s my non-spring approach to publishing a webservice: I have a servlet that extends org.apache.cxf.transport.servlet.CXFNonSpringServlet and overrides the loadBus(ServletConfig) method (The code snippet of the loadBus method is below). This servlet is configured in the web.xml to receive all requests originating with the URL pattern /services/* @Override public void loadBus(ServletConfig...

SoapFault MustUnderstand headers, CXF WSS4J No crypto property file supplied

cxf,wss4j
My SOAP server is receiving a SOAP message with must understand headers set to 1. In order to understand the header I am using a wss4j interceptor. My sign.properties file is: org.apache.ws.security.crypto.provider=org.apache.wss4j.common.crypto.Merlin org.apache.ws.security.crypto.merlin.truststore.type=jks org.apache.ws.security.crypto.merlin.truststore.password=changeit org.apache.ws.security.crypto.merlin.truststore.file=keystore/truststore.jks My Endpoint xml: <jaxws:inInterceptors> <bean...

Linkage Error with Apache CXF (JAXBAttachmentMarchaller) and JBOSS 5.2

java,maven,jboss,cxf,java.lang.linkageerror
I have a Linkage error where it seems like Jboss (5.2) provides one version of the class org.apache.cxf.jaxb.attachment.JAXBAttachmentMarchaller whereas I somewhere provide another implementation of the class. I have searched for the class and it is the maven project cxf-rt-databinding-jaxb which contains it, so I've excluded that project from my...

How do I resolve this “Could not initialize class org.apache.cxf.common.injection.ResourceInjector” error when autowiring a jaxws:client?

spring,cxf,jax-ws,autowired,jaxws-maven-plugin
I’m using JBoss 7.1.3.Final, Spring 3.2.11.RELEASE, CXF 2.7.15 and Maven 3.0.3. I’m trying to autowire a web services client that is generated through the below JAX-WS plugin code … <plugin> <groupId>org.jvnet.jax-ws-commons</groupId> <artifactId>jaxws-maven-plugin</artifactId> <version>2.3</version> <executions> <execution> <goals> <goal>wsimport</goal> </goals> <configuration> <target>2.1</target>...

How to create the CXFServlet?

java,servlets,cxf
Prior to cxf-3.1.0 one could use new org.apache.cxf.transport.servlet.CXFServlet() to instantiate the servlet, or via web.xml configuration: <servlet> <servlet-name>CXFServlet</servlet-name> <display-name>CXF Servlet</display-name> <servlet-class> org.apache.cxf.transport.servlet.CXFServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> But now when I upgrade to 3.1.0, the class cannot be found anymore. How could the the servlet be created with cxf?...

CXF webservice client ignores ssl configuration http-conf:tlsClientParameters

java,spring,web-services,ssl,cxf
I'm trying to establish a SSL connection between a cxf client and a webservice. For a proof-of-concept I'm running a test with the SpringJunit4TestRunner. In my spring config for the client I'm using the following: <jaxws:client id="wsClient" address="${webservice.endpoint.url}" serviceClass="MyServiceClass"/> <http-conf:conduit name="${webservice.endpoint.url}"> <http-conf:client ConnectionTimeout="${webservice.connectionTimeout}" /> <http-conf:tlsClientParameters> <sec:keyManagers keyPassword="changeit">...

Best way to share data among webservices

java,spring,cxf,jax-ws
In my current scenario I have two webservices, hereby described: <jaxws:endpoint id="backendService" implementor="com.foo.soap.BackendServiceImpl" address="/BackendService" /> <jaxws:endpoint id="frontendService" implementor="com.foo.soap.FrontendServiceImpl" address="/FrontendService" /> Backendservice listens for some background applications to notify progress, while frontendservice allows foreground applications to know if data is ready. So, to put it very simply: public Interface Backendservice{ public...

CXF endpoint definition, and Failed to resolve endpoint:No bean could be found in the registry

cxf,apache-camel
I try to define a CXF endpoint, but the it doesn't work. When I want to address the endpoint then I'v got the "bean not found" exception. CXF definition: @Override public void configure() throws Exception { errorHandler(deadLetterChannel(systemInfo.getQueuName()) .allowRedeliveryWhileStopping(true) .maximumRedeliveries(-1) ); onException(Exception.class).process(routeHandlingBean); CamelContext camelContext = getContext(); CxfEndpoint partnerTestService = new CxfEndpoint();...

How to correctly consume a produced Web Service? (Apache CXF) [closed]

java,web-services,soap,cxf
I have created a SOAP WS and deployed it on a localhost. On the same server, I want to create a Web App which sends XML requests to the web service and consequently manipulates data in the DB. Do I have to regenerate all the necessary java classes (wsimport) to...

Spring @Transactional commiting partial results even exception is thrown

java,spring,hibernate,jpa,cxf
I am running an Apache CXF web service under spring. I use JPA to persist the information. The service has a method that updates a series of rows. Before persisting each row, I check that the values to be persisted really exist in the databes. If there is a value...

error “None of the policy alternatives can be satisfied” with cxf wsdl2java generated webservice

java,web-services,wsdl,cxf
I'm trying to build a web service client based on a wsdl file. This client is used in a java webapp built with Spring and Maven. I have used cxf 2.4.9 as an eclipse plugin to generate the java code from the wsdl file. The web service needs a username...

Sending only needed namespaces in CXF web services messages

java,web-services,cxf
I'm using CXF for web services server. I have a very large number of namespaces on the server. Each time a request is handled instead of putting only the relevant namespace used in the answer all server's namespaces are dumped into soap answer even if most of them aren't required...

CXF Conflicts xmlschema and xmlschema-core Dependency

java,web-services,maven,java-ee,cxf
I have a problem with my cxf dependencies. There is a really huge project that ı working and there are lots of dependencies. My problem is with xmlschema and xmlschema-core dependencies. There is no older versions of dependencies in my pom files, but i am getting the following exception. Do...

error while calling soap ws with basic authentification and ssl

java,ssl,soap,cxf,basic-authentication
I am facing problem when calling two remote methods from different wsdl which are protected by basic authentication and ssl the first call is OK but the second call of the second method which is located on an other wsdl don't work when i call the second method first it...

cxf request scoped bean not working in unit test (soap)

web-services,unit-testing,soap,scope,cxf
CXF soap application, using following versions: springBootVersion = 1.2.3.RELEASE springVersion = '4.1.6.RELEASE' cxfVersion = '3.1.0' junitVersion = '4.12' I have a spring bean with a request scope: @Component @Scope( value=WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.TARGET_CLASS ) public class RequestScopedClass which I fetch dynamically from ApplicationContext in my CXF endpoint implementation: @Component @WebService(endpointInterface...

Change the prefix in CXF with interceptor

soap,cxf,mule,mule-studio
I am trying to change <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> to <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> I am using Mule and CXF. We are exposing a SOAP service and the wsdl is from a legacy system (we imported it and generated the classes). It is necessary to change the prefix from 'soap' to just...

Mule: Migrating to the New HTTP Connector

http,mule,cxf
I've upgraded from Mule 3.5.x to 3.6.x and since the old http transport is deprecated in 3.6.x I wanted to migrate to the new HTTP connector. Here is the original code for calling my webservice: <http:outbound-endpoint ref="OrderEndpoint" doc:name="GetApprovedOrder"> <cxf:jaxws-client serviceClass="com.acme.orders.IOrderServiceBean" port="OrderServiceBean_v2_0Port" operation="getApprovedOrderOp" /> </http:outbound-endpoint> The point I have got to...

How to make changes in marshalled output in Java web service client

java,xml,jaxb,cxf,jax-ws
I am trying to interact with a third party web service, who requires me to send a security token as a part of each request. The token is a node by itself, and I acquire it from the response of an initial call. The web service endpoint is dotNet, and...

Stop Apache CXF logging binary data of MultipartBody attachments

java,logging,cxf,interceptor
I need to stop CXF from logging the binary data of attachments in a MultipartBody object (which is being thrown out by the AbstractLoggingInterceptor in the Outbound Message). When I add my LoggingInInterceptor, I am setting setShowBinaryData to false, but this doesn't seem to stop binary data within a multipart...

Where I can find my WADL? (CXF)

java,web-services,rest,cxf
I have developed a simple RESTful service using Apache CXF coupled in a web application and is working fine. I Can access it on "http://localhost:8080/SpringRestProjectJava/api/books/1234" and I am also getting the proper JSON response. My understanding is that from this link that WADL will be autogenerated. Is it correct? If...

How to log soap requests response time with cxf on the client side?

java,web-services,soap,cxf
I'm using cxf to build a client on a soap webservice. Is there any cxf interceptor feature that could automatically measures and logs the webservice response time? I'm already using org.apache.cxf.interceptor.LoggingInInterceptor and LoggingOutInterceptor for logging the xml content itself....

How do I get the senders Public Key using CXF?

java,soap,cxf
I am trying to figure out if it is possible to get the Public Key of the sending party that invoked a method, as a method parameter. If I have a CXF published SOAP service with asymmetric security, is it somehow possible to tell CXF to make the public key...

org.jboss.as.server.deployment.DeploymentUnitProcessingException: Apache CXF library detected in ws endpoint deployment

eclipse,web-services,cxf,wildfly,ws-security
I am using Eclipse juno and WildFly 8.2 and try to deploy soap web services with ws-security. This is my ref site. https://docs.jboss.org/author/display/JBWS/WS-Security#WS-Security-Authenticationandauthorization Deployment is ok! But the problem seems to be the client of eclipse. I made some jsp codes with eclipse ide <%@ page import="javax.xml.ws.BindingProvider"%> <%@ page import="javax.xml.namespace.QName"%>...

SAML2 assertion with home defined AttributeBean in CXF

xml,cxf,saml,attr
I’ve been working with Apache CXF and WSS4J to implement a SecurityTokenService. Using a “CustomClaimsHandler” implementing "org.apache.cxf.sts.claims.ClaimsHandler" I can create a SAML token containing this kind of attributes : <saml2:Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> <saml2:AttributeValue xsi:type="xs:string">admin</saml2:AttributeValue> </saml2:Attribute> The thing is I am now trying to create an...

Why wsdl2java generated code use CXF dependencies at will?

maven,cxf,jax-ws,wsdl2java
I use Apache CXF 3.0.4 wsdl2java to generate code from this wsdl with following command: ./wsdl2java -client -exsh true -d weather -p weather -verbose url As far as I know wsdl2java generates pure java code using only JAX-WS. Generated code works fine without any additional library/dependency. I've grepped it to...

Limit output payload response in CXF JAX-RS based service

java,spring,rest,cxf,jax-rs
I have multiple jax-rs services built using cxf/spring. I want to control the output payload response size of all services. For simplicity sake, let's say none of api's in any of the services should ever return a JSON response payload more than 500 characters and I want to control this...

How to persist XMLGregorianCalendar with JPA?

hibernate,soap,cxf
This is what I have: @XmlSchemaType(name = "dateTime") @Column(name = "expiry-date", nullable = false) protected XMLGregorianCalendar expiryDate; The following exception is thrown: org.hibernate.MappingException: Could not determine type for: javax.xml.datatype.XMLGregorianCalendar Thank you...

Modify XML of CXF RequestSecurityToken before it gets encrypted

java,web-services,wcf,cxf,ws-security
I'm calling a WCF service from a Java client using Apache CXF. The service is secured using an STS at another address. I've configured the service client to call out for the security token before invoking the main service and it works (it's trying to call the STS), but the...

How to add command line argument to a web application(Spring MVC)

web-applications,wsdl,cxf,command-line-arguments
I'm working on a web project that uses Apache CXF and web services, which i use to hit a request to server and get the response back. The server(Actually the service provider) had given me some username and password. Now, when I run my request as a java application...

Why does Mule flow default-exception-strategy have no effect?

java,web-services,cxf,mule,jax-ws
I'm using Mule standalone 3.1.0 and I have a flow with a default exception strategy. My fooImpl class throws an exception on purpose and its stacktrace gets vomited onto the mule stdout - ExceptionTransformer is not triggered and I get no email. If I remove the default-exception-strategy completely nothing at...

Create webservice on Android device with cxf?

android,web-services,soap,cxf
I was able to create webservice in desktop java using Apache CXF. However i need it to working on Android device. The problem is that java.ws package is absent in Android. I've copied all required jar with java.ws classes into libs folder of android project , but while dexing (building...

Camel Cxf: How can I change the namespace of my incoming message?

java,cxf,apache-camel
I have to change the namespace of the incoming messages to our webservice. The consumer route looks like the following: from("cxf:/myservice?serviceClass=myServiceClass")... I've tried to add somehow an interceptor to this(parameter properties.in, properties.inInterceptors?), but I don't get it how to configure it to my route. We are not configuring our cxf...

Call RPC/encoded Webservice with Apache Camel and CXF Endpoint

web-services,soap,cxf,apache-camel,soap-rpc-encoded
There is a lot of information about Apache Camel + CXF-Endpoint and RPC/encoded legacy webservices. But until now I did not find a solution for the problem. I want to call an RPC/encoded webservice from Apache Camel over the CXF endpoint. CXF does not support RPC/encoded Webservices. So I tried...

How to define model to unmarshall post data without root element name

spring,rest,jaxb,cxf,jax-rs
I have a REST API which gets following in post request body to create that data in back end: { "key": "mykey30", "value": "my long value" } and this is how I defined my model: @XmlRootElement public class Entity { private String key; private String value; } and this is...

Fault: X509Token: An incorrect X.509 Token Type is detected

soap,cxf,soapui,x509,ws-security
I am trying to apply a WS Security Policy on my web services. The requirement is to sign the body and timestamp element (no encryption) with X.509 certificate. I am using SoapUI to sign and send soap messages. I implemented web services using cxf wsdl first approach. I am getting...

How to use CXF STS and X509v3 BinarySecurityToken

java,jboss,cxf,ws-security
I am trying to make CXF STS work with 509v3 token. It works fine, if only a username token is configured, but it fails on X509. I am using CXF inside of JBOSS EAP 6.3.1 Maven Dependencies <dependency> <groupId>org.apache.cxf.services.sts</groupId> <artifactId>cxf-services-sts-core</artifactId> <version>2.7.11.redhat-3</version> </dependency> <dependency> <groupId>org.jboss.ws.cxf</groupId> <artifactId>jbossws-cxf-server</artifactId>...

Ws-security properties are not set when the outprops object is passed to it

java,web-services,soap,cxf
I am trying to use cxf to connect to a server and am able to do it through SOAP ui but am getting errors when trying to connect through a java program I am writing. String WSU_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"; String SOAP_NS = "http://www.w3.org/2003/05/soap-envelope"; String WSS_EXT_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; String uri =...

How can I add a session/login servlet to get a session object for a Spring - Apache CXF backend?

spring,spring-mvc,servlets,cxf,jax-rs
I have a whole lot of REST webservices developed with CXF and managed in a spring application container, and I have been tasked with creating a servlet that will create a session object that will store attributes which will be read within the Jax-RS services. I have tried just adding...

Create Enveloped Signature with CXF and WSS4J

java,soap,cxf,jax-ws,xml-signature
I am currently creating a SOAP-Client in Java with help of Apache CXF. I've generated the Service classes from a given WSDL and configure the client programmatically.(Just to make clear, that I'm not using Spring configuration). The service I'm calling has the requirement that each Request I send, needs to...

CXF Webservice response with XML content

java,xml,web-services,jaxb,cxf
I have an existing CXF Java webservice which returns a deep, complex, nested response type. Parts of the response type exists in the DB stored as plain XML message (the exact same XML what should get returned). Example response type: PartyResponse -> PartyRec -> PartyInfo and PartyInfo structure is stored...

Expose RAML contract instead WADL in CXF

rest,cxf,wadl,cxfrs,raml
I am new in REST world, an in most of CXF examples that I saw there is an configuration to expose WADL in REST services when published. Something like Available RESTful services: Endpoint address: http://localhost:8080/ouat-servicesImpl/api WADL : http://localhost:8080/ouat-servicesImpl/api?_wadl Then, when clicked <application> <grammars/> <resources base="http://localhost:8080/ouat-servicesImpl/api"> <resource path="/topics"> <method name="POST"> <request>...

Enable Police in CXF 3.0 and Spring with Contract-First

spring,web-services,wsdl,cxf,ws-security
I'm trying implement WS-Policy in my services with CXF 3.1.0 and Spring 4.1.6 Most of examples that I found was with CXF 2 and structures like cxf-extension-policy.xml and cxf-extension-ws-security.xml changed in CXF new version. I tried something like: package spring; import java.util.LinkedList; import java.util.List; import javax.xml.ws.Endpoint; import org.apache.cxf.Bus; import org.apache.cxf.feature.AbstractFeature;...

WS-Security Policy node not being generated in Apache CXF with Spring and custom context file

spring,soap,wsdl,cxf,ws-security
I have an SOAP web service generated with Apache CXF and using Spring. The interface was generated from a WSDL without WS-Security Policy. Now I need to include this WS-Security node in the generated WSDL: <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" wsu:Id="wss_saml_or_username_token_service_policy">...