Search code examples
javaweb-servicessoapjbosswsdl

JBoss - Prevent WSDL splitting


I'm working in a SOAP WS project with JBoss. In order to define SOAP operations, I annotate my Java classes with @Local and @WebService, and my methods with @WebMethod and @WebResult.

The WSDL file is generated automatically by JBoss. I can customize some aspects of the WSDL: https://docs.jboss.org/author/display/JBWS/Published+WSDL+customization

JBoss splits the WSDL in a few files. The 'main' WSDL uses <wsdl:import/> tags to include other files.

My web service is used from within the intranet and externally. The 'internal' hostname of my WS is different to its 'external' hostname. Since JBoss generates full URL links for the WSDL imports, and in order to ensure my WSDL is valid I have to overwrite the hostname of the URL using 'wsdl-host'.

I had to use the external URL in wsdl-host in order to allow both internal e external systems to work. As such, all internal SOAP clients fetch included parts of the WSDL using the external URL. If the external proxy is down for some reason, my internal clients become unable to use the WS since they can't load the WSDL.

Is there a way to prevent JBoss from splitting the WSDL in multiple files, or to force it to use a relative path instead of a full URL inside the <wsdl:import/> tags?


Solution

  • The answer given here prevents the WSDL from splitting by inlining other WSDL files in the main WSDL. I can confirm it works. In order to do that, I just used the same targetNamespace in all @WebService annotations.

    @WebService(targetNamespace="<your namespace here>")