“无法解开操作”;使用Apache CXF [英] "Could not unwrap Operation" with Apache CXF

查看:117
本文介绍了“无法解开操作”;使用Apache CXF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用cxf部署Web服务。



我使用以下代码声明我的endPoint

 < jaxws:端点
xmlns:wsdl = com_documentation_service_standardfeatures_application_webservices_uc51_webserviceServer_WebServiceSearch
id = webServiceSearchEndpoint
Implementor =#com.documentation.service .standardfeatures.application.webservices.uc51_webserviceServer.WebServiceSearch
wsdlLocation = classpath:resources / schemas / wsdl / com_documentation_service_standardfeatures_application_webservices_uc51_webserviceServer_WebServiceSearch.wsdl
endpointName = wsdl:WebServiceSearchName
com_documentation_service_standardfeatures_application_webservices_uc51_webserviceServer_WebServiceSearch
address = http:// localhost:8888 / service2
/>

我的wsdl看起来像这样

  [...] 
< wsdl:types>
< schema targetNamespace = com_documentation_service_standardfeatures_application_webservices_uc51_webserviceServer_WebServiceSearch_types xmlns = http://www.w3.org/2001/XMLSchema
xmlns:team51 = com_documentation_business_standardfeatures_application_webservices_ucent_gtent_Client_Client
< import namespace = com_documentation_business_standardfeatures_application_webservices_uc51_webserviceClient_entities_Team51 schemaLocation = classpath:resources / schemas / xsd / com_documentation_business_standardfeatures_application_webservices_uc51_webserviceClient_entities_Team51&xsd /
< element name = team51 type = team51:team51 />
< element name = anyType type = xsd:anyType />
< element name = string type = xsd:string />
< element name = integer type = xsd:integer />
< element name = float type = xsd:float />
< element name = long type = xsd:long />
< element name = dateTime type = xsd:dateTime />
< element name = boolean type = xsd:boolean />
< element name = collection type = types:collectionType />
< complexType name = collectionType>
< sequence>
< element type = xsd:anyType minOccurs = 0 maxOccurs = unbounded name = element />
< / sequence>
< / complexType>
< / schema>
< / wsdl:types>

< wsdl:message name = team51FindByID>
< wsdl:part name = id element = types:long />
< / wsdl:message>
< wsdl:message name = team51FindByIDResponse>
< wsdl:part name = return element = types:team51 />
< / wsdl:message>

< wsdl:portType name = WebServiceSearch>
< wsdl:operation name = team51FindByID>
< wsdl:input name = team51FindByID message = team51FindByID>
< / wsdl:input>
< wsdl:output name = team51FindByIDResponse message = team51FindByIDResponse>
< / wsdl:output>
< / wsdl:operation>
< / wsdl:portType>
[...]

运行tomcat服务器时,始终出现以下消息。 / p>

 注意:无法解开操作{documentation_service_standardfeatures_application_webservices_uc51_webserviceServer_WebServiceSearch} team51FindByID以匹配方法 public abstract Type1 team51FindByID(java.lang.Long) 

org.apache.cxf.endpoint.ServerImpl initDestination

我的问题是什么配置?

解决方案

定义操作的名称空间不正确。错误恰恰是发现名称空间不正确的类,因此它找不到它并且无法解包。



修复名称空间应该可以使您正确地创建WSDL。 / p>

I'm trying to deploy a webservice using cxf.

I use the following code to declare my endPoint

<jaxws:endpoint
xmlns:wsdl="com_documentation_service_standardfeatures_application_webservices_uc51_webserviceServer_WebServiceSearch"  
 id="webServiceSearchEndpoint"
    implementor="#com.documentation.service.standardfeatures.application.webservices.uc51_webserviceServer.WebServiceSearch"
    wsdlLocation="classpath:resources/schemas/wsdl/com_documentation_service_standardfeatures_application_webservices_uc51_webserviceServer_WebServiceSearch.wsdl"
    endpointName="wsdl:WebServiceSearchPort"
    serviceName="wsdl:com_documentation_service_standardfeatures_application_webservices_uc51_webserviceServer_WebServiceSearch"
    address="http://localhost:8888/service2"
    />

And my wsdl looks like that

[...]
<wsdl:types>
<schema targetNamespace="com_documentation_service_standardfeatures_application_webservices_uc51_webserviceServer_WebServiceSearch_types" xmlns="http://www.w3.org/2001/XMLSchema"
 xmlns:team51="com_documentation_business_standardfeatures_application_webservices_uc51_webserviceClient_entities_Team51"    >
    <import namespace="com_documentation_business_standardfeatures_application_webservices_uc51_webserviceClient_entities_Team51" schemaLocation="classpath:resources/schemas/xsd/com_documentation_business_standardfeatures_application_webservices_uc51_webserviceClient_entities_Team51.xsd"/>
    <element name="team51" type="team51:team51"/>
    <element name="anyType" type="xsd:anyType"/>
    <element name="string" type="xsd:string"/>
    <element name="integer" type="xsd:integer"/>
    <element name="float" type="xsd:float"/>
    <element name="long" type="xsd:long"/>
    <element name="dateTime" type="xsd:dateTime"/>
    <element name="boolean" type="xsd:boolean"/>        
    <element name="collection" type="types:collectionType"/>        
    <complexType name="collectionType">
        <sequence>
            <element type="xsd:anyType" minOccurs="0" maxOccurs="unbounded" name="element"/>
        </sequence>
    </complexType>  
</schema>
</wsdl:types>

  <wsdl:message name="team51FindByID">
    <wsdl:part name="id" element="types:long"/>
  </wsdl:message>
  <wsdl:message name="team51FindByIDResponse">
       <wsdl:part name="return" element="types:team51"/>
  </wsdl:message>

  <wsdl:portType name="WebServiceSearch">  
   <wsdl:operation name="team51FindByID">
     <wsdl:input name="team51FindByID" message="team51FindByID">
   </wsdl:input>
    <wsdl:output name="team51FindByIDResponse" message="team51FindByIDResponse">
   </wsdl:output>
   </wsdl:operation>    
 </wsdl:portType>  
[...]

When running tomcat server, the following message always appears.

 ATTENTION: Could not unwrap Operation {documentation_service_standardfeatures_application_webservices_uc51_webserviceServer_WebServiceSearch}team51FindByID to match method "public abstract Type1 team51FindByID(java.lang.Long)"

 org.apache.cxf.endpoint.ServerImpl initDestination

What's wrong with my configuration ?

解决方案

The namespace where you define the Operation is not correct. Error is precisely uncovering on what class the namespace is not correct, so it can not find it and can not unwrap.

Fixing the namespace should enable you proper WSDL creation.

这篇关于“无法解开操作”;使用Apache CXF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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