【问题标题】:No adapter for endpoint端点没有适配器
【发布时间】:2017-09-20 05:42:42
【问题描述】:

我有一个带有@Endpoint 注释的Java 类。在我尝试添加另一个参数之前它工作正常 - MessageContext 并且我得到“没有端点适配器”

在下面查看我的方法签名:

@PayloadRoot(localPart = "PolicyNewBusinessQuoteRequest", namespace = TARGET_NAMESPACE)
  @ResponsePayload
  public PolicyNewBusinessQuoteResponseDocument processQuoteRequest(@RequestPayload PolicyNewBusinessQuoteRequestDocument requestDocument, MessageContext messageContext) throws Exception {
}

【问题讨论】:

  • 你能补充一些细节吗?它的肥皂?你能显示请求类吗

标签: java spring endpoint


【解决方案1】:

您的数据不足以回答这个问题。

但大多数时候,

java.lang.IllegalStateException: No adapter for endpoint […]: 
Is your endpoint annotated with @Endpoint, 
or does it implement a supported interface like MessageHandler or PayloadEndpoint?

这个异常可以用

解决

在您的请求和响应类中添加@XmlRootElement 注释。

【讨论】:

  • 感谢您的回复。在我添加另一个参数 - MessageContext 对象之前,一切正常。
  • 当我添加 org.springframework.ws.context.MessageContext 参数时,我开始收到此错误。添加附加参数时有什么需要做的。 Spring docs 说它是为 MessageContext 自动启用的
【解决方案2】:

【讨论】:

  • 很好,请接受您的回答,以便此问题移至已回答部分
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-22
相关资源
最近更新 更多