Announcement Announcement Module
No announcement yet.
How prevent Spring-WS Client from requesting the remote WSDL? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How prevent Spring-WS Client from requesting the remote WSDL?

    I've written a Spring-WS client app. For some reason the app requests the WSDL from the server when I construct my implementation.

    public class PoleService extends
    public PoleService(URL wsdlLocation, QName serviceName) {
    super(wsdlLocation, serviceName);

    This causes problems because:

    1. If the remote WSDL isn't quite the same as the WSDL used to build the client app (e.g. because the client app is older than the server app and some new methods have been added to the latest server API) an error is generated that prevents the client app from proceeding.

    2. The client app insists on using the port number specified in the dynamically retrieved WSDL rather than the one I programatically told it to use (i.e. the port number it successfully fetched the WSDL from). This is a problem if communicating via a 'man in the middle' monitoring tool such as TcpTrace.

    3. It's a big WSDL and so there are performance implications. My client app is a command line program and sometimes the time taken to process the WSDL far exceeds the time then taken to do the useful work.

    (Regarding point 1 -- In case anyone is thinking it is no bad thing if Spring-WS Client refuses to proceed on detecting that the WSDL has changed: We take care to only ever update the server API in a backwards compatible fashion, so that older clients can continue to operate.)

    The WSDL appears to get requested somewhere in viceDelegate(), which is called in the following constructor, L55:

    protected Service( wsdlDocumentLocation, QName serviceName) {
    delegate = Provider.provider().createServiceDelegate(wsdlDocu mentLocation,

    First preference: Is it possible to prevent the remote WSDL being requested on start-up?

    Second best: As a workaround, I suppose I could capture the WSDL as it was when the client was built and embed it in the client. Then, is it possible to make the client refer to this local copy instead of fetching the remote WSDL? Note, however, Spring-WS Client would still need to use the server and port info provided by the user rather than the soap:address from the WSDL.