users@jax-rpc.java.net

Client creation from WSDL file

From: Luc Plaetinck <luc_plaetinck_at_COMPUWARE.COM>
Date: Mon, 03 Jun 2002 16:19:27 -0600

Hi,

I implemented the sample service "hello" and matching client with the jwsdp-1_0-ea2 toolkit . Everything is running fine.
Now I want to start from the generated WSDL file to build a client for this service.
I adjusted the config.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration
   xmlns="http://java.sun.com/jax-rpc-ri/xrpcc-config">
   <wsdl name="HelloWorldService"
      location="http://localhost:8080/jaxrpc-hello/server/HelloWorldService.wsdl"
 packageName="hello">
   </wsdl>
</configuration>

The corresponding wsdl file has following entry:
...
  <service name="HelloWorld">
    <port name="HelloIFPort" binding="tns:HelloIFBinding">
      <soap:address location="http://localhost:8080/jaxrpc-hello/jaxrpc/HelloIF"/></port></service></definitions>

Running the xprcc tool to generate the stubs and then running ant compile-client gives following error:
    [javac] Compiling 1 source file to E:\jwsdp-1_0-ea2\docs\tutorial\examples\j
axrpc\hello\build\client
    [javac] E:\jwsdp-1_0-ea2\docs\tutorial\examples\jaxrpc\hello\HelloClient.jav
a:10: cannot resolve symbol
    [javac] symbol : method getHelloIF ()
    [javac] location: class hello.HelloWorld_Impl
    [javac] (HelloIF_Stub)(new HelloWorld_Impl().getHelloIF());
    [javac] ^
    [javac] 1 error

XRPCC seems to generate the classes HelloIFPort_Stub and HelloIFPort_Impl instead of HelloIF_Stub and HelloIF_Impl as expected.

When I change the <port name> entry to <port name="HelloIF", so that the wsdl file is as follows:
...
  <service name="HelloWorld">
    <port name="HelloIF" binding="tns:HelloIFBinding">
      <soap:address location="http://localhost:8080/jaxrpc-hello/jaxrpc/HelloIF"/></port></service></definitions>

everything works fine. Is this a bug in the xrpcc tool for generating the stubs from WSDL?

Thanks,
Luc