WSDL2Java的不会创建所有的存根 [英] WSDL2Java won't create all the stubs

查看:138
本文介绍了WSDL2Java的不会创建所有的存根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Apache Axis2和更具体地,WSDL2Java工具来生成网络服​​务的存根和创建客户机,给定的WSDL文件。

I'm using Apache axis2 and more specifically, the wsdl2java tool to generate the stubs for a web service and create a client, given the wsdl file.

当我尝试生成一个PayPal Web服务存根类(它的WSDL文件这里)轴不会产生这两个项目中包括WSDL,但只是第二个(PayPalAPIAASoapBinding)绑定存根

When I try to generate stub classes for a paypal web service (its wsdl file is here) axis won't generate stubs for both the bindings included to the wsdl but just for the second one (PayPalAPIAASoapBinding)

有没有人对这个WSDL曾与前Apache的WSDL2Java工具?

Has anybody worked on this wsdl with apache's wsdl2java tool before?

推荐答案

我一直在挣扎与此了。

简短的回答:

附加的 -pn PayPalAPI 以您的Axis2的命令。

Short answer:
Append -pn PayPalAPI to your Axis2 command.

龙回答:

看看贝宝的WSDL如下:

Long answer:
Take a look at following lines of the PayPal WSDL:

<wsdl:service name="PayPalAPIInterfaceService">
    <wsdl:port name="PayPalAPI" binding="ns:PayPalAPISoapBinding">
        <wsdlsoap:address location="https://api.sandbox.paypal.com/2.0/"/>
    </wsdl:port>
    <wsdl:port name="PayPalAPIAA" binding="ns:PayPalAPIAASoapBinding">
        <wsdlsoap:address location="https://api-aa.sandbox.paypal.com/2.0/"/>
    </wsdl:port>
</wsdl:service>

显然,WSDL指定了一个2端口1服务。我们的问题是,Axis2中仅创建用于第二端口,PayPalAPIAA,但不为端口PayPalAPI点。

存根
现在,看看在2轴命令行选项参考(
http://ws.apache.org/axis2/tool​​s/1_2/$c$cgenToolReference.html#cmdref ),具体而言,在选择的 -pn 的说明:

Obviously, the WSDL specifies 1 service with 2 ports. Our problem is that Axis2 only creates the stub for the second port, "PayPalAPIAA" but not for the port "PayPalAPI".

Now, take a look at the Axis 2 command line option reference (http://ws.apache.org/axis2/tools/1_2/CodegenToolReference.html#cmdref), specifically, at the description of the option -pn:

指定端口名称为code产生的。如果没有指定端口名称,则第一个端口(选定的服务)将被挑选出来的。

"Specifies the port name to be code generated. If the port name is not specified, then the first port (of the selected service) will be picked."

因此​​,指定的 -pn PayPalAPI 的伎俩。

Thus, specifying -pn PayPalAPI does the trick.

这篇关于WSDL2Java的不会创建所有的存根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆