找不到端点映射

时间:2010-08-26 12:53:14

标签: java web-services soap spring-ws

您好我创建了我的第一个网络服务。它工作正常,但现在我需要解决一些特殊情况。第一种情况在这里提到Spring Web Services - Exception Skipping ExceptionResolver但是没有解决方案可以帮助我。

第二种情况是客户端发送正确的SOAP消息但在命名空间中出错例如发送给我: xmlns:urn="urn:org:samples:spring:ws:schemas:calculatorblabla" 但正确的命名空间是xmlns:urn =“urn1:org:samples:spring:ws:schemas:calculator”。因此,当客户端向我发送带有错误名称空间的消息时,他没有收到消息,他只是犯了错误:

<html><head><title>SpringSource tc Server/6.0.20.C - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The requested resource () is not available.</u></p><HR size="1" noshade="noshade"><h3>SpringSource tc Server/6.0.20.C</h3></body></html>

我用SoapUI测试了这些情况

服务器接收消息但没有发送任何响应,因为他找不到正确的端点[2010-08-26 14:38:19] Accepting incoming [org.springframework.ws.transport.http.HttpServletConnection@1700f3d] at [http://localhost:8080/calculator] [2010-08-26 14:38:19] Received request [SaajSoapMessage {urn:org:samples:spring:ws:schemas:calculatorblabla}calculatorRequest] [2010-08-26 14:38:19] Looking up endpoint for [{urn:org:samples:spring:ws:schemas:calculatorblabla}calculatorRequest] [2010-08-26 14:38:19] Endpoint mapping [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping@ae2481] has no mapping for request [2010-08-26 14:38:19] No endpoint mapping found for [SaajSoapMessage {urn:org:samples:spring:ws:schemas:calculatorblabla}calculatorRequest] [2010-08-26 14:38:19] Successfully completed request

所以我需要当客户端向我发送带有错误命名空间的消息时,它会发送一些类似的错误消息,当他发送xt时,它与xsd无效。 感谢任何帮助,对不起,我的英语非常糟糕

1 个答案:

答案 0 :(得分:0)

默认情况下,Spring-WS 1.5.x使用org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter使用org.springframework.ws.transport.http.HttpServletConnection发送WebServiceMessagesHttpServletConnectionEndpointAwareWebServiceConnection,它定义了在没有找到端点时处理案例的方法。默认实现将servlet响应代码设置为404.

如果您需要做其他事情,则需要掌握Spring-WS的内容,因为WebServiceConnection中的WebServiceMessageReceiverHandlerAdapter无法配置。我不知道另一个HandlerAdapter允许您配置WebServiceConnection,因此您可能需要编写一个。{/ p>