Currently I am using Axis2 to make some REST API. And I am confused about the difference between a SOAP style url and a REST style url. Can anyone explain this?
For example, for an server API written in java like this:
package cn.edu.xidian;
public class Salary {
public int getSalary(String name) {
if ( name.equals("zhangsan") ) {
return 3000;
} else if ( name.equals("lisi") ) {
return 4000;
} else
return 5000;
}
}
The REST url for GET this service will look like:
http://localhost:8080/axis2/services/SalaryService/getSalary?name=zhangsan
If my comprehension is right, this url goes into the server side API, call the method 'getSalary' with an argument 'name' equals 'zhangsan', and then the RESTful output in the browser will look like:
<ns:getSalaryResponse>
<ns:return>3000</ns:return>
</ns:getSalaryResponse>
Then what will a SOAP style URL and related stuff look like?