How to create soap request template using java

1k views Asked by At

I want to create soap template for give WSDL(the WSDL will change).I want to create a soap template like SoupUI.Steps I need

1.User will give the give the URL

2.Parse the WSDL

3.Create soap template for soap request

4.for Given WSDL I need to create soap template

which java wsdl library I need to use?

1

There are 1 answers

1
Sinto On

Soap UI itself is the best one for it. If you wan to do it using java try soapui library for the same.

        WsdlProject project = new WsdlProject();
        WsdlInterface[] wsdls = WsdlImporter.importWsdl(project, "http://webservices.daehosting.com/services/TemperatureConversions.wso?WSDL");
        for (Operation operation : wsdls[0].getOperationList()) {
            WsdlOperation op = (WsdlOperation) operation;
            System.out.println(op.createRequest(true));
            System.out.println(op.createResponse(true));
    }

The dependency details can be found from pom here. Jars can be directly downloaded from here.

Here is another link for more info.