I am new to Axis2 Web services, and I tried to implement Axis2 from some simple tutorials. My code runs well in JavaEE with Tomcat server 7.0+, however I still haven't fully understood how client and server connect together. For that reason, I have a several general questions regarding to Axis2:
What is the functions of the Stub.java file that is automatically generated in client side? I don't know how it functions, but it seems to handle the requests of the client side. Here is the code I need to implement to run from the client side:
public static String getData(int code) throws RemoteException, MylittleShopParserConfigurationExceptionException, MylittleShopIOExceptionException, MylittleShopSAXExceptionException { //When creating client web service, importing http://localhost:8080/Server/services/MylittleShop?wsdl (this is the xml file for //describing server-web service, it will tell the client how to compose a web service request and the interface that is // provided by the server ,all of thing contained in MylittleShopStub class. MylittleShopStub ser = new MylittleShopStub(); GetData setCode = new GetData(); setCode.setCode(code); GetData1Response getCode = null; getCode = ser.getData1(setCode); return getCode.get_return();
}
My service is simply to send a code (id) to the server to retrieve a dataset from the database.
- What I need to write in the client side is the function that is auto-generated based on the function I have in the server side. However, I only need to pass the necessary parameters then send back to the server to get the response. So how do the parameters in client side are handled uppon sending requests to the server?
- Do client and server communicate via HTTP?
Thank you in advance!