2017-04-26 171 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感谢您的帮助 –