cxf

CXF in Karaf: how to configure bean validation on subresources (preferably using Blueprint)?

淺唱寂寞╮ 提交于 2019-12-22 11:33:54
问题 I'm using Dinamics Features of CXF in Karaf and faced with the issue that Bean Validation does not work for subresources. E.g. in the following code: @Path("services") public interface Service { @Path("{id}/orders") public Order getOrderForService(@PathParam("id") int serviceId); } @Path("orders") public interface Order { @POST Product getProduct(@NotNull @Valid Product product); } when Order is root resource, bean validation works fine, but when it is invoked as a subresource of Service,

CXF maven wsdl2java plugin not generating toString() methods in the generated jaxb classes

别等时光非礼了梦想. 提交于 2019-12-22 10:35:03
问题 I have used CXF maven plugin in my project which converts wsdl file to appropriate Java classes. But I don't see toString() method in the generated Java classes. Can you please let me know how to generate toString() method. Below is the snippet of my pom.xml which I've used in my project: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

How do I change the address used by a CXF Web Service to one different than the one specified in the wsdl file?

自古美人都是妖i 提交于 2019-12-22 10:22:54
问题 I've got it working when I get the wsdl based on configuration, but I'd like to just tell it to use a specific address for the service call and use a local copy of the wsdl. MyWebService serviceDefinition = new MyWebService(new URL(wsdlLocation)); service = serviceDefinition.getMyWebServicePort(); Does anyone know the best practice for this? xml request that works. <soap:Body> <ns2:getData xmlns:ns2="http://services.test.com/"> <arg0>Test Name</arg0> <arg1>55555555</arg1> </ns2:getData> <

apache camel cxf https not working

五迷三道 提交于 2019-12-22 09:29:13
问题 I am trying to publish a webservice using apache camel cxf. I am able to access the published webservice using http. However I am trying to configure the same using https. But I am not able to get it to work. below are parts of spring context and wsdl files <camel-cxf:cxfEndpoint id="myEndoint" address="http://localhost:9000/PostXml/" serviceClass="com.XXXXXXXXXX.techquest.ServicesPortType" xmlns:ssp="http://techquest.interswitchng.com/" endpointName="ssp:PostXml" serviceName="ssp:PostXml" />

Can't find the the request for url Observer

帅比萌擦擦* 提交于 2019-12-22 08:51:17
问题 I am working with sample REST service with Apache CXF, But somehow I am not able to call the service.My implementation class is, package com.ananth.lab.cfxrest.service; import com.ananth.lab.cfxrest.vo.Address; import com.ananth.lab.cfxrest.vo.Employee; import org.springframework.stereotype.Service; import javax.jws.WebService; import javax.ws.rs.*; import java.util.ArrayList; import java.util.Collection; import java.util.List; @Path("/cservice") @Produces("application/xml") public class

Generate wadl from existing CXF rest service

别说谁变了你拦得住时间么 提交于 2019-12-22 08:41:57
问题 I have working JAX-RS service implemented with CXF. How can I generate wadl? Or is there something like with jersey http://path.to.your/restapp/application.wadl out there already? is there a maven plugin just like for wsdl, java to wsdl? I've searched for answers couldn't find. 回答1: If you are using a recent version of CXF, just hit the service with a ?_wadl parameter. 回答2: There are a lot of possible ways to generate WADL using CXF: You can sent REST call (using Postman, for example) to the

Get user name with Apache CXF 2.4 JAX-RS and Spring Security 3.2

拥有回忆 提交于 2019-12-22 08:32:58
问题 I get the user name in my JAX-RS resource with SecurityContextHolder and that works: @Path("/myresource") public class MyResoure { @Get public String getUserName() { return SecurityContextHolder.getContext().getAuthentication().getName(); } } But I want to inject the SecurityContext into a class field (to write JUnit tests). I tried some documented ways: With javax.ws.rs.core.SecurityContext I get a NullPointerException , because the securityContext is always null . @Path("/myresource")

Apache CXF 2.2.7 Spring 3 Web Service Unmarshalling Error: unexpected element

久未见 提交于 2019-12-22 07:18:22
问题 I have developed a simple web service application using Apache CXF 2.2.7 and Spring 3, deployed onto Tomcat as a WAR file, but I'm getting the following error message: 12-Apr-2010 15:56:12 org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging WARNING: Interceptor for {http://services.aristabi.com/}ReportingServiceImplService#{http://services.aristabi.com/}getNewBusinessVolumeByCreateDate_v2 has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Unmarshalling Error:

CXF 2.7.7 org.apache.cxf.interceptor.Fault: Unexpected element

你离开我真会死。 提交于 2019-12-22 06:57:24
问题 I am experiencing an error I cannot understand since upgrading to CXF 2.7.7. When making a web service call CXF is reporting this exception: org.apache.cxf.interceptor.Fault: Unexpected element {http://schema.myorg.com/GetReference/}ReferenceResponse found. Expected {http://services.myorg.com/}getReferences This makes no sense, because ReferenceResponse is exactly the response I expect. The name getReferences appears to refer to the name of the @WebMethod annotated method that is being called

SNI configuration in cxf client(3.1.2)

我们两清 提交于 2019-12-21 22:03:27
问题 I want to set custom SNI hostname(SNI configuration) while making rest call using CXF client(3.1.2). I'm using java 8.I'm able to do the same thing using HTTPClient(see below strong textcode snipped for reference), but I'm not able to figure out how to do the same using CXF client. // For HTTP client private SSLConnectionSocketFactory createSSLConnectionSocketFactory(String sniHostanme, SSLContext sslContext){ // Fix for host name verifier, need to implement----------------------