I need to invoke some web service methods within a java web application that I'm building.
E.g each time a user signs up, I want to call the newUser
method on a WSDL url via Java. I'd need to pass on some parameters with the request.
Is there any built in Java class, or any publicly available class, which can make this easy, i.e I just supply the URL and the parameters, and it performs the request and returns the response?
If not, what is the standard way of invoking web services on WSDL in Java applications?
Run wsimport on the deployed WSDL URL , you can run it from your JDK:
This step will generates and compile some classes. Notice -keep switch, you need it to keep the generated Java source files.
Calculator.java - Service Endpoint Interface or SEI
CalculatorService - Generated Service, instantiate it
If you are using the Java EE 6 supported container then you can use it in this way ,