0

I was given a WSDL file as well as the URL of corresponding web service. I know that I must convert the WSDL file to Java classes, using a tool like wsimport. But after that, I am quite lost. How do I write the client code to use these generated classes? I have been googling and still quite not sure about it.

Thanks.

1 Answer 1

1

You can use Apache CXF wsdl2java command to convert wsdl file to java file. After that usage is quite simple as follows(and there are may tutorials available):

HelloService service = new HelloService();

Hello client = service.getHelloHttpPort(); 
String result = client.sayHi("Joe");

WSDL2Java link: http://cxf.apache.org/docs/wsdl-to-java.html
CXF Client Tutorial: http://cxf.apache.org/docs/how-do-i-develop-a-client.html

Thanks.

Sign up to request clarification or add additional context in comments.

2 Comments

There is also an Axis2 wsdl2java.bat. Is this the same as the CXF one?
yup, they are the same but the output stub files differ in ways you can use them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.