为什么我得到Method CacheXXXX 被暴露为WebMethod,但是没有相应的wsdl 操作如果wsdl 没有改变?

Dan*_*llo 4 java soap wsdl cxf jax-ws

我希望你做得很好,

我正在使用 jax-ws 并且我使用 cxf 3.1.6 和 SOAP UI 生成了客户端,但是当我调用一个方法时出现了这个错误,我到处找,问题似乎 wsdl 已经改变了,但是不是我的问题,我已经生成了数千次客户端。顺便说一句,我正在调用的方法不是我收到错误的方法。

服务器:Liberty Profile 8

这是错误跟踪

[ERROR   ] Error occurred during error handling, give up!
Method CacheXXXX is exposed as WebMethod, but there is no corresponding wsdl operation with name {[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}CacheXXXX in the wsdl:portType{[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}GeographicalDesignStructure
[ERROR   ] SRVE0777E: Excepción lanzada por la clase de aplicación 'org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage:116'
java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: Method CacheXXXX is exposed as WebMethod, but there is no corresponding wsdl operation with name {[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}CacheXXXX in the wsdl:portType{[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}GeographicalDesignStructure
    at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:116)
    at [internal classes]
Caused by: org.apache.cxf.interceptor.Fault: Method CacheXXXX is exposed as WebMethod, but there is no corresponding wsdl operation with name {[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}CacheXXXX in the wsdl:portType{[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}GeographicalDesignStructure
    at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:163)
    ... 1 more
Caused by: javax.xml.ws.WebServiceException: Method CacheXXXX is exposed as WebMethod, but there is no corresponding wsdl operation with name {[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}CacheXXXX in the wsdl:portType{[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}GeographicalDesignStructure
    at com.sun.xml.internal.ws.model.JavaMethodImpl.freeze(JavaMethodImpl.java:367)
    at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.freeze(AbstractSEIModelImpl.java:105)
    at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:320)
    at com.sun.xml.internal.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:85)
    at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:59)
    at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:43)
    at com.sun.xml.internal.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:105)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:875)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:892)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:855)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:435)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:404)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:386)
    at javax.xml.ws.Service.getPort(Service.java:119)
    at com.company.geo.GeographicalDesignStructure.wsdl._1_0._mm.GeographicalDesignStructureService.getGeographicalDesignStructurePort(GeographicalDesignStructureService.java:72)
    at co.com.company.proyecto.integracion.GeographicalDesignStructureWS_BusConsumer.createSoapEndpoint(GeographicalDesignStructureWS_BusConsumer.java:54)
    at co.com.company.proyecto.integracion.GeographicalDesignStructureWS_BusConsumer.<init>(GeographicalDesignStructureWS_BusConsumer.java:37)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:119)
    at [internal classes]
    at co.com.company.proyecto.rest.resources.PaisesResource$Proxy$_$$_WeldClientProxy.getPaises(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.ibm.ws.jaxrs20.server.LibertyJaxRsServerFactoryBean.performInvocation(LibertyJaxRsServerFactoryBean.java:636)
    ... 1 more

[ERROR   ] SRVE0315E: Se ha producido una excepción: java.lang.Throwable: java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: Method CacheXXXX is exposed as WebMethod, but there is no corresponding wsdl operation with name {[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}CacheXXXX in the wsdl:portType{[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}GeographicalDesignStructure
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4937)
    at [internal classes]
Caused by: java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: Method CacheXXXX is exposed as WebMethod, but there is no corresponding wsdl operation with name {[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}CacheXXXX in the wsdl:portType{[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}GeographicalDesignStructure
    at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:116)
    ... 1 more
Caused by: org.apache.cxf.interceptor.Fault: Method CacheXXXX is exposed as WebMethod, but there is no corresponding wsdl operation with name {[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}CacheXXXX in the wsdl:portType{[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}GeographicalDesignStructure
    at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:163)
    ... 1 more
Caused by: javax.xml.ws.WebServiceException: Method CacheXXXX is exposed as WebMethod, but there is no corresponding wsdl operation with name {[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}CacheXXXX in the wsdl:portType{[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}GeographicalDesignStructure
    at com.sun.xml.internal.ws.model.JavaMethodImpl.freeze(JavaMethodImpl.java:367)
    at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.freeze(AbstractSEIModelImpl.java:105)
    at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:320)
    at com.sun.xml.internal.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:85)
    at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:59)
    at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:43)
    at com.sun.xml.internal.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:105)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:875)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:892)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:855)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:435)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:404)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:386)
    at javax.xml.ws.Service.getPort(Service.java:119)
    at com.company.geo.GeographicalDesignStructure.wsdl._1_0._mm.GeographicalDesignStructureService.getGeographicalDesignStructurePort(GeographicalDesignStructureService.java:72)
    at co.com.company.proyecto.integracion.GeographicalDesignStructureWS_BusConsumer.createSoapEndpoint(GeographicalDesignStructureWS_BusConsumer.java:54)
    at co.com.company.proyecto.integracion.GeographicalDesignStructureWS_BusConsumer.<init>(GeographicalDesignStructureWS_BusConsumer.java:37)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:119)
    at [internal classes]
    at co.com.company.proyecto.rest.resources.PaisesResource$Proxy$_$$_WeldClientProxy.getPaises(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.ibm.ws.jaxrs20.server.LibertyJaxRsServerFactoryBean.performInvocation(LibertyJaxRsServerFactoryBean.java:636)
    ... 1 more
Run Code Online (Sandbox Code Playgroud)

这些是 wsdls

第一个

<?xml version="1.0" encoding="UTF-8"?><!--File RemoteFiles/GeographicalDesignStructure_MM_wsGeographicalDesignStructure.wsdl, static library AFPServiciosExportComun_LIB--><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="wsGeographicalDesignStructure_GeographicalDesignStructureHttp_Service" targetNamespace="http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:this="http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/">
  <wsdl:documentation>
    <wsdl:appinfo source="WMQI_APPINFO">
      <MRWSDLAppInfo imported="true">
        <binding hasEncoding="false" imported="true" name="wsGeographicalDesignStructure_GeographicalDesignStructureHttpBinding" originalBindingStyle="document"/>
      </MRWSDLAppInfo>
    </wsdl:appinfo>
  </wsdl:documentation>
  <wsdl:import location="https://direction:32342/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?wsdl=wsdl0" namespace="http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/">
    </wsdl:import>
  <wsdl:binding name="wsGeographicalDesignStructure_GeographicalDesignStructureHttpBinding" type="this:GeographicalDesignStructure">
    <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="paisConsulta">
      <soap12:operation soapAction="http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/GeographicalDesignStructure/paisConsulta"/>
      <wsdl:input name="paisConsultaRequest"> 
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="paisConsultaResponse">
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="regionConsulta">
      <soap12:operation soapAction="http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/GeographicalDesignStructure/regionConsulta"/>
      <wsdl:input name="regionConsultaRequest">
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="regionConsultaResponse">
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="zonaGeograficaConsulta">
      <soap12:operation soapAction="http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/GeographicalDesignStructure/zonaGeograficaConsulta"/>
      <wsdl:input name="zonaGeograficaConsultaRequest">
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="zonaGeograficaConsultaResponse">
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="listaPaisConsulta"> 
      <soap12:operation soapAction="http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/GeographicalDesignStructure/listaPaisConsulta"/>
      <wsdl:input name="listaPaisConsultaRequest">
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="listaPaisConsultaResponse">
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="listaRegionConsulta">
      <soap12:operation soapAction="http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/GeographicalDesignStructure/listaRegionConsulta"/>
      <wsdl:input name="listaRegionConsultaRequest">
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="listaRegionConsultaResponse">
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="listaZonaGeograficaConsulta">
      <soap12:operation soapAction="http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/GeographicalDesignStructure/listaZonaGeograficaConsulta"/>
      <wsdl:input name="listaZonaGeograficaConsultaRequest">
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="listaZonaGeograficaConsultaResponse">
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="GeographicalDesignStructureService">
    <wsdl:port binding="this:wsGeographicalDesignStructure_GeographicalDesignStructureHttpBinding" name="GeographicalDesignStructurePort">
      <soap12:address location="https://direction:32342/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
Run Code Online (Sandbox Code Playgroud)

第二个(位置:[这不是链接] https://direction:32342/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?wsdl=wsdl0

<?xml version="1.0" encoding="UTF-8"?><!--File RemoteFiles/GeographicalDesignStructure.wsdl, static library AFPServiciosExportComun_LIB--><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="GeographicalDesignStructure" targetNamespace="[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/" xmlns:bons1="[this is not a link]http://company.com/GeographicalDesignStructure/paisConsulta/schema/1.0/" xmlns:bons2="[this is not a link]http://company.com/GeographicalDesignStructure/regionConsulta/schema/1.0/" xmlns:tns="[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <wsdl:documentation>
        <wsdl:appinfo source="WMQI_APPINFO">
            <MRWSDLAppInfo imported="true">
                <generatedXSD location="GeographicalDesignStructure_InlineSchema1.xsd"/>
            </MRWSDLAppInfo>
        </wsdl:appinfo>
    </wsdl:documentation>
    <wsdl:types>

        <xsd:schema targetNamespace="[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/" xmlns:bons0="http://company.com/ZonaGeograficaConsultaSalida/schema/V1/" xmlns:bons4="[this is not a link]http://company.com/GeographicalDesignStructure/ZonaGeograficaConsultaEntrada/schema/1/" xmlns:ibmSchExtn="http://www.ibm.com/schema/extensions">
            <xsd:import namespace="[this is not a link]http://company.com/GeographicalDesignStructure/ZonaGeograficaConsultaEntrada/schema/1/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd0"/>
            <xsd:import namespace="http://company.com/ZonaGeograficaConsultaSalida/schema/V1/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd1"/>
            <xsd:import namespace="[this is not a link]http://company.com/GeographicalDesignStructure/regionConsulta/schema/1.0/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd2"/>
            <xsd:import namespace="[this is not a link]http://company.com/GeographicalDesignStructure/regionConsulta/schema/1.0/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd3"/>
            <xsd:import namespace="[this is not a link]http://company.com/GeographicalDesignStructure/paisConsulta/schema/1.0/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd4"/>
            <xsd:import namespace="[this is not a link]http://company.com/GeographicalDesignStructure/paisConsulta/schema/1.0/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd5"/>


            <xsd:import namespace="[this is not a link]http://company.com/GeographicalDesignStructure/ListaPaisConsulta/schema/1.0/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd6"/>
            <xsd:import namespace="[this is not a link]http://company.com/GeographicalDesignStructure/ListaPaisConsulta/schema/1.0/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd7"/>



            <xsd:import namespace="[this is not a link]http://company.com/GeographicalDesignStructure/ListaPaisConsulta/schema/1.0/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd6"/>
    <xsd:import namespace="[this is not a link]http://company.com/GeographicalDesignStructure/ListaPaisConsulta/schema/1.0/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd7"/>

        <xsd:import namespace="[this is not a link]http://company.com/GeographicalDesignStructure/ListaRegionConsulta/schema/1.0/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd8"/>
    <xsd:import namespace="[this is not a link]http://company.com/GeographicalDesignStructure/ListaRegionConsulta/schema/1.0/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd9"/>


        <xsd:import namespace="[this is not a link]http://company.com/GeographicalDesignStructure/ListaZonaGeograficaConsulta/schema/1.0/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd10"/>
    <xsd:import namespace="[this is not a link]http://company.com/GeographicalDesignStructure/ListaZonaGeograficaConsulta/schema/1.0/" schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd11"/>  
            <xsd:include schemaLocation="https://vaxtpmde71:444/GeographicalDesignStructure_MMWeb/sca/wsGeographicalDesignStructure?xsd=xsd12"/>

        </xsd:sch

Dan*_*llo 6

我想通了,问题是操作 CacheXXXX 不在绑定标签上,因此 cxf 提示错误

Method CacheXXXX is exposed as WebMethod, but there is no corresponding     wsdl operation with name {[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}CacheXXXX in the wsdl:portType{[this is not a link]http://company.com/GeographicalDesignStructure/wsdl/1.0/_MM/}GeographicalDesignStructure
Run Code Online (Sandbox Code Playgroud)

解决这个问题有两种选择,删除操作(我就是那个)或者把CacheXXXX放到绑定标签中。

我希望这可以帮助某人