users@jax-rpc.java.net

Re: Service Implementation class name

From: Sam <media_fw_at_yahoo.com>
Date: Sun, 31 Mar 2002 19:19:45 -0500

I m still a little fuzzy about this Qname stuff.

The Qname has 2 forms ie
QName(java.lang.String localPart)
QName(java.lang.String namespaceURI, java.lang.String localPart)

In the example you mentioned below,its Hello corresponds to the
local part of the qualified name, and so has a meaning inside
the namespace corresponding to its prefix only.

But if you look at the Service interface, there is a method to
create a call based of the Qname
Call createCall(QName portName) throws ServiceException;

So there has to be some port information in there ??


/Sam




Sang Shin wrote:
>
> Sam wrote:
> >
> > Actually to be more accurate, the createService() method has 2 forms
> >
> > Service createService(QName serviceName)
> > Service createService(java.net.URL wsdlDocumentLocation, QName
> > serviceName)
> >
> > So I guess the end point would be specified using the second form in
> > your case.
>
> Yes, this makes sense.
>
> > The Qname is really a qualified name based on namespaces..and
> > consists of the namespace uri and port.
>
> I am not sure Qname contains port information. DII example
> code of EA2 shows the following:
>
> private static String qnameService = "Hello";
> ...
> Service service =
> factory.createService(new
> QName(qnameService));
>
> So looks like QName is just a name in namespace-prefixed
> form?
>
> -Sang
>
> >
> > The actualy ServiceFactory implementation itself is set using a system
> > property, since the class is abstract.
> >
> > If youre not using DII , you have to know the interface to start with,
> > (which is passed to the getPort() method...
> >
> > /sam
> >
> > Sang Shin wrote:
> > >
> > > > 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
> > > >
> > >
> > > Thanks, Sam. That definitely helps.
> > >
> > > One remaining question on this code is then how to set the target
> > > endpoint address or other properties.
> > >
> > > In order to set the target end point address property, you need a Stub object,
> > > which is why I assume the current HelloWorld sample is written in the way it is
> > > right now. And that was why I posted another question on getPost()
> > > method. That is, the API spect says that the getPost() method with
> > > only service definition interface as a single parameter can return
> > > either Stub or Dynamic proxy object. Unless you know, which
> > > one it is, you would not be able to set the property. (As far as
> > > I can tell, you cannot set property with dynamic proxy object.
> > > I would love to be told otherwise.)
> > >
> > > -Sang Shin
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
>
> --
>
> ---------------------------------------------
> Sang Shin sang.shin_at_sun.com
> Strategic Market Development (781) 442-0531(Work)
> Sun Microsystems, Inc. (781) 993-1136(Fax)
>
> http://www.plurb.com/misc/xml/brandeis-xml-2001.html#bio
> http://www.plurb.com/misc/te/SangSchedule.html
> ---------------------------------------------

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