Spring 网络服务模板 URL
Spring WebServiceTemplate URL
在 locationUri“/ws”的 Spring guides a webservice is published 中。
getCountryRequest webservice is consumed using the WebServiceTemplate's marshallSendAndReceive method at "http://localhost:8080/ws/countries".
使用 soapUI 时,我在“http://localhost:8080/ws/”处使用网络服务,并在 SOAP 主体中指定网络服务的名称。
那么 WebServiceTemplate 究竟是如何使用 "countries" 后缀的,它又是如何精确映射到名称为 getCountryRequest 的消息的呢?
回答我自己的问题:
wsdl 正在
发布网络服务
<soap:address location="http://localhost:8080/ws"/>
但是 MessageDispatcherServlet 正在侦听“http://localhost:8080/ws/*”。
因此,URL 之下的任何内容都会传递到 SOAP 并起作用。
我可以使用 http://localhost:8080/ws/(我仍然想知道为什么 WebServiceTemplate 不只使用 WSDL SOAP 地址),http://localhost:8080/ws/countries 或 http://localhost:8080/ws/anythingGoes。
没关系。
在 locationUri“/ws”的 Spring guides a webservice is published 中。 getCountryRequest webservice is consumed using the WebServiceTemplate's marshallSendAndReceive method at "http://localhost:8080/ws/countries".
使用 soapUI 时,我在“http://localhost:8080/ws/”处使用网络服务,并在 SOAP 主体中指定网络服务的名称。
那么 WebServiceTemplate 究竟是如何使用 "countries" 后缀的,它又是如何精确映射到名称为 getCountryRequest 的消息的呢?
回答我自己的问题: wsdl 正在
发布网络服务<soap:address location="http://localhost:8080/ws"/>
但是 MessageDispatcherServlet 正在侦听“http://localhost:8080/ws/*”。 因此,URL 之下的任何内容都会传递到 SOAP 并起作用。
我可以使用 http://localhost:8080/ws/(我仍然想知道为什么 WebServiceTemplate 不只使用 WSDL SOAP 地址),http://localhost:8080/ws/countries 或 http://localhost:8080/ws/anythingGoes。 没关系。