如何使用wso2 esb mediators向客户端显示消息

时间:2014-11-27 03:42:26

标签: curl wso2 wso2esb wso2carbon wso2-am

您好我已经创建了一个带有switch和dblookup调解器的自定义序列。在其中一种情况下,我想向客户显示消息。我尝试过Respond Mediators但是在使用cURL调用API时它不会输出任何消息。我只是让HTTP正常。关于如何处理这个的任何建议?

* Hostname was NOT found in DNS cache
*   Trying localhost...
* Connected to localhost (localhost) port 8280 (#0)
> GET /drewtest/1.0/users/103 HTTP/1.1
> User-Agent: curl/7.38.0
> Host: localhost:8280
> Authorization: Bearer 53f983bc15a4b19e5d929fba4d4e9ada
> Accept: application/json
>
< HTTP/1.1 200 OK
< Host: localhost:8280
< Accept: application/json
< Date: Thu, 27 Nov 2014 03:29:24 GMT
* Server WSO2-PassThrough-HTTP is not blacklisted
< Server: WSO2-PassThrough-HTTP
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact

1 个答案:

答案 0 :(得分:1)

在您的特定情况下,使用payload mediator创建自定义消息,然后使用<respond>介体。它会将消息发送给客户端。尝试使用SOAPUI。

    Eg: 
    <Sequence>

     <Your case>
    <payload>
    It will construct the required message to be sent back to client
    </payload>
    <respond> //Will send that message to client

    </Yourcase>
 </Sequence>