views:

70

answers:

2

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.

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

Let me see, you want your WSDL to be published onto some external URL and then give clients that URL to retrieve WSDL from. That means your service won't be the source of WSDL download, and thus you don't need to provide ANY wsdlLocation for it.

Vladimir Dyuzhev
+3  A: 

Chapter 7.9 of the JAX-WS 2.0 spec says:

wsdlLocation:

A URL pointing to the location of the WSDL document for the service being referred to.
...
The wsdlLocation element, if present, overrides theWSDL location information specified in the WebService annotation of the referenced generated service class.

So your approach is basically OK. But strictly speaking

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).

wierob
Yes, you happen to be right. I've deleted my answer.
Vineet Reynolds