简体   繁体   English

Jax-WS和注释

[英]Jax-WS and annotations

We currently have this 我们目前有这个

@WebServiceRef(wsdlLocation = "META-INF/wsdl/localhost_8080/SwitchWSService/SwitchWebService.wsdl")
private SwitchWSService switchWS;

Can't we point to the real web service and it still work. 我们不能指向真正的Web服务,它仍然可以工作。

@WebServiceRef(wsdlLocation = "www.web.com/SwitchWSService/SwitchWebService.wsdl")
private SwitchWSService switchWS;

Chapter 7.9 of the JAX-WS 2.0 spec says: JAX-WS 2.0 规范的 7.9章说:

wsdlLocation: wsdl位置:

A URL pointing to the location of the WSDL document for the service being referred to. 指向所引用服务的WSDL文档位置的URL。
... ...
The wsdlLocation element, if present, overrides theWSDL location information specified in the WebService annotation of the referenced generated service class. wsdlLocation元素(如果存在)将覆盖在引用的生成的服务类的WebService批注中指定的WSDL位置信息。

So your approach is basically OK. 因此,您的方法基本上可以。 But strictly speaking 但严格来说

www.web.com/SwitchWSService/SwitchWebService.wsdl www.web.com/SwitchWSService/SwitchWebService.wsdl

is not an URL since an URL or URI in general must start with a scheme (see RFC 3986 ). 不是URL,因为URL或URI通常必须以scheme开头(请参阅RFC 3986 )。

Let me see, you want your WSDL to be published onto some external URL and then give clients that URL to retrieve WSDL from. 让我看看,您希望将WSDL发布到某个外部URL上,然后为该URL提供给客户端以从中检索WSDL。 That means your service won't be the source of WSDL download, and thus you don't need to provide ANY wsdlLocation for it. 这意味着您的服务将不会成为WSDL下载的源,因此您不需要为其提供任何wsdlLocation。

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

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