【发布时间】:2023-03-02 23:12:01
【问题描述】:
在wsdlmanual中,在示例2的第二部分,有一个wsdl文件有portType,但没有binding块
<?xml version="1.0"?>
<definitions
targetNamespace="http://example.com/stockquote/definitions"
xmlns:tns="http://example.com/stockquote/definitions"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<import namespace="some.xsd"
location="some.xsd"/>
<message name="GetLastTradePriceInput">
<part name="body"/>
</message>
<message name="GetLastTradePriceOutput">
<part name="body"/>
</message>
<portType name="StockQuotePortType">
<operation name="GetLastTradePrice">
<input message="tns:GetLastTradePriceInput"/>
<output message="tns:GetLastTradePriceOutput"/>
</operation>
</portType>
</definitions>
some.xsd 是同一示例的第 1 部分,也不包含任何绑定。
当我尝试通过cxf 的wsdltojava 传递该文件时,它会给我一个警告
WARNING: WSDL document file:/C:/IdeaProjects/sss/webservices/src/main/schema/BundleAdmin/Atry.wsdl does not define any services
还有一个错误:
WSI-BP-1.0 R2718 violation: A wsdl:binding in a DESCRIPTION MUST have the same set of wsdl:operations as the wsdl:portType to which it refers. GetLastTradePrice not found in wsdl:binding.
这些是wsdltojava 的使用参数:
List<String> prepareArgs = ['-fe', 'jaxws',
'-autoNameResolution',
'-db', 'jaxb',
'-xjc-extension',
'-impl', '-server', '-client', '-validate',
'-d', ext.genDirName,
/* change package name for types already generated with XmlBeans */
'-p', 'http://messaging.ei.tmobile.net/datatypes=net.tmobile.ei.messaging.jaxb'
请问,是什么让翻译程序需要binding 部分? -validate 可以让 SW 注意到问题,但不是 arg 造成问题。
【问题讨论】:
标签: java web-services soap wsdl cxf