Axis wsdl2java 未在存根中生成所有接口

发布于 2024-08-18 09:34:02 字数 950 浏览 5 评论 0原文

我正在尝试使用 wsdl2java.bat 生成存根,我的 wsdl 由两个绑定组成。我看到 wsdl2bat 在第一个绑定中为操作创建接口,但在秒绑定中没有为操作生成任何内容。 wsdl2java.bat -uri http://... -o 客户端 -d adb -s -u。

例如,代码应该如下所示

try {
     //Create the stub by passing the AXIS_HOME and target EPR.
     //We pass null to the AXIS_HOME and hence the stub will use the current directory as the AXIS_HOME 
     Axis2SampleDocLitPortTypeStub stub= new Axis2SampleDocLitPortTypeStub(null,
                                "http://localhost:8080/axis2/services/Axis2SampleStub");
     //Create the request document to be sent.
     EchoString  reqDoc= EchoString.Factory.newInstance();
     reqDoc.setEchoString("Echo this");
     //invokes the Web service.
     EchoStringReturn resDoc=stub.echoString(reqDoc);
     System.out.println(resDoc.getEchoStringReturn());

    } catch (Exception e) {
        e.printStackTrace();
    }

这里的问题是,我确实在存根的 resDoc 实例中看到了 getEchoStringReturn 方法。

I am trying to generate stub using wsdl2java.bat, my wsdl consists of two bindings. I see that wsdl2bat creates interface for operations in the first binding but does not generate anything for operations in the seconds binding. wsdl2java.bat -uri http://... -o client -d adb -s -u.

For example the code should look like this

try {
     //Create the stub by passing the AXIS_HOME and target EPR.
     //We pass null to the AXIS_HOME and hence the stub will use the current directory as the AXIS_HOME 
     Axis2SampleDocLitPortTypeStub stub= new Axis2SampleDocLitPortTypeStub(null,
                                "http://localhost:8080/axis2/services/Axis2SampleStub");
     //Create the request document to be sent.
     EchoString  reqDoc= EchoString.Factory.newInstance();
     reqDoc.setEchoString("Echo this");
     //invokes the Web service.
     EchoStringReturn resDoc=stub.echoString(reqDoc);
     System.out.println(resDoc.getEchoStringReturn());

    } catch (Exception e) {
        e.printStackTrace();
    }

The problem here is, I do see a the method getEchoStringReturn in resDoc instance of stub.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初见 2024-08-25 09:34:02

简单的一个是:

E:\use\jars\axis jars>set classpath=%classpath%;axis-1.4.jar;axis-ant.jar;axis-1.4.jar;commons-discovery-0.5.jar;commons-日志记录-api-1.1.1.jar;jaxrpc-api.jar;log4j-1.2.jar;org.apache.commons.logging.jar;saaj.jar;wsdl4j-1.5.1.jar;

然后::

E:\use\jars\axis jars>java org.apache.axis.wsdl.WSDL2Java -N"urn:/crmondemand/xml/Contact/Data"="crmondemand.xml.Contact.Data" -N “urn:/crmondemand/xml/Contact/Query”=“crmondemand.xml.Contact.Query”-N“urn:crmondemand/ws/ecbs/contact/10/2004”=“crmondemand.ws.ecbs.contact”- o E:\use\test2 "Contact1.wsdl"

Easy one is::

E:\use\jars\axis jars>set classpath=%classpath%;axis-1.4.jar;axis-ant.jar;axis-1.4.jar;commons-discovery-0.5.jar;commons-logging-api-1.1.1.jar;jaxrpc-api.jar;log4j-1.2.jar;org.apache.commons.logging.jar;saaj.jar;wsdl4j-1.5.1.jar;

and then::

E:\use\jars\axis jars>java org.apache.axis.wsdl.WSDL2Java -N"urn:/crmondemand/xml/Contact/Data"="crmondemand.xml.Contact.Data" -N"urn:/crmondemand/xml/Contact/Query"="crmondemand.xml.Contact.Query" -N"urn:crmondemand/ws/ecbs/contact/10/2004"="crmondemand.ws.ecbs.contact" -o E:\use\test2 "Contact1.wsdl"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文