0 Replies Latest reply on Jun 15, 2005 5:20 AM by Stefano Sabbadin

    Wsdl generation on client side

    Stefano Sabbadin Newbie

      Hi all,

      I'm using:
      - jboss 4.0.1
      - jwsdp 1.5

      I want to realize the tutorial example in http://wiki.jboss.org/wiki/Wiki.jsp?page=WSRPCClientStepByStep.

      I have created a war file for the web service, and deployed on jboss on http://localhost:8080/pc/Organization.
      Then I have created a war file for the web client application, which contains the web service stubs, a factory for lookup, and a jsp page that uses the factory and then call the webservice.

      The factory is:

      public class FactoryOrganizationService {
       public static Organization getProxy() {
       try {
       Context iniCtx = new InitialContext();
       OrganizationService service = (OrganizationService) iniCtx
       return service.getOrganizationPort();
       } catch (Exception e) {
       e.printStackTrace(); //debug
       return null;

      The web.xml is

      <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

      And I need OrganizationService.wsdl.

      So I have opened the browser to http://localhost:8080/pc/Organization?wsdl and I copied the xml definition to a file named OrganizationService.wsdl.


      1) Can I generate the OrganizationService.wsdl automatically from http://localhost:8080/pc/Organization?wsdl ? When I copy from browser to a text editor I need to delete manually "-" characters. Example:

      <?xml version="1.0" encoding="UTF-8" ?>
      - <definitions name="OrganizationService"
      - <types>
      - <schema targetNamespace="http://org.jboss.test.webservice/samples/types"

      2) is there a solution to avoid wsdl generation on client side? Maybe I need to change web.xml deleting the <wsdl-file> tag, but it doesn't function...maybe I change the factory method getProxy()...Any ideas?
      I tried to use
      Stub stub = (Stub)(new OrganizationService_Impl().getOrganizationPort());
       stub._setProperty( javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,
       Organization pc = (Organization)stub;

      but I have the following error:
      cannot access com.sun.xml.rpc.client.BasicService
      file com\sun\xml\rpc\client\BasicService.class not found
      Stub stub = (Stub)(new OrganizationService_Impl().getOrganizationPort());

      And if I copy the jar that contains BasicService class from jwsdp1.5 to jboss/server/default/lib I have a new class not found on another class, and so. I don't know which jars I must copy in jboss server lib directory.