简体   繁体   English

如何使用Java创建Soap请求模板

[英]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 我想创建用于提供WSDL的soap模板(WSDL将更改)。我想创建类似SoupUI的soap模板。

1.User will give the give the URL 1.用户将给出给出的URL

2.Parse the WSDL 2.解析WSDL

3.Create soap template for soap request 3.创建用于肥皂请求的肥皂模板

4.for Given WSDL I need to create soap template 4.对于给定的WSDL,我需要创建soap模板

which java wsdl library I need to use? 我需要使用哪个java wsdl库?

Soap UI itself is the best one for it. Soap UI本身就是最好的选择。 If you wan to do it using java try soapui library for the same. 如果您想使用Java来尝试,请尝试soapui库。

        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 . 依赖关系的详细信息可以从pom 找到 Jars can be directly downloaded from here . 可以从这里直接下载Jars。

Here is another link for more info. 这是更多信息的另一个链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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