简体   繁体   中英

How to create soap request template using java

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM