有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何将类从wsdl2java创建的默认包排序到不同的包中?

我使用基于wsdl的ApacheCXF创建了一个类。生成类(wsdl2java-impl-pcom.comp.wserv)时,所有生成的类都放在一个包中。 稍后,在Eclipse中,我将编写逻辑并尝试将类排序到包中。除了作为方法中的输入对象的类(例如com.comp.wserv.GetClientByIdResponse getClient中的GetPersonByFIO(GetPersonByName参数))之外,所有类通常都包含在重构包中,这些类负责返回结果。 有人能告诉我问题是什么,以及如何将这些类移动到由com生成的非默认包中吗。公司。wserv

使用alraedy moved classes调用服务时,会发生错误:

在soup ui中:

<faultstring><![CDATA[Unmarshalling Error: unexpected element
(uri:"http://new.webservice.namespace", local:"requestHead"). Expected
elements are
<{}birthday>,<{}name>,<{}surname>,<{}patronymicName>]]></faultstring>

在eclipse控制台中:

 05.02.2015 11:16:30.247 WARN  PhaseInterceptorChain:439 - Interceptor for
 {http://new.webservice.namespace}Service#{http://new.webservice.namespace}
 getClient has thrown exception, unwinding now
 org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected
 element (uri:"http://new.webservice.namespace", local:"requestHead").
 Expected elements are
 <{}birthday>,<{}name>,<{}surname>,<{}patronymicName>

当类位于默认包-com中时。公司。wserv-一切正常


共 (0) 个答案