无法在camel-cxf中击中Rest

时间:2016-08-21 18:36:15

标签: java rest apache-camel

我正在尝试使用来自此link的camel cxfRs服务器创建休息服务但是当我尝试使用soapUi时,它显示我"请求的资源不可用"我的终点是" / customers / gold?active = true"我也试过这个。 " CxfRsRouterTest /休息/客户/金活性=真&#34 ;.这是cxfConfig.xml

<jaxrs:server id="restService"
 address="http://localhost:8080/CxfRsRouterTest/rest" staticSubresourceResolution="true">
 <jaxrs:serviceBeans>
 <ref bean="customerService"/>
 </jaxrs:serviceBeans>
 </jaxrs:server> 

 <bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.json.JSONProvider"></bean>
 <bean id="customerService" class="com.infy.CustomerService"></bean>


 <cxf:rsServer id="rsServer"
 address="http://localhost:8080/CxfRsRouterTest/route"
 serviceClass="com.infy.CustomerService" 
 loggingFeatureEnabled="true" loggingSizeLimit="20" >
 <cxf:providers>
 <ref bean="jsonProvider"/>
 </cxf:providers>
 </cxf:rsServer>

Customer.java

@XmlRootElement
public class Customer {
 private String name;
 private String country;
 private String organization;
public String getName() {
    return name;
}

@XmlElement
public void setName(String name) {
    this.name = name;
}
public String getCountry() {
    return country;
}

@XmlElement
public void setCountry(String country) {
    this.country = country;
}
public String getOrganization() {
    return organization;
}
@XmlElement
public void setOrganization(String organization) {
    this.organization = organization;
}

这是我的服务类

@POST@Path("/customer/{type}")
    public Response newCustomer(Customer customer,@PathParam("type") String type,@QueryParam("active") @DefaultValue("true") boolean active){
        return null;
    }

响应是jxrs响应类

我正在使用tomcat 8进行部署。请帮我解决一下我在哪里出错。我刚开始学习camel cxf

0 个答案:

没有答案