This is simple webservice written by java.
public UserData getUserData(UserData userData){
userData.setAge(50);
return userData;
}
In above method Userdata is Data object that can be hold all user information.
You can reffer www.webservice-guru.blogspot.com for how to know implementing .aar file for axis2.
- After Implement the application we deploy the webservice in axis2 webservice engine and take the specific URL for that webservice.It shouldbe a url that is relavent wsdl file of the webservice
http://hostname:8080/axis2/services/webservicename?wsdl
I will explain step by step that how to implement dot application for our above task.
- Create the new Project and new class on that project
- Let see that we are going to access the following java web service method througth .Net application
- In dotnet application our namespace is clientForUserData
- Then Right click on the project and add the web references to that object
- Use the above URL and search the available web services.
- Then It list the all webservices that is found
- Give web service name and add the webservice to your dot net project.
and if our webservice is TCSService (That web service method has been declared)
Bellow is sample code to access that webservice
clientForUserData.testwebservice.TCSService tcs = new clientForUserData.TCSService.TCSService();
clientForUserData.TCSService.UserData ud = new clientForUserData.TCSService.UserData();
ud.name = 'dhanushka';
ud.age = 26;
clientForUserData.TCSService.UserData updatedUD = new clientForUserData.TCSService.UserData();
updatedUD = tcs.getUserData(ud);
Console.WriteLine(updatedUD.name );
Console.WriteLine(updatedUD.age );
Out put will be
dhanushka
50