6 Replies Latest reply on Feb 20, 2015 5:41 AM by Lubos Racansky

    @WebServiceRef and WSDL located on classpath

    Tomaz Zupan Newbie

      On JBoss 7.1.0.CR1b I try to use @WebServiceRef annotation for WebServiceClient wtih WSDL located on classpath. As the WebService doesn't have  WSDL accessible on the web I included WSDL file in the WebServiceClient JAR. This WebServiceClient classes were generated with wsconsume utility tool with option wsdlLocation=classpath:path/to/webservice.wsdl. And as I can see on CXF this classpath: "protocol" is supported as the code of generated Service class is changed to load the WSDL from a classpath:

       

      @WebServiceClient(name = "MBB", 
                        wsdlLocation = "classpath:mbb.wsdl",
                        targetNamespace = "http://schemas.simobil.si/ServiceContracts/ApplicationIntegration/MBB/Mbb.serviceagent") 
      public class MBB extends Service {
      
      
          public final static URL WSDL_LOCATION;
      
      
          public final static QName SERVICE = new QName("http://schemas.simobil.si/ServiceContracts/ApplicationIntegration/MBB/Mbb.serviceagent", "MBB");
          public final static QName MBBPortTypeEndpoint1 = new QName("http://schemas.simobil.si/ServiceContracts/ApplicationIntegration/MBB/Mbb.serviceagent", "MBBPortTypeEndpoint1");
          static {
              URL url = MBB.class.getClassLoader().getResource("mbb.wsdl");
              if (url == null) {
                  java.util.logging.Logger.getLogger(MBB.class.getName())
                      .log(java.util.logging.Level.INFO, 
                           "Can not initialize the default wsdl from {0}", "classpath:mbb.wsdl");
              }       
              WSDL_LOCATION = url;
          }
      
      

       

      But when I use a @WebServiceRef annotation to reference this WS Client I got an exception that the WSDL can not be found:

       

       javax.xml.ws.WebServiceException: Cannot find wsdl-override: classpath:mbb.wsdl
      

       

       

      Is there any way to use WSDL on classpath?