Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法使用WSO2 ESB创建新资产_Wso2_Wso2esb_Wso2greg - Fatal编程技术网

无法使用WSO2 ESB创建新资产

无法使用WSO2 ESB创建新资产,wso2,wso2esb,wso2greg,Wso2,Wso2esb,Wso2greg,我在WSO2 ESB 490中创建自定义代理服务: {“name”:“2rest_test”,“context”:“/resttest2”,“type”:“restservice”,“version”:“1.0.0”} 在研究carbon governance源代码后,我发现“org.wso2.carbon.governance.rest.api.internal.GenericArtifactMessageBodyReader”类中的方法“可读取” 但是我写的代理发送了内容类型 appli

我在WSO2 ESB 490中创建自定义代理服务:


{“name”:“2rest_test”,“context”:“/resttest2”,“type”:“restservice”,“version”:“1.0.0”}

在研究carbon governance源代码后,我发现“org.wso2.carbon.governance.rest.api.internal.GenericArtifactMessageBodyReader”类中的方法“可读取”

但是我写的代理发送了内容类型

application/json; charset=UTF-8
它们不一样,因此该方法返回false,而不处理json post

我尝试按如下方式重置ESB代理内容类型:

<property name="messageType" value="application/json" scope="axis2" type="STRING"/>
<property name="ContentType" scope="default" type="STRING" value="application/json"/>

但内容类型仍然是“application/json;charset=UTF-8”


我认为这就是原因,但我们如何解决它呢?

为什么这个问题会被否决?我改变了方法“isReadable”返回true,不管它收到什么媒体类型,编译代码并生成governance.war,替换原始war,现在就可以创建资产了。
application/json; charset=UTF-8
<property name="messageType" value="application/json" scope="axis2" type="STRING"/>
<property name="ContentType" scope="default" type="STRING" value="application/json"/>