4 Replies Latest reply on Aug 17, 2010 1:47 AM by Anand Jayaraman

    WSDL path being used by generated CXF code

    Anand Jayaraman Newbie



      On running org.apache.cxf.tools.wsdlto.WSDLToJava it generates CXF stubs.


      Code snippet of the generated code is shown below:


      @WebServiceClient(name = "ExampleServiceCXFServiceService",
                        wsdlLocation = "file:D:/CVSMSTR8/Head/hello.wsdl",
                        targetNamespace = "http://ws.example.diamond.perotsystems.com/")
      public class ExampleServiceCXFServiceService extends Service {

          public final static URL WSDL_LOCATION;
          public final static QName SERVICE = new QName("http://ws.example.diamond.perotsystems.com/", "ExampleServiceCXFServiceService");
          public final static QName ExampleServiceCXFServicePort = new QName("http://ws.example.diamond.perotsystems.com/", "ExampleServiceCXFServicePort");
          static {
              URL url = null;
              try {
                  url = new URL("file:D:/CVSMSTR8/Head/hello.wsdl");
              } catch (MalformedURLException e) {
                  System.err.println("Can not initialize the default wsdl from D:/CVSMSTR8/Head/hello.wsdl");
                  // e.printStackTrace();
              WSDL_LOCATION = url;



      The WSDL location is referenced in the generated code.


      Is there a way to generate CXF stubs which do not use WSDL location?