users@jax-rpc.java.net

Re: Service Implementation class name

From: Sam <media_fw_at_yahoo.com>
Date: Sun, 31 Mar 2002 00:07:53 -0500

Hey Sang

I had posted an similar question about this code earlier. My
understanding
is that this is not correct...and thats fine..since this is not
a final release...

first, the cast should not be to the stub, but to the interface
and second the impl should not be directly accessed.

I think the current release of the api supports the ServiceFactory
interface (as per the specs) to do this.

So the eventual code should look like

// pass some properties
Service service = ServiceFactory.newInstance().createService(...);
HelloIF hello= (HelloIF)service.getPort(HelloIF.class);
hello.sayHello();


Hope this helps

/sam




Sang Shin wrote:
>
> The following is code snippet from the HelloWorld
> tutorial showing the stub-based programming model
>
> HelloIF_Stub stub = (HelloIF_Stub)(new HelloWorld_Impl().getHelloIF());
> stub._setProperty( javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,
> args[0]);
>
> I have two questions on this code.
>
> (1) Here I assume HelloWorld_Impl is the service
> specific implementation of generated Service interface.
> Now the spec says (in section 4.3.11 Generated Service),
> the name of the generated service interface is the
> name attribute of the corresponding wsdl:service element,
> which is HelloWorld in this case. Now in the above
> code, we assume the implementation class of HelloWorld
> service interface is HelloWorld_Impl.class. Now my question
> is can we assume it since the spec does not say any
> naming pattern between service interface and its
> implementation.
>
> (2) Similar question regarding to getHelloIF() method
> call. In the same section, the method call that needs
> to be used to get stub instance should be
>
> get<Name_of_wsdl:port>
>
> And in this wsdl document of Helloworld example,
> it should be getHelloIFPort(). In the above example,
> it is getHelloIF(). Any explanation for why this
> discrepency?
>
> Thanks
>
> -Sang Shin

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com