【问题标题】:Empty Soap Body returned from Camel Processor in Payload Mode在有效负载模式下从骆驼处理器返回的空肥皂体
【发布时间】:2014-12-03 14:07:46
【问题描述】:

我正在创建 cxf webservice 首先,cxf 端点将收到一个调用,然后它以有效负载模式传递给骆驼路由,首先在骆驼路由中我解组请求并在此之后进行一些处理,它会返回响应

但是当我返回一个响应时,我的身体是空的。虽然所有数据都正确显示在日志中。

我是否需要处理器将其更改为肥皂消息。

<from uri="cxf:bean:cardServiceCall?dataFormat=PAYLOAD" />
<camel:unmarshal ref="jaxb" />
<camel:process ref="ResponseProcessor"></camel:process>
<camel:marshal ref="jaxb" />

更新我知道我必须对其进行编组,但在编组时我收到 JAXB 编组错误 XMLRootElement annontation missing 错误

【问题讨论】:

    标签: java web-services apache-camel cxf apache-servicemix


    【解决方案1】:

    我解决了这个问题,实际上我的架构有问题。

    我已为我的复杂类型命名,并使用不正确的名称引用了元素类型。你应该像下面那样做

     <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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-27
      • 2019-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-21
      • 1970-01-01
      • 2014-02-11
      相关资源
      最近更新 更多