Menu
  • HOME
  • TAGS

Where I can find my WADL? (CXF)

java,web-services,rest,cxf

Finally, after keep on trying I am able to make it work. I think its due to the CXFNonSpringJaxrsServlet. I made below changes and I was able to access the autogenerated WADL. Changes to web.xml <servlet> <servlet-name>simplerest</servlet-name> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>simplerest</servlet-name> <url-pattern>/services/*</url-pattern>...

CXF Interceptor phase for cleaning up MDC

java,web-services,cxf,slf4j,logback

I've gone with POST_MARSHALL. This way the MDC is still in context when the outputs go through marshall phase and it still works as an outFaultInterceptor, too.

Linkage Error with Apache CXF (JAXBAttachmentMarchaller) and JBOSS 5.2

java,maven,jboss,cxf,java.lang.linkageerror

How can do I find the dependency that is responsible for packaging JAXBAttachmentMarchaller into the project? Search on the web of a maven project which bundles the file. For me it was cxf-rt-frontend-jaxws. What you need to do is to remove this dependency from the assembly, it must not...

Enable Police in CXF 3.0 and Spring with Contract-First

spring,web-services,wsdl,cxf,ws-security

After a while, I discover that WSS4J uses the idea of interceptor instead of policies in contract. I changed my spring implementation to EndpointImpl endpoint = new EndpointImpl(this.cxfBus, flightService); endpoint.setAddress("/FlightService"); endpoint.setWsdlLocation("src/main/resources/wsdls/flightservice_v1r1.wsdl"); endpoint.getProperties().put("ws-security.callback-handler", new ServerPasswordCallback()); endpoint.publish(); However, even with that configuration when I deployed my contract it showed 2 wsdl:binding and...

Call RPC/encoded Webservice with Apache Camel and CXF Endpoint

web-services,soap,cxf,apache-camel,soap-rpc-encoded

As you say Apache CXF does not support the old RPC style. You would need to use an older WS library such as Apache Axis 1.x. There is no Camel component for that, but as its all just java code, you can write some java code that uses Axis 1.x,...

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

java,spring,service,cxf,spring-annotations

I have now received help on how to resolve this issue. In short, the @Context annotation had to be moved into the method of the interface that the class implemented. The solution is as follows: Removed the private member HttpServletRequest request and its @Context annotation. Add the HttpServletRequest as parameter...

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

spring,web-services,cxf

i also faced the same situation. can you change your loadBus method as follows. it worked for me. @Override public void loadBus(ServletConfig servletConfig){ super.loadBus(servletConfig); ServerFactoryBean factory = new ServerFactoryBean(); factory.setBus(bus); factory.setServiceClass(myWebService.class); factory.setAddress("/myService"); factory.create(); } ...

How to set timeout to JAX-RS client with CXF

java,web-services,rest,cxf,httpclient

You can try something like this: HTTPConduit http = (HTTPConduit) client.getConduit(); HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); httpClientPolicy.setConnectionTimeout(30000); http.setClient(httpClientPolicy); see http://cxf.apache.org/javadoc/latest/org/apache/cxf/transports/http/configuration/HTTPClientPolicy.html...

JBoss EAP 6.3 + cxf 2.7.11 jax-rs causes

java,web-services,jboss,cxf,jax-rs

you mentioned that it works with cxf 2.6.x but not with 2.7.x. So I think you should follow the migration guide http://cxf.apache.org/docs/27-migration-guide.html: JAX-RS endpoints in OSGI If you have compiled the application bundles against JSR-311 (JAX-RS 1.1) API and would like to get them running with CXF 2.7.x without recompiling...

Sending only needed namespaces in CXF web services messages

java,web-services,cxf

Since CXF is using JAXB for XML serialization and by the information in the above link it seems there isn't an easy way to do such a thing without writing a costly interceptor which will need to read the entire document and remove the redundant namespaces.

Modify XML of CXF RequestSecurityToken before it gets encrypted

java,web-services,wcf,cxf,ws-security

So I ended up getting some help from the cxf users mailing list. The response was as follows: What I would suggest you do here is to subclass the STSClient in CXF: https://git-wip-us.apache.org/repos/asf?p=cxf.git;a=blob;f=rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java;h=afdaaeaa092460c5cbccd3f9723660ded9f12e2b;hb=HEAD In particular, you want to override the "issue" method here:...

Add credentials on outgoing soap messages in CXF?

java,web-services,soap,cxf

You can use a CXF Interceptor for that, as long as it executes before the object is marshalled in the MARSHAL phase. You should be able to choose any phase before that one. See the complete list in the CXF Interceptors documentation. In the Interceptor, you can find your outgoing...

Migration from Jboss 5 to Jboss 6 causes SOAP request error

java,web-services,soap,jboss,cxf

Basically I have fixed this error by regenerating classes by using cxf tool. Jboss 6 is using cxf libs, but Jboss 5 was working with "axis".

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

android,xml,web-services,cxf

The reason was in TXW.java: Package pkg = c.getPackage(); XmlNamespace xn = pkg.getAnnotation(XmlNamespace.class); if(xn!=null) // always null in android as it does not support package annotations nsUri = xn.value(); So i had to hack it - create public static variable and set it before: public static java.lang.String XmlNamespaceAnnotationValue = null;...

Testing CXF Client with Spring WS Test

java,web-services,cxf,spring-ws

No. The spring-ws-test module is specific to Spring-WS and cannot be used with other frameworks. You can use SoapUI for that, for instance.

Empty Soap Body returned from Camel Processor in Payload Mode

java,web-services,cxf,apache-camel,servicemix

I solved this problem, Actuallly there is a problem in my schema. I have given name to my complex type and refered element type with that name which incorrect. You should do this like below <xsd:element name="myRequest"> <xsd:complexType> <xsd:sequence> <xsd:element name="cardNumber" type="xsd:long" /> <xsd:element name="transactionNumber" type="xsd:long" /> </xsd:sequence> </xsd:complexType> </xsd:element>...

@BeanParam does not work with Apache CXF 3.0.x

apache,rest,java-ee,cxf,jax-rs

I found the problem. It was due to presence of another cxf version jar present on classpath (version 2.3.3) coming from other projects dependencies. Somehow that was getting the precedence over 3.x version and that didn't had support for BeanParam. Removing that jar from classpath worked for me....

WS-Discovery with Apache CXF. How to specify device type?

web-services,cxf,onvif,ws-discovery

After looking into CXF source code (WSDiscoveryServiceImpl class) i've found the answer: public ProbeMatchesType handleProbe(ProbeType pt) { List<HelloType> consider = new LinkedList<HelloType>(registered); //step one, consider the "types" //ALL types in the probe must be in the registered type if (pt.getTypes() != null && !pt.getTypes().isEmpty()) { ListIterator<HelloType> cit = consider.listIterator(); while...

com.sun.tools.xjc.Plugin: Provider not a subtype

maven,gradle,jaxb,cxf

I have tried java -cp jaxb-api-2.2.7.jar;jaxb-core-2.2.7.jar;jaxb-xjc-2.2.7.jar;commons-logging-1.1.1.jar;commons-lang-2.2.jar;jaxb2-basics-tools-0.6.5.jar;jaxb-xew-plugin-1.3.jar com.sun.tools.xjc.XJCFacade -verbose -extension -d src xsd and indeed that fails with Exception in thread "main" java.util.ServiceConfigurationError: com.sun.tools.xjc.Plugin: Provider com.sun.tools.xjc.addon.xew.XmlElementWrapperPlugin not a subtype, so the problem is clearly reproducible. I have debugged java.util.ServiceLoader and it turned out that plugins...

CXF/Jetty equivalent of the following Jersey/Jetty code

java,jersey,jetty,cxf,jax-rs

From CXF version 3.0.4 onwards, there are additional constructors on the CXFNonSpringJaxrsServlet that make this a lot easier: public SNAPSHOTApp(int port) throws Exception { resource = new TheResource(); Set<Object> resourceSingletons = new HashSet<>(); resourceSingletons.add(resource); CXFNonSpringJaxrsServlet context = new CXFNonSpringJaxrsServlet(resourceSingletons); ServletHolder servlet = new ServletHolder(context); ServletContextHandler handler = new ServletContextHandler(); handler.addServlet(servlet,...

wsdl2java error: “Fail to create wsdl definition” while generating java code

java,web-services,wsdl,cxf

My guess is that this has to do with the following import in ws-discovery.xsd: <xs:import namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing" schemaLocation="http://schemas.xmlsoap.org/ws/2004/08/addressing"/> To my surprise, the link http://schemas.xmlsoap.org/ws/2004/08/addressing works but it redirects (HTTP 301) to http://schemas.xmlsoap.org/ws/2004/08/addressing/ first (mind the trailing /). I think wsdl2java does not follow the redirect. You could monitor/sniff network connections to...

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

cxf,apache-camel

The solution is the usage of CxfEndpoint class. I wrote a function what gives back a needed object (instead of string endpoint), and so it is work. The route definition: ValueBuilder dynRouterMethod = method(esbDynRouter, "endpointRoute"); from(queueName).id(systemInfo.getRouteId()).routeId(systemInfo.getRouteId()).autoStartup(false) .transacted() .log(LoggingLevel.INFO, systemInfo.getRouteId() + " route usage.") .beanRef("statusUpdaterBean", "updateSendingStatus") .dynamicRouter(dynRouterMethod) .beanRef("statusUpdaterBean",...

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

java,cxf,apache-camel

I've found a solution: It is possible to say something like from(endpoint), so I've created an instance of CxfEndpoint and there I can set the cxfEndpointConfigurer. In this configurer I can add an interceptor which removes the namespace(see transformation feature of cxf). Maybe it also works somehow with the from(uri)...

Json Mapping Exception can not deserialize instance out of START_ARRAY token

java,json,jackson,cxf,jax-rs

You have declared parameters as a single object, but you are returning it as an array of multiple objects in your JSON document. Your model currently defines the parameters node as a ParametersType object: @JsonProperty( "parameters" ) @XmlElement( required = true ) protected ParametersType parameters; This means your model object...

How to install tomcat maven plugin?

java,maven,tomcat,cxf,maven-archetype

Ok, I get it, the comment in the CXF archetype is wrong : <!-- mvn clean install tomcat:run-war to deploy Look for "Running war on http://xxx" and "Setting the server's publish address to be /yyy" in console output; WSDL browser address will be concatenation of the two: http://xxx/yyy?wsdl --> It...

restful service with spring and jaxrs org.apache.cxf.service.factory.ServiceConstructionException

java,rest,maven,cxf

I found a sollution: <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> </dependency> ...

Apache Camel CXF endpoint null reply

java,web-services,apache-camel,cxf

You are requesting the body of the CXF endpoint. If you look at your route, you can see that you set the content of the body in the transform tag, which comes after in the route definition. Therefore, it is logical that you don't get OK as a result of...

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

java,web-services,soap,cxf

CXF has some awesome out of the box features that can help monitor the response times. For this the JMX will need to be enabled. Refer: http://cxf.apache.org/docs/jmx-management.html The management api is part of the cxf-rt-management.jar.The features can be enabled against the target endpoint that needs to be monitored using: org.apache.cxf.management.interceptor.ResponseTimeFeature...

How to use CXF STS and X509v3 BinarySecurityToken

java,jboss,cxf,ws-security

CXF doesn't support the concept of an X.509 SupportingToken with no security binding. As you are using Asymmetric Signature, you should use an AsymmetricBinding security policy instead, with a SignedParts policy to cover the message parts that should be signed.

Create a client with Apache cxf, soapUI(or Eclipse) and Fiddler

eclipse,cxf,soapui,fiddler,wsdl2java

It may not a direct answer to your question. Let me try to explain what I do when I am in a situation like this. Instead using proxies and redirections, I simply download all the Wsdl and xsd files to the same directory. After that I update all the import...

How do I get the senders Public Key using CXF?

java,soap,cxf

The SSL protocol itself should be enough to do that. If you publish your web services using HTTPS then you can configure the server to ask the client for it's certificate ( which will include it's public key ). For that you can check the following CXF configuration file ....

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

java,web-services,soap,cxf

You can use URL, QName, and Service. Let's say you have a service endpoint interface as follows : @WebService @SOAPBinding(style = Style.RPC) public interface HelloWorld{ @WebMethod String getString(String name); } And a service endpoint implementation as follows : @WebService(endpointInterface = "com.bot.ws.HelloWorld") public class HelloWorldImpl implements HelloWorld { @Override public String...

Encrypting passwords in Crypto property files

java,encryption,cxf

This test should help you: https://svn.apache.org/repos/asf/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordEncryptorTest.java You can get the encrypted password by instantiating the JasyptPasswordEncryptor with the master password, as in the test, and encrypt the keystore password. Then copy this into your crypto properties are per: https://svn.apache.org/repos/asf/webservices/wss4j/trunk/ws-security-dom/src/test/resources/crypto_enc.properties Colm....

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 tried just adding a simple JEE servlet to collect the parameters and create the session object, but then I couldn't figure out how to inject that session object for use throughout the application. You could inject the current request object to your rest service and retrieve the...

Manage Exception with Rest CXF

java,spring,web-services,rest,cxf

I suggest you to use below examples. Server side javax.ws.rs.ext.ExceptionMapper public class RuntimeExceptionRestMapper implements ExceptionMapper<RuntimeException> { public Response toResponse(RuntimeException exception) { return Response.status(Response.Status.INTERNAL_SERVER_ERROR) //handle your response .type(MediaType.APPLICATION_JSON_TYPE) .entity(exception.getMessage()) .build(); } } server configuration XML <jaxrs:server id="" address=""> <jaxrs:serviceBeans> .... </jaxrs:serviceBeans>...

CXF Bundles: Whats the difference?

apache,web-services,maven,cxf,ivy

The big monolithic bundle was removed in 3.0. Use the individual bundles that you need for your application.

Should LoggingInterceptors be static in CXF?

java,web-services,soap,cxf

Even if a client proxy is shared among threads (subject to these restrictions), you should be OK using a single instance of logging interceptor provided it's implementation is also thread-safe.

CXF and Spring configured but CXF reports 'no services found'

spring,cxf,spring-java-config

The proper configuration is here @Configuration @Order(3) @ImportResource({ "classpath:META-INF/cxf/cxf.xml" }) public class CXFConfiguration { @Autowired Bus cxfBus; @Bean public Endpoint lotServiceEndpointWS() { EndpointImpl endpoint = new EndpointImpl(this.cxfBus, new LotServiceEndpoint()); endpoint.setAddress("/LotService"); endpoint.publish(); return endpoint; } ...

error while calling soap ws with basic authentification and ssl

java,ssl,soap,cxf,basic-authentication

Hi my problem was solved by setting credential using an other methods i was using the Authentication class from java.net this method is OK when you are using one endpoint with one credential but if you have multiple endpoint with multiple credential it don't work when you try to call...

Adding multiple alias in crypto.properties in WS security

java,security,cryptography,cxf,wss4j

I don't understand why you want to specify more than one alias in the crypto.properties file. To be more clear, this alias refers to the private key used to encrypt messages sent by the application (or decrypt them), not the certificates/public keys trusted by the application, and it's normal to...

Deployment error in CXF 3.0.3 in generated top down Java service from WSDL

java,eclipse,soap,tomcat7,cxf

in WebContent/WEB-INF/cxf-beans.xml, remove import <import resource="classpath:META-INF/ cxf/ cxf-extension-soap.xml" /> ...

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

eclipse,web-services,cxf,wildfly,ws-security

I had the same issue while working with the CXF with wildfly8.2 and wildfly8.1. Basically the wildfly server has its own CXF jars , which are by default loaded when you start the server. If you use the maven project then add the below dependancy with scope "provided" <dependency> <groupId>org.apache.cxf</groupId>...

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

spring,rest,jaxb,cxf,jax-rs

You just need to configure the JSONProvider. The property for marshalling (to unwrap) is setDropRootElement(boolean) The property for unmarshalling (allowing unwrapped) is setSupportUnwrapped(boolean) With xml config, you might have something like <jaxrs:server [...] > [...] <jaxrs:providers> <bean class="org.apache.cxf.jaxrs.provider.json.JSONProvider"> <property name="dropRootElement" value="true"/> <property name="supportUnwrapped" value="true"/> </bean> </jaxrs:providers> </jaxrs:server>...

Change the prefix in CXF with interceptor

soap,cxf,mule,mule-studio

After some testing around, it worked. It might seem very stupid and my jaw dopped a couple of times, I restarted, cleared all cash, re-built and it seems like the interceptor works WHEN I add an extra line, which is unbelievable, I know: package se.comaround.interceptors; import java.util.HashMap; import java.util.Map; import...

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

java,web-services,cxf,mule,jax-ws

There was problems with CXF components invoking exception strategies prior to Mule 3.1.3: http://mule.1045714.n5.nabble.com/mule-scm-mule-22344-branches-mule-3-1-x-modules-cxf-src-test-resources-EE-2273-td4557349.html EE-2273 - http://www.mulesoft.org/documentation/display/current/Mule+ESB+3.1.3+Release+Notes...

Spring and Camel CXF playing nicely inside a WAR

java,spring,java-ee,cxf,apache-camel

I solved it using camel-example-cxf-tomcat as a basis.

CXF Conflicts Xerces Dependency

java,web-services,maven,java-ee,cxf

The cause of this error is existance of older version of Xerces dependencies. It maybe added explicit or it may come from another dependecy. It is easy to solve first case, older version should be changed a never version. (There is no error in the version of 2.11.0) Dependency conflict...

EclipseLink MOXy: Intermittent NullPointerException / MarshalException with concurrent calls

spring,hibernate,java-ee,cxf,moxy

According to the bug report at https://bugs.eclipse.org/bugs/show_bug.cgi?id=404951, a fix for this issue was checked in to the 2.5.x branch. I checked the stable MOXy releases, and sure enough, version 2.5.2 was released a few months ago. I switched my project from 2.5.1 to 2.5.2 and I no longer experience this...

CXF SOAP JAX-WS WSS4JInInterceptor change namespace and cause Unmarshalling error

soap,cxf,unmarshalling,saaj

Update to CXF 3.0.3 and see if it still fails. I think there were some issues around this that were recently fixed. If it still fails, please log a bug with a testcase.

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

cxf,keystore

It is possible, but not with the default "Merlin" Crypto implementation that WSS4J ships with, as this is based on a file-based Keystore. You will need to implement the Crypto interface (or extend one of the abstract classes that are in WSS4J) to support this yourself. Colm....

Why wsdl2java generated code use CXF dependencies at will?

maven,cxf,jax-ws,wsdl2java

application seems to use different implementation of JAX-WS( is it even possible?). Yes. CXF have it's own jax-ws provider and it's jar contains a service file declaring it. (when the JVM needs a jax-ws provider: it looks on the classpath to see if there is a non-default provider declared......

Mule: Migrating to the New HTTP Connector

http,mule,cxf

The solution is: wrap your element into a processor-chain As follows: <processor-chain> <cxf:jaxws-client serviceClass="com.acme.orders.v2_0.IOrderServiceBean" port="OrderServiceBean_v2_0Port" operation="getApprovedOrderOp" /> <http:request config-ref="http.request.config" path="acme-services/OrderServiceBean_v2_0" method="POST" /> </processor-chain> This is because cxf is intercepting, so after the processor chain you would have the same object as you had in your previous solution....

Stop Apache CXF logging binary data of MultipartBody attachments

java,logging,cxf,interceptor

showBinaryContent by default is false, however binary data gets logged based on content type, Currently if your content type is not any of the following; the binary data would be logged. static { BINARY_CONTENT_MEDIA_TYPES = new ArrayList<String>(); BINARY_CONTENT_MEDIA_TYPES.add("application/octet-stream"); BINARY_CONTENT_MEDIA_TYPES.add("image/png"); BINARY_CONTENT_MEDIA_TYPES.add("image/jpeg"); BINARY_CONTENT_MEDIA_TYPES.add("image/gif"); } Say your content type is application/zip, you can...

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

java,xml,jaxb,cxf,jax-ws

So in principle you cannot control order of attributes in a standard way, but .... Depending on jaxb /java version the order can be determined by alphabetical order of the names, the order of declaration. You could try in your code if a) moving the fields around changes anything, b)...

picketlink-sts ws-trust mustunderstand header

soap,cxf,jboss7.x,ws-trust,picketlink

I found the answer, I post it here, it could help someone. You need to define a new SOAPHandler and link it to your webService endpoint. This is done by annotating the endpoint with: @HandlerChain(file = "soap-handler.xml") For example: package org.picketlink.identity.federation.app.sts; /** * imports... */ @WebServiceProvider(serviceName = "PicketLinkSTS", portName =...

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

web-services,unit-testing,soap,scope,cxf

Meanwhile I found the solution: ... import org.springframework.context.ConfigurableApplicationContext; @Autowired private ConfigurableApplicationContext myCtxt; @Before public void setUp() throws Throwable { myCtxt.getBeanFactory().registerScope( "session", new CustomScope4Test() ); myCtxt.getBeanFactory().registerScope( "request", new CustomScope4Test() ); } public class CustomScope4Test implements Scope { private final Map<String, Object> beanMap = new HashMap<String, Object>(); /** * @see...

Set Timeout on CXF Proxy Client

cxf,jax-ws

HTTPClientPolicy clientConfig = WebClient.getConfig(service).getHttpConduit().getClient(); clientConfig.setReceiveTimeout(10000); ...

CXF JaxWs Endpoint fail with 'The given SOAPAction does not match an operation' when the action contains accents

soap,cxf,action,accented-strings

Please refer to this discussion in CXF Users Mainling List. As mentioned by Aki, HTTP Specs requires that HTTP Headers use only US-ASCII characters (see rfc2822). And as mentioned by Daniel and Aki, the spec rfc2047 should be used in case there is a need to use a none US-ASCII...

RuntimeCamelException due to org.apache.cxf.feature.Feature not present

spring,web-services,cxf,apache-camel,x509

I could fix it using CXF Version of 2.7.10. Not sure of exact incompatibility issues but using mvn dependency:tree on project revealed Camel was using CXF version of 2.7.10 even though I was using 2.4.0. So I updated it to 2.7.10 and I suppose some incompatibility is fixed...

CXF Conflicts xmlschema and xmlschema-core Dependency

java,web-services,maven,java-ee,cxf

If you get java.lang.NoSuchFieldError: QUALIFIED error. It is also comes from dependency confilict, but the weirdest thing is there is no dependency in the dependency hierarchy. The root cause of above exception is missing versions in some dependencies. I need cxf-rt-core 2.5.2 which has internal dependecy of xmlschema-core. Following code...

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

spring,soap,wsdl,cxf,ws-security

I figure it out. I had to make some modifications. First, move SecurityPolicy.xml to the resources directory, then modify the @Policy annotation to get the policy file from the classpath: @Policies({ @Policy(uri = "classpath:SecurityPolicy.xml", placement = Policy.Placement.BINDING) } ) ...

NoClassDefFoundError org/apache/cxf/jaxrs/client/WebClient

web-services,rest,cxf

WebClient is part of cxf-rt-frontend-jaxrs.jar. You do not have cxf JAXRS related jars I guess.

Best way to share data among webservices

java,spring,cxf,jax-ws

You could have an underlying database which contains your reqID and its current status. Using a singleton would most likely mean that you will be storing stuff in memory, which might not make your application scale very much. You will also loose everything once the application shuts down and/or have...

Configuration problm: Failed to import bean definitions from URL location

java,spring,web-services,java-ee,cxf

cxf-beans.xml is spring configuration metadata which creates bean, manages life cycle and dependenices. Since in your web.xml you have added the contextloader with context param giving location of the cxf-bean.xml, you have switched on spring container on top of which cxf runs. Coming back to your issue, it seems like...

SoapFault MustUnderstand headers, CXF WSS4J No crypto property file supplied

cxf,wss4j

Start by enabling DEBUG/FINE logging. It will tell you exactly what the problem is....likely that it can't load the path you have given. I would suggest trying the following instead: <entry key="signaturePropFile" value="classes/etc/sign.properties"/> Colm....

How to enable pretty logging of SOAP messages in JBoss 7

web-services,logging,soap,jboss,cxf

Even though Serdal's answer is correct, it does not look practical to me. My solution I removed org.apache.cxf.logging.enabled system property and used following code to enable SOAP logging: Client client = ClientProxy.getClient(port); LoggingInInterceptor inInterceptor = new LoggingInInterceptor(); inInterceptor.setPrettyLogging(true); client.getInInterceptors().add(inInterceptor); LoggingOutInterceptor outInterceptor = new LoggingOutInterceptor(); outInterceptor.setPrettyLogging(true); client.getOutInterceptors().add(outInterceptor); ...

Create webservice on Android device with cxf?

android,web-services,soap,cxf

Ok, i did it - one have to patch cxf core, cxf transport, cxf discovery api, port jaxb to android, patch txw, edit wsdls and bundle default wsdls (like ws-addressing), patch resources loading (as all META/* resources are removed by android builder), patch getting package annotations (not supported by android)....

How to disable chunking in cxf-jaxrs client

http,cxf,jax-rs

Rather that using jaxrs standard Client you can use org.apache.cxf.jaxrs.client.WebClient part of cxf-rt-rs-client dependency. WebClient client = WebClient.create("http://localhost:8080/rs"); WebClient.getConfig(client).getHttpConduit().getClient().setAllowChunking(false); ...

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

Given NoClassDefFoundError: Could not initialize class org.apache.cxf.common.injection.ResourceInjector I would guess that there's a problem with the static initialization in ResourceInjector due to class loading issues. When you look at the source code of ResourceInjector you'll notice that it has a static initializer that uses javax.annotation.Resource. I'm am not familiar with...

How to create the CXFServlet?

java,servlets,cxf

I have a simple spring boot application that works correctly with CXFServlet - here is the extract from pom.xml: <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <start-class>demo.DemoApplication</start-class> <java.version>1.7</java.version> <cxf.version>3.1.0</cxf.version> </properties> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId>...

CXF unit testing

junit,cxf,jax-rs

I like the approach you mention in your link, but it depends on your set up. I show how I managed to create junit test for cxf server using spring configuration: // Normal Spring Junit integration in my case with dbunit @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:/root-test-context.xml", "classpath:/rest-test-context.xml" }) @TestExecutionListeners({ DependencyInjectionTestExecutionListener.class,...

SAML2 assertion with home defined AttributeBean in CXF

xml,cxf,saml,attr

You can't use OpenSAML 3 with CXF 3.0.x or WSS4J 2.0.x. If you really need to use OpenSAML 3, then you will need to work with the CXF master SNAPSHOT code (3.1.0-SNAPSHOT), which is currently working with OpenSAML 3. Colm....

CXF SOAP Client outbound message has empty body

java,cxf,soap-client

It was found that this happens when you run the generated client class without referencing the CXF Lib jar files. After adding them into the classpath, the body of the message is then generated.

CXF webservice client ignores ssl configuration http-conf:tlsClientParameters

java,spring,web-services,ssl,cxf

You should use port name with qualified namespace for http-conf:conduit name attribute. Check Apache CXF documentation.

Camel Http proxy to Web services

java,http,soap,cxf,apache-camel

Here is what I've done and it works.. velocity_template.vm contains the entire SOAP request with dynamic fields substituted at runtime eg. ${in.headers.name} <?xml version="1.0" encoding="UTF-8"?> <!-- START SNIPPET: e1 --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="...

Limit output payload response in CXF JAX-RS based service

java,spring,rest,cxf,jax-rs

I resolved this partially using help from this answer. I say partially because I'm successfully able to control the payload, but the not the response status code. Ideally, if the response length is greater than 500 and I modify the message content, I would like to send a different response...

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

web-applications,wsdl,cxf,command-line-arguments

Ok.. found the solution.. I did set the username and password in the environment variables of my system and it worked. Thank you...

CXF InInterceptor not firing what am I missing

java,apache,web-services,maven,cxf

It was the org.apache.cxf.impl dependency that I was missing, now everything works great !

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

java,web-services,soap,wsdl,cxf

The reason the CXF client is not signing the Body, is that you have no policy to tell it to. You need to include a policy that looks like the following: <sp:SignedParts> <sp:Body/> </sp:SignedParts> Colm....

How to change the wsdl url of cxf endpoint?

web-services,soap,wsdl,cxf,apache-camel

You can define the CxfEndpoint by adding a properties setting just like <cxf:cxfEndpoint id="securityService" address="https://0.0.0.0:9080/services/version.SecurityHttpsSoap11Endpoint" endpointName="s:version.SecurityHttpsSoap11Endpoint" serviceName="s:version" wsdlURL="etc/version.wsdl" xmlns:s="http://axisversion.sample"> <cxf:properties> <entry key="publishedEndpointUrl" value="http://www.simple.com/services/test" /> </cxf:properties> </cxf:cxfEndpoint> </cxf:cxfEndpoint> ...

How to persist XMLGregorianCalendar with JPA?

hibernate,soap,cxf

XMLGregorianCalendar is not supported by JPA, you could use java.util.Date or java.util.Calendar (explained here). Maybe you could take a look at the project Hyperjaxb3 (provides relational persistence for JAXB objects). Here it's explained how to deal with temporal properties: Temporal properties (typed xsd:dateTime, xsd:date, xsd:time and so on) will be...

Expose RAML contract instead WADL in CXF

rest,cxf,wadl,cxfrs,raml

Assuming you package your CXF service as a WAR, here is how you can achieve your goal, based on a real project I'm working on: Drop RAML and JSON files below the webroot folder: https://github.com/openanalytics/RPooli/tree/master/webapp/src/main/webapp/raml Template baseUri so it can be injected at runtime: https://github.com/openanalytics/RPooli/blob/master/webapp/src/main/webapp/raml/api_v1.raml#L21 Declare .raml as if it's...

Apache CXF Spring Java Config for JAXWS Endpoint

spring,cxf

The 'Java-config' equivalent of your XML configuration is something like : @Configuration public class CXFConfiguration { @Autowired private ReportService reportServ; @Bean public Endpoint endpoint() { Endpoint endpoint = new EndpointImpl(reportServ); endpoint.publish("/reportService"); return endpoint; } } I hope this can help you ^^....

CXF auto generation fails with “Duplicated option: frontend” in maven?

java,web-services,maven,soap,cxf

Remove that <extraargs><extraarg>-fe</extraarg><extraarg>cxf</extraarg></extraargs> section. Add this extraarg in wsdlOption <wsdlOption> <extraarg>-autoNameResolution</extraarg> </wsdlOption> ...

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

java,web-services,soap,cxf

The problem is that you are mixing up the "manual" way of configuring WS-Security in CXF - by adding the WSS4JOutInterceptor, with the policy driven approach. The latter applies when you have a WS-SecurityPolicy in the WSDL - this is the case here, as the stacktrace references the PolicyBasedWSS4JOutInterceptor, which...

Create Enveloped Signature with CXF and WSS4J

java,soap,cxf,jax-ws,xml-signature

As far as I understood, WSS4J is not able to create an Enveloped Signature at all! Therefore I moved into another direction. I used Apache Santuario in order to create a Signature for my message. I used the Intercepor mechanism of CXF to create my own interceptor, an abstract class...

cxf create client fails in intranet

cxf

remove all cxf-related jar, works. because i did't use cxf library in my code, just use cxf tool to generate stub classes...

Apache-cxf wsdlvalidator returns error in mime:part

xml,wsdl,cxf,validation

The problem is in schema http://schemas.xmlsoap.org/wsdl/mime/, which is incorrect. The solution I found: Replace \apache-cxf-3.0.1-src\core\src\main\resources\schemas\wsdl\mime-binding.xsd file by new correct schema, which is located on http://schemas.xmlsoap.org/wsdl/mime/2004-08-24.xsd, build new core-jar and refresh it in bin source....

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

java,web-services,wsdl,cxf

Problem solved! First there was an error in the wsdl file. The namespace http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512 was incorrect and had to be replaced by http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702 or http://schemas.xmlsoap.org/ws/2005/07/securitypolicy. As there is a policy defined in the wsdl file, populating the requestContext map is the right thing to do. And finally, in the doQuery(EurlexWebServiceProvider...

Restricting max file size per resource

java,spring,apache,cxf,jax-rs

You will have to organise your endpoints/resources in separate <jaxrs:server > tags with their own settings for attachment size: <jaxrs:server id="services"> <jaxrs:properties> <entry key="attachment-max-size" value="1024" /> </jaxrs:properties> .... </jaxrs:server> <jaxrs:server id="largeFileServices"> <jaxrs:properties> <entry key="attachment-max-size" value="1000000" /> </jaxrs:properties> .... </jaxrs:server> http://cxf.apache.org/docs/jax-rs-multiparts.html ...

CXF with Spring-Boot

cxf,jax-ws,spring-boot

Have your jaxwsEndpoint bean return an instance of org.apache.cxf.jaxws.EndpointImpl, which extends javax.xml.ws.Endpoint: @Autowired private ApplicationContext applicationContext; @DependsOn("servletRegistrationBean") @Bean public Endpoint jaxwsEndpoint(){ Bus bus = (Bus) applicationContext.getBean(Bus.DEFAULT_BUS_ID); EndpointImpl endpoint = new EndpointImpl(bus, subscriberApi()); endpoint.publish("/SubscriberApi"); // also showing how to add interceptors endpoint.getServer().getEndpoint().getInInterceptors().add(new...

SignedSupportingTokens wssecurity policy cxf client

java,soap,cxf,ws-security,cxf-client

Answering my own question as it might help somebody someday! CXF does supports SignedSupportingTokens and a lot more, In my case, service WSDL was having a different namespace for SignedSupportingTokens which CXF client dint understand (couldn't match up). I was able to fix the issue by using ws-security interceptors to...

How to get elements from autogenerated @XmlSeeAlso?

java,xml,jaxb,cxf

I will attempt to address the points you raised: //there is no getAnySubType() method! There wouldn't be. It isn't common object-oriented practice to have a method on a super class that returns an instance of a specific subclass. well somehow a few values that I need to get from the...

JavaToWS Error while generating web service with CXF

java,web-services,cxf

It is all about project hasnt been built. I selected Project->Build Automatically in Eclipse. More information. Solution here

WebClient of CXF throws NPE when query param value is null

web-services,cxf,jax-rs

Looks like the WebClient API does not expect the parameter value to be "null"

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

soap,cxf,soapui,x509,ws-security

The policy says that the initiator token (signature token) must always be included to the recipient. However, your message only references the signature token via IssuerSerial. Colm....

How do you get logging from the CXF Rest Client?

rest,logging,cxf,cxf-client

Here's how you do it with CXF: import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; import org.apache.cxf.interceptor.LoggingInInterceptor; import org.apache.cxf.jaxrs.client.ClientConfiguration; import org.apache.cxf.jaxrs.client.WebClient; import org.json.JSONException; import org.json.JSONObject; ... WebClient client = WebClient.create(endPoint, providers).accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON); ClientConfiguration config = WebClient.getConfig(client);...

Spring @Transactional commiting partial results even exception is thrown

java,spring,hibernate,jpa,cxf

Spring will only rollback the transaction if it is an unchecked exception, if the exception is a checked exception then you will have to add that to your @Transactional annotation. @Transactional(rollbackFor = SIASFaultMessage.class) ...

CXF Webservice response with XML content

java,xml,web-services,jaxb,cxf

You can use jaxws Provider's Payload mode. See http://cxf.apache.org/docs/provider-services.html Your service can then just return a Source object that is just a generic XML object. Something like shown below: import javax.xml.transform.Source; import javax.xml.ws.Provider; import javax.xml.ws.Service; import javax.xml.ws.ServiceMode; import javax.xml.ws.WebServiceException; import javax.xml.ws.WebServiceProvider; @WebServiceProvider(serviceName="EchoService", portName="EchoPort") @ServiceMode(value=Service.Mode.PAYLOAD) public class...

Dynamic query parameters in CXF web client

java,spring,apache,cxf

You can add any number of parameters to the CXF WebClient using WebClient.query(String, Object...). For example, if you have a Map of parameters, you could do like something the following: Map<String, String> params = new HashMap<>(); params.put("foo", "hello"); params.put("bar", "world"); WebClient webClient = WebClient.create("http://url"); for (Entry<String, String> entry : params.entrySet())...