Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

funtamental of web services  RSS feed

 
Bharat Makwana
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,

I am using web services in my project since last 6 months.I am using eclipse wtp(Web Tool Platform) to develop web services which uses apche axis to create and call web services.

I have very little knowlege on how to write wsdl and how to call webservices from different context(like from jsp,servlet) and how to pass parameters.

Now I want to know all these things.i.e internally how all these works,what should I do ?

Any help will be highly apreciatied.

Thanks
 
Arafat Nalkhande
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the clinet for web service can be anything... it can be a pojo, jsp, servlet or an ejb, it really doesnt matter

Look at the following code snippet for a WS client
--------------------------------------------------
ServiceFactory serviceFactory = ServiceFactory.newInstance();
Service service = serviceFactory.createService(serviceQName);
Call call = service.createCall();
call.setOperationName(operationQName);
call.setTargetEndpointAddress(location);
call.addParameter("symbol", stringQName, ParameterMode.IN);
call.addParameter("currency", stringQName, ParameterMode.IN);
call.setReturnType(doubleQName);
Double result = (Double) call.invoke(new Object[]{"usa", "india"});


Now this answers your question about how to pass parameters to the web service.

you can now use this snippet in a jsp or a servlet as well.
 
Raghav Mathur
Ranch Hand
Posts: 641
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!