如何使用wso2代理服务将json请求发送到restful webservice

时间:2014-03-14 06:00:16

标签: wso2 wso2esb wso2carbon

我是wso2的新手..我已经问了很多关于wso2代理服务的问题,我没有得到正确答复,有人可以帮我这个吗

我想使用WSO2代理服务向Restful webservice发送JSON请求..我已尝试过以下配置

<target>
    <inSequence>
        <log level="custom">
            <property name="in seq --------------of proxy" expression="$trp:Content-Type"/>
        </log>
        <property name="messageType" value="application/json" scope="axis2" type="STRING"/>
        <log level="custom">
            <property name="in seq --------------of proxy" expression="$trp:Content-Type"/>
        </log>
        <property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/>
        <send>
            <endpoint>
                <address uri="http://10.132.97.131:9763/RESTfulExample/rest/json/metallica/post/"/>
            </endpoint>
        </send>
    </inSequence>
    <outSequence>
        <send/>
    </outSequence>
    <faultSequence>
        <log level="full">
            <property name="MESSAGE" value="Executing default &quot;fault&quot; sequence"/>
            <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
            <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
        </log>
    </faultSequence>
</target>

我没有收到回复:(回复也是JSOn

JSON REQUEST ---- JSON RESPONSE

需要使用代理服务

执行此操作

我收到如下错误

To: /services/FilterMediatorProxy.FilterMediatorProxyHttpEndpoint/, From: 10.132.97.131, Direction: request, MESSAGE = Executing default "fault" sequence, ERROR_CODE = 0, ERROR_MESSAGE = Unexpected error during sending message out, Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><Body></Body></soapenv:Envelope>

我将JSON请求传递为

{"title":"Enter Sandman","singer":"Metallica"}

但是看到下面的错误,它没有正确传递

Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><Body></Body></soapenv:Envelope>

尝试以SOAP(xml格式)

发送

我必须为此做什么配置?我正在使用wso2 carbon 4.2.0并在此

上安装了ESB

请帮我解决正确的代理服务问题

提前多多感谢

0 个答案:

没有答案