CXF 2.7给出common.ToolException:非唯一的身体部位错误 [英] CXF 2.7 give common.ToolException: Non unique body parts error
本文介绍了CXF 2.7给出common.ToolException:非唯一的身体部位错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Apache CXF从WSDL开发Web服务,但出现错误。
I am using Apache CXF for develop webservice from WSDL but its give an error.
org.apache.cxf.tools.common.ToolException: Non unique body parts, operation [ getStation ] and operation [ getStationStatus ] in binding {urn:schemas.nema.org:evse:dir:xsd}StationDirectoryPort have the same body block: {urn:schemas.nema.org:evse:dir:xsd}StationSearchParameter
WSI-BP-1.0 R2716 violation: Operation 'getStation' soapBody MUST NOT have namespace attribute
at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:139)
at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:204)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:204)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:164)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:412)
at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
请帮助我识别CXF或WSDL中的问题。如果WSDL错误,那么我该如何解决此问题。
Please help me to identify issue its in CXF or in WSDL.if error in WSDL then how can I resolve this issue.
推荐答案
每个操作的元素名称必须唯一。
element name for each operation must be unique.
<xsd:element name="StationSearchParameter" type="tns:StationSearchParameterType"/>
再声明一个相同类型的元素
declare one more element with same type
<xsd:element name="StationSearchStatusParameter" type="tns:StationSearchParameterType"/>
并在wsdl中使用此元素
and use this element in your wsdl
like
<wsdl:message name="getStationStatusRequestMsg">
<wsdl:part name="input" element="tnsx:StationSearchStatusParameter"/>
</wsdl:message>
它必须可以正常工作。
这篇关于CXF 2.7给出common.ToolException:非唯一的身体部位错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文