HTTP/XML Binding with Spring Web services

2019-06-13 17:56发布

问题:

I am working on web services POC. I need to develop a Spring-based web services, that use XML/HTTP i.e. HTTP binding (NOT SOAP/HTTP) so that I can invoke a web-service with URL parameters like the one example described in the WSDL specification especially a GET with query parameters.

I am unable to map the URL's query-parameter to the end-point's (@EndPoint) method parameter.

Is it possible to develop such a web-service (XML/HTTP bound) with spring-ws? Is it possible to invoke such a service with GET request + query string?

Let me know for any such examples/tutorials.

回答1:

Please take a look at this page (http://static.springsource.org/spring/docs/3.0.0.M3/spring-framework-reference/html/ch18s02.html). Assuming that you are using spring 3, I believe you should find some relief there.

Based your question, I assume you already have the DispatcherServlet declared and mapped in web.xml. The trick, then, is to pull out the arguments. The page indicates how to pull arguments from both the URL (which I believe is your goal) and from the request body.

Good luck and write back if anything is unclear.