Axis wsdl2java 未在存根中生成所有接口
我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简单的一个是:
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"