簡體   English   中英

如何在 camel-spring-ws 中捕獲 soap 故障詳細信息

[英]how to capture soap fault detail in camel-spring-ws

I am using camel framework 2.22.0 and camel-spring-ws in my spring boot microservice to convert xml into soap at runtime and make a request to backend and same time receive the soap response and coverts it back to XML before sending the response back到呼叫系統。

成功場景都運行良好,但是當 soap 故障時,它只記錄 soap 字符串並且看不到任何 soap 響應已填充。 soap 響應沒有被捕獲並且除了 http 狀態代碼 500 之外沒有返回到調用系統。

以下是后端系統作為 soap 故障發送的內容。 我在駱駝交換體中看不到任何帶有 soap 故障的東西。 我需要在詳細標簽部分捕獲 xml 響應並發送回調用系統。

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <soap:Fault>
          <faultcode>soap:Server</faultcode>
          <faultstring>abc-complex-type.x.x: Value '0' of attribute 'schemaVersion' of element 'ABCSubmission:ABCSubmission' is not valid with respect to the corresponding attribute use. Attribute 'schemaVersion' has a fixed value of '1'.</faultstring>
          <detail>
            <ns2:ABCSubmissionException xmlns:ns2="java:com.webservice.ejb" xmlns="ABCintegration.xdt">
              <ns2:ABCIntegrationError schemaVersionMajor="1" schemaVersionMinor="0">
                <ErrorName>ABCMessageSyntaxInvalid</ErrorName>
                <ErrorDescription>cvc-complex-type.3.1: Value '0' of attribute 'schemaVersion' of element 'ABCSubmission:ABCSubmission' is not valid with respect to the corresponding attribute use. Attribute 'schemaVersion' has a fixed value of '1'.</ErrorDescription>
              </ns2:ABCIntegrationError>
            </ns2:ABCSubmissionException>
          </detail>
        </soap:Fault>
      </soap:Body>
    </soap:Envelope>

Camel 區分異常和錯誤(歷史原因)。 不幸的是,駱駝文檔中似乎缺少這點。

如果您希望 Camel 將 Faults 視為與 Exceptions 相同(由 Camel 錯誤處理程序處理),則必須設置

.handleFault()

您可以在 Camel 上下文或特定路由上全局設置。 另請參閱本頁底部的評論

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM