0 Replies Latest reply: Aug 28, 2013 6:58 AM by Ashok_T RSS

    Missing dependant files in generated WSDL using jwsc task

    Ashok_T

      Hi,

      I’m using weblogic 12.1 ant task jwsc to generate the artifacts to create weblogic web service. Following is my JWS file

      @WebService(name="HelloWorld", serviceName="HelloWorld",

      targetNamespace="http://example.org")

      @SOAPBinding(style=SOAPBinding.Style.DOCUMENT,

                    use=SOAPBinding.Use.LITERAL,

                    parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)

      @WLHttpTransport(contextPath="HelloWorld", serviceUri="HelloWorldSvc",

                        portName="HelloWorldPort")

      public class HelloWorld{

      @WebMethod()

      public ServiceResponse sayHello(){

      Employee emp=new Employee();

      emp.setName(“Alex”);

      System.out.println(“Hello ”+emp.getName());

      return new ServiceResponse(emp);

      }

      }

       

      public class ServiceResponse{

      private Object responseObject;

      public ServiceResponse(Object responseObejct){

      this.responseObject=responseObject;

      }

      //getters and setters of response object

      }

      My webMethod sayHello() uses Employee class . After executing jwsc task, the generated WSDL doesn’t contain any reference related to Employee class. If I use clientgen ant task to generate client artifacts from WSDL (generated from jwsc task), client jar will not have Employee class (since WSDL doesn’t have the user-defined class Employee).

      If I try to access the application, it’s throwing NoClassDefFoundError for Employee class.(unknown java type:Employee)

      Ant script :

      <jwsc
             srcdir="src"
             destdir="${dist}">
            <jws file="com/examples/webservices/HelloWorld.java" />
          </jwsc>
       Ant task to generate client artifacts:
       <clientgen
                     wsdl="http://localhost:7001/HelloWorld/HelloWorldSvc?WSDL”
                     destFile="HelloWorld_Client.jar"
                     packageName="com.examples.webservices.client"
                     classpathref="class.path"               
                     type="JAXRPC"/>