136.7. 访问 Web 服务
要调用 http://foo.com/bar
的 Web 服务,只需定义一个路由:
from("direct:example").to("spring-ws:http://foo.com/bar")
发送消息:
template.requestBody("direct:example", "<foobar xmlns=\"http://foo.com\"><msg>test message</msg></foobar>");
如果您正在调用 SOAP 服务,则不得包含 SOAP 标签。Spring-WS 执行 XML-to-SOAP marshaling。