This discussion is archived
1 Reply Latest reply: Sep 14, 2012 7:08 AM by 945123 RSS

Web Service Classpath vs Servlet Classpath

945123 Newbie
Currently Being Moderated
I need to write a web service that will communicate with another web service and send back an enhanced response.
The first step I took was to write a single servlet application that would communicate with the other web service and display the results.
Here is the doGet from my servlet:
     public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws IOException, ServletException {

          try {
               // set up service input
               int param = 400;

               // invoke the service
               String wsResult = performWebServiceCall(param);

               // send web service output to browser
               PrintWriter out = response.getWriter();
               out.println("<html>" +
                    "\n<head>" +
                    "\n<title>Web Application WS Test</title>"+
                    "</head>" +
                    "<body>" +
                    "<center> <h1>"+
                    wsResult +
                    "</h1> </center>" +
                    "</body>" +

          } catch (Exception ex) {
               PrintWriter out = response.getWriter();
               out.println("An Exception has occured");

This all works.

Now I want to use this from another web service, so I added this method to the servlet:
     public String getWebServiceVal(int num) {
          String wsResult = null;

          try {
               // invoke the service
               wsResult = performWebServiceCall(num);
          } catch (Exception ex) {

          return wsResult;

Created a web service:
     @WebService(name="WebServiceTestWSPortType", serviceName="WebServiceTestWSService")
     public class WebServiceTestWSImpl {

          // By default, all public methods are exposed as Web Services operation
          public String getResponse(int inputNumber) {
               String wsResult = null;
               try {

                    WebAppTestWS tws = new WebAppTestWS();
                    wsResult = tws.getWebServiceVal(inputNumber);

               } catch (Exception ex) {

               return "getResponse:" + wsResult;
          } // end public String getResponse
     } // end public class WebServiceTestWSImpl

But when I try to run the web service test page in weblogic, I get this error:
getResponse:weblogic client internal deployment descriptor bmv/interfaces/L1IdentitySolutions/photos/classes/Service_internaldd.xml not found. Please make sure all clientgen generated files are in the classpath.

After reading this:
I tried moving the single servlet and the web service to one application ear file, thinking that would force them to share the same classloaders, but I still get the same error.
The file is in the classpath when the servlet needs it, but not if I try to use the web service test page in weblogic.

It seems like a simple issue that I just don't understand.
Any help or pointers are greatly appreciated.
Thank you.


  • Correct Answers - 10 points
  • Helpful Answers - 5 points