我正在使用 Spring 2.5.6、Spring-ws 1.5.9 和 Stripes 1.5.6。
我有一个正在运行的 Web 服务,它使用 xml 解析等来实现。我不会详细介绍这一点,因为我认为这不是问题所在。
我正在开发一个新的 ws,发现此页面非常有用: http://jeromebulanadi.wordpress.com/2010/02/25/basic-spring-web-service-tutorial-from-contract-to-security/
...所以使用上面作为实现新 ws 的示例(该链接包含一个对象编组/解组的示例,而不是您自己执行所有 xml)。
当连接到 ws 时,我收到此错误消息(来自 Web 服务模板 - 也在 Spring 中):
org.springframework.ws.client.WebServiceTransportException: Not Found [404]
at org.springframework.ws.client.core.WebServiceTemplate.handleError(WebServiceTemplate.java:627)
at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:551)
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:351)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:345)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:337)
调用源自我的模板,我这样调用:
GetSignalsByCprRequest request = new GetSignalsByCprRequest();
request.setCpr(new BigInteger(cpr));
GetSignalsByCprResponse response = (GetSignalsByCprResponse) getWebServiceTemplate().marshalSendAndReceive(request);
更大的堆栈跟踪是:
21-09-2011 11:16:35 INFO com.mydomain.ws.client.SignalsTemplateImpl - Entering getSignals(..) in SignalsTemplateImpl
--- ENTER TEMPLATE ---
21-09-2011 11:16:35 TRACE net.sourceforge.stripes.controller.StripesFilter - Intercepting request to URL: /salesoverview-ws-war/services
21-09-2011 11:16:35 DEBUG net.sourceforge.stripes.controller.StripesFilter - LocalePicker selected locale: da_DK
21-09-2011 11:16:35 DEBUG net.sourceforge.stripes.controller.StripesFilter - LocalePicker did not pick a character encoding, using default: UTF-8
21-09-2011 11:16:35 DEBUG net.sourceforge.stripes.controller.UrlBindingFactory - No URL binding matches /salesoverview-ws-war/services
21-09-2011 11:16:35 DEBUG net.sourceforge.stripes.controller.UrlBindingFactory - No URL binding matches /salesoverview-ws-war/services
org.springframework.ws.client.WebServiceTransportException: Not Found [404]
at org.springframework.ws.client.core.WebServiceTemplate.handleError(WebServiceTemplate.java:627)
at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:551)
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:351)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:345)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:337)
“--- 输入模板 --- " 打印在创建的请求/响应的正上方。错误发生在GetSignalsByCprResponse response = (GetSignalsByCprResponse) getWebServiceTemplate().marshalSendAndReceive(request);
我很茫然——我不知道该去哪里。我有一个轻微的想法,肥皂消息不包含名称空间,或者 Stripes 捕获请求 - 基于堆栈跟踪...Stripes 使用 DynamicMappingFilter,从而将 url 模式映射到/* - 这可能是问题所在。
非常感谢任何想法或指示!
I'm using Spring 2.5.6, Spring-ws 1.5.9, and Stripes 1.5.6.
I have a working webservice which was implementing using xml parsing etc. I'll not go into details about this, as I don't think this is the problem.
I'm working on a new ws and found this page quite useful: http://jeromebulanadi.wordpress.com/2010/02/25/basic-spring-web-service-tutorial-from-contract-to-security/
...so using the above as example to implement a new ws (the link contains an example with marshalling/unmarshalling of objects instead of doing all the xml yourself).
When connecting to the ws I get this error message (from a webservice template - also in Spring):
org.springframework.ws.client.WebServiceTransportException: Not Found [404]
at org.springframework.ws.client.core.WebServiceTemplate.handleError(WebServiceTemplate.java:627)
at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:551)
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:351)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:345)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:337)
The call originates from my template and I'm calling like this:
GetSignalsByCprRequest request = new GetSignalsByCprRequest();
request.setCpr(new BigInteger(cpr));
GetSignalsByCprResponse response = (GetSignalsByCprResponse) getWebServiceTemplate().marshalSendAndReceive(request);
A larger stack trace is:
21-09-2011 11:16:35 INFO com.mydomain.ws.client.SignalsTemplateImpl - Entering getSignals(..) in SignalsTemplateImpl
--- ENTER TEMPLATE ---
21-09-2011 11:16:35 TRACE net.sourceforge.stripes.controller.StripesFilter - Intercepting request to URL: /salesoverview-ws-war/services
21-09-2011 11:16:35 DEBUG net.sourceforge.stripes.controller.StripesFilter - LocalePicker selected locale: da_DK
21-09-2011 11:16:35 DEBUG net.sourceforge.stripes.controller.StripesFilter - LocalePicker did not pick a character encoding, using default: UTF-8
21-09-2011 11:16:35 DEBUG net.sourceforge.stripes.controller.UrlBindingFactory - No URL binding matches /salesoverview-ws-war/services
21-09-2011 11:16:35 DEBUG net.sourceforge.stripes.controller.UrlBindingFactory - No URL binding matches /salesoverview-ws-war/services
org.springframework.ws.client.WebServiceTransportException: Not Found [404]
at org.springframework.ws.client.core.WebServiceTemplate.handleError(WebServiceTemplate.java:627)
at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:551)
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:351)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:345)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:337)
"--- ENTER TEMPLATE ---" is printed just above the request/response is created. The error happens in GetSignalsByCprResponse response = (GetSignalsByCprResponse) getWebServiceTemplate().marshalSendAndReceive(request);
I'm quite blank - I have no idea as where to go. I have a slight idea that either the soap message doesn't contain the namespace OR that Stripes catches the request - based on the stack trace... Stripes is using DynamicMappingFilter, thus mapping the url-pattern to /* - which might be the problem.
Any ideas or pointers is much appreciated!
发布评论
评论(1)
似乎您的 Stripes servlet 正在处理您希望由 Spring-ws servlet 处理的 URL,该 Spring-ws servlet 将处理您的 Web 服务请求。您可能需要检查 web.xml 中的
。Seems that your Stripes servlet is handling URL’s you want to be handled by the Spring-ws servlet that will handle your web service requests. You might want to check your
<url-pattern>
in your web.xml.