为什么我得到方法CacheXXXX作为WebMethod公开,但是没有相应的wsdl操作如果wsdl没有改变?

时间:2016-07-21 15:43:27

标签: java soap wsdl cxf jax-ws

我希望你做得很好,

我正在使用jax-ws并且我使用cxf 3.1.6和SOAP UI生成了客户端但是当我调用一个方法时我遇到了这个错误,我到处寻找并且问题看起来好像是wsdl改变,但这不是我的问题我已经生成了客户一千次。顺便说一句,我正在调用的方法不是我得到错误的方法。

服务器:Liberty Profile 8

这是错误跟踪

<uses-permission android:name="android.permission.CALL_PHONE">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
</uses-permission>
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme" >

    <activity
        android:screenOrientation="portrait"
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar" >
        <uses-permission android:name="android.permission.SEND_SMS" />
        <uses-permission android:name="android.permission.CALL_PHONE" />
        <uses-permission android:name="android.permission.CAMERA" />

        <uses-feature android:name="android.hardware.camera" />

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

    <activity android:name="Splashscreen"
    android:label="@string/app_name">

    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

</activity>


    <activity android:name=".Main2Activity" />
    <activity android:name=".Main22Activity" />
    <activity android:name=".Main23Activity" >
    </activity><!-- ATTENTION: This was auto-generated to add Google Play services to your project for
 App Indexing.  See https://g.co/AppIndexing/AndroidStudio for more information. -->
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
</application>

这些是wsdls

第一个

[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

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

<?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>

谢谢你们!

1 个答案:

答案 0 :(得分:3)

我弄清楚了,问题是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

有两种方法可以解决问题,删除操作(这是我采取的操作)或将CacheXXXX放入绑定标记。

我希望这有助于某人