2015-02-24 113 views
2

例如從Web服務的錯誤,如果我做了錯誤的職位/直接投入到Web服務,它會給我:如何顯示在騾子,而不是騾子的錯誤信息

<prestashop> 
    <errors> 
     <error> 
     <message><![CDATA[Internal error. To see this error please display the PHP errors.]]></message> 
     </error> 
    </errors> 
</prestashop> 

但是,如果我路過騾ESB的錯誤並沒有幫助我在所有或其他開發者。

500 Internal Server Error 
Unexpected character (R) at position 0. 
Response code 404 mapped as failure. Message payload is of type: BufferInputStream 

這裏是我的騾子

<http:request-config name="HTTP_Request_Configuration_PrestaShop4" host="host.org/api/customers/#[message.inboundProperties.'http.query.string']" port="port" doc:name="HTTP Request Configuration" protocol="HTTPS"> 
    <http:basic-authentication username="keyU" password="keyP"/> 
</http:request-config> 

<flow name="prestaShopUpdateCustomerById"> 
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8080" path="prestaShopUpdateCustomerById" doc:name="HTTP"/> 
    <logger level="INFO" message="#[message.payloadAs(java.lang.String)]" doc:name="Logger"/> 
    <http:request config-ref="HTTP_Request_Configuration_PrestaShop4" path="/" method="PUT" doc:name="HTTP"> 
     <http:request-builder> 
     </http:request-builder>   
    </http:request> 
</flow> 

是否有可能使騾子顯示Web服務的錯誤,而不是此通用消息(這個問題既是REST和SOAP Web服務)。

感謝

回答

3

嘗試增加成功的狀態碼驗證器,涵蓋所有的情況下,(然後你可以更具體): <http:request path="path" method="method" config-ref="requestConfig"> <http:success-status-code-validator values="0..599"/> </http:request> 我希望幫助。

+0

它不會改變任何東西是否有另一種方式?例如在這裏,如果我的id在查詢字符串中傳遞不存在於Web服務中,它會發送給我:位置0上的意外字符(C)。 無法解析''(java.lang.IllegalArgumentException)。消息有效負載的類型爲:字符串 – 2015-02-24 18:39:31

+0

現在異常已更改。你能發佈整個堆棧跟蹤嗎?我想知道問題是否真的是監聽者,現在請求者可能正在工作。 – afelisatti 2015-02-24 19:31:04

0

使用MEL提取錯誤有效載荷#[例外]