这是带有GET方法的xml代码
<definitions xmlns="http://ws.apache.org/ns/synapse">
<api name="StockQuoteAPI" context="/stockquote">
<resource uri-template="/view/" methods="GET">
<inSequence>
<property name="messageType" value="application/json" scope="axis2" type="STRING"/>
<send>
<endpoint>
<address uri="http://localhost:8000/apiSample/" format="soap11"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</resource>
</api>
我正在尝试从本地主机获得以下响应:8000 / apiSample /
[
{
"id": 2,
"name": "C",
"paradigm": "Procedural"
},
{
"id": 1,
"name": "Java",
"paradigm": "Object-oriented"
},
{
"id": 4,
"name": "ruby",
"paradigm": "Object-oriented"
}
]
但是我所收到的只是此响应,请更改此响应以匹配上面的
{
"name": [
"This field is required."
],
"paradigm": [
"This field is required."
]
}