【发布时间】:2013-12-30 18:51:47
【问题描述】:
我们从客户那里得到一个 WSDL,要求我们在我们这边实现服务。
WSDL 包含 3 个端口绑定,具有不同的名称和绑定,但相同的 <soap:adress> --- 像这样:
<port name="Name1" binding="tns:Binding1">
<soap:address location="http://localhost/Service/ServicePort" />
</port>
<port name="Name2" binding="tns:Binding2">
<soap:address location="http://localhost/Service/ServicePort" />
</port>
<port name="Name3" binding="tns:Binding3">
<soap:address location="http://localhost/Service/ServicePort" />
</port>
这样的 WSDL 可以用 CXF 实现吗?
当我运行 wsdl2java 时,CXF 会生成 3 个 java 接口。
我首先尝试了一个实现类,比如
class MyServiceClass implements Interface1, Interface2, Interface3 {...}
但是当我部署它并使用 SoapUI 检查时,出于某种原因,
它只会暴露Interface1的端口绑定,
并且似乎忽略了另外两个。 为什么?
然后我尝试实现 3 个不同的 ServiceClass(每个都实现一个接口),
然后将多个具有相同address 属性的<jaxws:endpoint> 放入cxf-config.xml
然后我得到部署错误:
RuntimeException: Soap 1.1 endpoint already registered on address /Address
任何提示,如何在 CXF 中实现这样的 WSDL? 有可能吗?
【问题讨论】:
-
cxf.547215.n5.nabble.com/… 似乎相关(但没有帮助)。
标签: soap wsdl jax-ws cxf wsdl2java