简体   繁体   English

为什么在WSDL中有SOAP位置?

[英]Why should we have SOAP location in WSDL?

Spring Framework Web服务的soap:address/soap:address location=uri /最佳实践?

The soap:address location is necessary in the WSDL file because the WSDL file is a contract for providing a service. 在WSDL文件中,soap:address位置是必需的,因为WSDL文件是提供服务的合同。 A good contract should be clear on what the service offers as well as where the service can be found and accessed. 应当就服务提供的内容以及在何处可以找到和访问服务达成清晰的合同。 The provider of a service should be committed through the WSDL contract to offer the service in the specified location. 服务的提供者应通过WSDL合同承诺在指定位置提供服务。 That's why the location is required according to the w3 website. 这就是为什么根据w3网站需要该位置的原因。

If you are using Spring to create a web service you access specify the location in a property file to easily change it later. 如果使用Spring创建Web服务,则可以访问属性文件中的指定位置,以便以后轻松更改。 If you are using Spring to create a client that uses a web service I found that the soap:address location in the wsdl has no effect. 如果您使用Spring创建使用Web服务的客户端,我发现wsdl中的soap:address位置无效。 Spring web service client ignore it and uses the value in the defaultUri property of org.springframework.ws.client.core.WebServiceTemplate. Spring Web服务客户端忽略它,并使用org.springframework.ws.client.core.WebServiceTemplate的defaultUri属性中的值。

我猜想原因是WSDL没有绑定到SOAP,因此在使用它时,必须明确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM