我是肥皂和Wso2的新手。 我试图将Json请求发送到用SOAP编写的旧应用程序,但出现错误。不知道我是否应该更新任何调解策略,还是Json请求被弄乱了 任何人都可以看看这个并帮助进行下一步吗?我会错过某些步骤吗?
"faultcode": "S:Client",
"faultstring": "Couldn't create SOAP message due to exception: unexpected XML tag. expected: {http://schemas.xmlsoap.org/soap/envelope/}Envelope but found: {http://www.XXXoftware.com/triad/}sendTransaction"
Json Request
{ "Envelope": {
"Header": {
"__prefix": "soapenv"
},
"Body": {
"sendTransaction": {
"loginName": "_O_TriadJ",
"loginPassword": "_Tr1adJ",
"orgName": "OSS",
"transaction": {
"TransactionCommandList": {
"TransactionCommand": {
"SetUserName": {
"UserName": "username"
},
"QueryLocation": {
"LocationId": "2123325607"
}
}
}
},
"__prefix": "tri"
},
"__prefix": "soapenv"
},
"_xmlns:soapenv": "http://schemas.xmlsoap.org/soap/envelope/",
"_xmlns:tri": "http://www.XXXsoftware.com/triad/",
"__prefix": "soapenv"
}
}
------------------------------------------------------------------------------
My conversion policies has
<header description="SOAPAction" name="SOAPAction" scope="transport" value=""/>
<property name="REST_URL_POSTFIX" scope="axis2" action="remove"/>
<property expression="json-eval($.sendTransaction.loginName)" name="req.var.sendTransaction.loginName"/>
<property expression="json-eval($.sendTransaction.transaction.priority)" name="req.var.sendTransaction.transaction.priority"/>
<property expression="json-eval($.sendTransaction.transaction.wait)" name="req.var.sendTransaction.transaction.wait"/>
<property expression="json-eval($.sendTransaction.transaction.provision)" name="req.var.sendTransaction.transaction.provision"/>
<property expression="json-eval($.sendTransaction.transaction.version)" name="req.var.sendTransaction.transaction.version"/>
<property expression="json-eval($.sendTransaction.transaction.id)" name="req.var.sendTransaction.transaction.id"/>
<property expression="json-eval($.sendTransaction.loginPassword)" name="req.var.sendTransaction.loginPassword"/>
<property expression="json-eval($.sendTransaction.transaction.TransactionCommandList.TransactionCommand)" name="req.var.sendTransaction.transaction.TransactionCommandList.TransactionCommand"/>
<property expression="json-eval($.sendTransaction.orgName)" name="req.var.sendTransaction.orgName"/>
<payloadFactory description="transform" media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.XXXsoftware.com/triad/">
<soapenv:Header/>
<soapenv:Body>
<web:sendTransaction xmlns:web="http://www.XXXsoftware.com/triad/">
<web:loginName>$1</web:loginName>
<web:transaction>
<web:priority>$2</web:priority>
<web:wait>$3</web:wait>
<web:provision>$4</web:provision>
<web:version>$5</web:version>
<web:id>$6</web:id>
<web:TransactionCommandList>
<web:TransactionCommand>$8</web:TransactionCommand>
</web:TransactionCommandList>
</web:transaction>
<web:loginPassword>$7</web:loginPassword>
<web:orgName>$9</web:orgName>
</web:sendTransaction>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg evaluator="xml" expression="get-property('req.var.sendTransaction.loginName')"/>
<arg evaluator="xml" expression="get-property('req.var.sendTransaction.transaction.priority')"/>
<arg evaluator="xml" expression="get-property('req.var.sendTransaction.transaction.wait')"/>
<arg evaluator="xml" expression="get-property('req.var.sendTransaction.transaction.provision')"/>
<arg evaluator="xml" expression="get-property('req.var.sendTransaction.transaction.version')"/>
<arg evaluator="xml" expression="get-property('req.var.sendTransaction.transaction.id')"/>
<arg evaluator="xml" expression="get-property('req.var.sendTransaction.loginPassword')"/>
<arg evaluator="xml" expression="get-property('req.var.sendTransaction.transaction.TransactionCommandList.TransactionCommand')"/>
<arg evaluator="xml" expression="get-property('req.var.sendTransaction.orgName')"/>
</args>
</payloadFactory>
<property description="messageProperty" name="messageType" scope="axis2" type="STRING" value="text/xml"/>