Search code examples
javaweb-serviceswebsphere

javax.jws.WebService : Could not generate specified XSD file


I have two EARs running on WebSphere.

In each one I have the same WebService, implemented as follows:

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;

import org.springframework.stereotype.Component;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;

@WebService(serviceName = "GestionXService")
@SOAPBinding(style = Style.RPC)
@Component(value = "gestionXService")
public class GestionXService extends SpringBeanAutowiringSupport {

    @WebMethod(operationName = "searchClient")
    @WebResult(name = "ListCustomerEGBean")
    public CustomerEGBean searchClient(@WebParam(name = "nd") final String nd) {
        return null;
    }

}

In both web applications, the WSDL is generated correctly:

from https://localhost:4443/webapp1/GestionXService?WSDL and https://localhost:4443/GestionXService?WSDL and has the same contents.

But the problem is that I can't generate the XSD from one of the two webapps (the one with context /), it says:

Error: Generic Error.

Could not generate specified XSD file!

(In the other it works fine)

My question is:

  • I'd like to put a break point somewhere and see what's happening when the XSD is being generated. Where should I put it?
  • Where can I look for the differences between the two webapps? To see what prevents one of them from generating the XSD.
  • Any other lead?

Thank you.


Solution

    1. You can't put a breakpoint at the place where the XSD is being generated. From the code you quoted, it appears that you're relying on WebSphere generating the WSDL and XSDs for you; this kind of generation is done deep in WebSphere's core for which you don't have source-level access.
    2. The only possible way for you to get a glimpse on what's wrong is to turn on JAX-WS tracing within WebSphere. Edit the server's trace settings and use com.ibm.ws.websvcs.*=all as a trace string. The JAX-WS traces often reveal the root cause for problems that you wouldn't see in the normal log files.