2017-04-26 172 views
0

我正在使用WSO2 ESB向我的Rest API發送POST請求。實際上,API會返回一個包含一些數據的201狀態。 使用郵差本身的API完美的作品,但202接受響應是使用ESB鏈接 這裏是我實現返回: 的POST API鏈接: http://mysite/sites/4/floors/4/pois/12/prelockWSO2 ESB POST請求後沒有響應

我ESB API:

<resource methods="POST" uri-template="/sites/{siteId}/floors/{floorId}/pois/{poiId}/prelock"> 
    <inSequence> 
     <log level="full"/> 
     <header name="Content-Type" scope="transport" value="application/json"/> 
     <property expression="$axis2:HTTP_SC" name="Status" scope="default" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/> 
     <send> 
      <endpoint key="NodeRedPrelock"/> 
     </send> 
    </inSequence> 
    <outSequence> 
     <log level="full"/> 
     <send/> 
    </outSequence> 
    <faultSequence/> 
</resource> 

端點:

<endpoint name="NodeRedPrelock" xmlns="http://ws.apache.org/ns/synapse"> 
<http method="post" uri-template="http://mysite/sites/{uri.var.siteId}/floors/{uri.var.floorId}/pois/{uri.var.poiId}/prelock"/> 

回答

0

這個問題似乎與http方法。你可以試試這個

<endpoint name="NodeRedPrelock" xmlns="http://ws.apache.org/ns/synapse"> 
    <http trace="disable" uri-template="http://169.46.25.33:1880/sites/{uri.var.siteId}/floors/{uri.var.floorId}/pois/{uri.var.poiId}/prelock"/> 
</endpoint> 
0

你檢查你的序列在碳接口?

有時,當您將汽車部署到esb碳時,請將終端從「發送」標籤中移除。

或者它似乎是端點的問題。您可以嘗試在界面中重新保存端點。有時我在部署汽車文件和端點不工作之前有問題,直到手工保存。

+0

實際上,這是問題所在,我在圖形界面上進行了修改,但XML文件沒有更改,因此當我嘗試Basanagouda先生的解決方案時,它無效:D感謝您的幫助 –