当前位置: 首页 > 知识库问答 >
问题:

cxf POJO模式下来自camel的空响应

章宏恺
2023-03-14
    from("cxf:http://localhost:9000/sampleService?serviceClass=com.sample.CommonIntf")
.id("wsProxy")
.bean(MyBean.class)
@Handler
public SOut handle(SInput sin){
    SOut s = new SOut();
    s.setName(sin.getName());
    s.setSurName("aa");
    return s;
}
public interface CommonIntf{
    SOut sampleMethod(SInput input);
}

共有1个答案

高海阳
2023-03-14

我认为,您只是没有设置exchange输出主体(请求-应答模式)。

尝试像这样修改您的路由:

from("cxf:http://localhost:9000/sampleService?serviceClass=com.sample.CommonIntf")
.id("wsProxy")
.to("bean:MyBean?method=handle");

MyBean类必须在bundle上下文中注册。

<bean id="MyBean" class="com.sample.MyBean"/>
 类似资料:
  • 我有一个Rest服务,并且使用Spring的RestTemplate和Apache HttpClient作为, 当Web服务返回204响应时,204响应之后的第二个服务调用将失败,并出现读取超时。 Spring网:4.3.5 我不知道原因。有什么帮助吗? 编辑:从调试日志, org . Apache . http . impl . conn . defaulthttpresponseparser;

  • 我希望创建使用Spring上下文和模拟存储库bean的测试。我使用的是Spring Boot 1.3。2.构建快照JUnit Mockito。 以下是我的测试配置类: 此配置的目的是将OfferPresository从Spring上下文中排除并对其进行模拟,由于此,我将能够编写使用Spring上下文和模拟数据库存储库的测试。 这是我的测试课: 测试和测试配置目录为: 我的应用程序配置和包含Offe

  • 我正试图从bootstrap beta 4.0中的下拉菜单项中创建一个模式。它似乎不起作用。我在页面上的其他modals上使用了相同的格式,它们正在工作。 模式如下:

  • 我知道Camel用于接收消息的JMS组件使用Springs DefaultMessageListenerContainer。可以将其配置为使用CLIENT_ACKNOWLEDGE模式来确认消息。我的问题是,到底什么时候调用message.acknowledge()方法?它是由Spring的侦听器容器内部调用的吗?

  • 我正在使用空手道验证GET请求的整个json响应。 下面是来自请求的json响应示例(我只为items显示了两个元素) 以下是我试图验证的方式: 但是,我得到了一个断言错误:

  • 我在wift 3.0中访问了一个Web服务,并且我也在离线模式下收到响应。 以下是我工作的细节: > 我需要调用1个Web服务-让url=URL(string:"http://microblogging.wingnity.com/JSONParsingTutorial/jsonActors") 通过使用URLSession。共享。数据任务(…)我在上述web服务中调用的方法。 用try?语句的JS