Hello Gary,
From the wsdl, there are 2 endpoints, I just give an example to implement the http://localhost:8080/axis2/services/Operator.OperatorHttpSoap11Endpoint/ , and only 2 actions of add, getAllProduct.
So the rest api interface is designed as below,
/myapi?op=?&action=?
op=11 (for /Operator.OperatorHttpSoap11Endpoint) or 12(for another endpoint)
action=add, or getAllProduct
for action=add, the json payload is designed as below,
{
"a":"value of a",
"b":"value of b"
}
NOTE:
- In the attached policy, we are going to translate the payload directly, (as "Apply XSL Transformation” assertion has limitation on array, or namespace, etc.)
- the policy will call a fake soap backend on the localhost(the ${soapServer} is set to localhost), you should set ${soapServer} to a real backend server for testing.
- the policy doesn't transfer the xml response back to json format, you might add the formatting snippet after route via http assertion, and use return template assertion to return the json payload.
- the policy is just to show how it works, there is no error handling, parameter validation, security check, etc.
Regards,
Mark