小编ake*_*rra的帖子

javax.xml.ws.WebServiceException:方法X暴露为WebMethod,但是没有对应的wsdl操作

我正在使用 JAX-WS RI 与第三方 Web 服务 (Adyen) 集成。我已经下载了他们的 wsdl 副本,并jaxws:wsdl2java在我的构建中使用以生成 Web 服务实现源代码。在运行时,当我尝试通过调用我自动生成的支付服务类的 getPort() 方法来设置端口时,我收到以下异常,声称有一个公开的方法,但它不存在于 wsdl portType 元素中:

javax.xml.ws.WebServiceException: Method adjustAuthorisation is exposed as WebMethod, but there is no corresponding wsdl operation with name {http://payment.services.adyen.com}adjustAuthorisation in the wsdl:portType{http://payment.services.adyen.com}PaymentPortType
Run Code Online (Sandbox Code Playgroud)

但是,它存在于 portType 元素中。这是 wsdl 的相关片段:

javax.xml.ws.WebServiceException: Method adjustAuthorisation is exposed as WebMethod, but there is no corresponding wsdl operation with name {http://payment.services.adyen.com}adjustAuthorisation in the wsdl:portType{http://payment.services.adyen.com}PaymentPortType
Run Code Online (Sandbox Code Playgroud)

完整的 wsdl 可以在这里看到:https ://pal-live.adyen.com/pal/servlet/Payment/v30?wsdl

wsdl 包含在具有类路径 /wsdl/Payment.wsdl 的目标 jar 中。我在运行时使用配置类中的代码加载它:

<wsdl:portType name="PaymentPortType">
  <wsdl:operation name="adjustAuthorisation">
    <wsdl:input …
Run Code Online (Sandbox Code Playgroud)

java soap wsdl web-services jax-ws

2
推荐指数
1
解决办法
1937
查看次数

标签 统计

java ×1

jax-ws ×1

soap ×1

web-services ×1

wsdl ×1