You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Se...@wettschereck-partner.de on 2002/12/13 14:21:31 UTC

Deploying the client

Hi there,

I'm using Axis 1.0 and I set up the server. It is running and a normal small
client is able to invoke the methods. Also Serialization/DeSerialization of
JavaBeans works perfectly.
I wrote the client, as it is described in the userguide:

Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));

call.registerTypeMapping(beanClass, beanQName, new
org.apache.axis.encoding.ser.BeanSerializerFactory(beanClass, beanQName),
new 	org.apache.axis.encoding.ser.BeanDeserializerFactory(beanClass,
beanQName));

QName operation = new QName(nameSpace, methodName);
call.setOperationName(operation);
Object returnval = call.invoke(invokeArgs);

Now I want to go further with deployment on the client-side. I think there
are two ways: Using a wsdd-file or by using the wsdl2java-framework. Or did
I misunderstand something? Where can I learn something about that? I read
the articles on apache org about this, but I think they dont describe well.
Because they just dont explain how to really work with the generated files.
I already tried to include a wsdd-file by using class WSDDDocument but I
didnt manage that to the end.
I also generated the files by using wsdl2java, but I dont know how to handle
these files! How to use the Stub, and the BindingImpl, the Locator and
Factory. What do this classes describe?

Every help is appreciated!

Greetings from Hamburg/Germany

Sebastian Beyer

AW: Deploying the client

Posted by Pascal Wissler <wi...@fh-karlsruhe.de>.
Hi Sebastian,

you don't need "deployment on the client-side".
If you want to access your webservice in a static way, you could use the
wsdl2java tool to generate a client-side "static invocation interface"
rather than your implementation of a "dynamic invocation interface". That's
a kind of "proxy" for you to access the webservice. This is useful if you
want to use a really remote web service such as Babelfish (see
www.xmethods.net) - give wsdl2java the URL
http://www.xmethods.net/sd/2001/BabelFishService.wsdl and it generates for
you (static) java classes for calling the service. But you can invoke the
service dynamically, too. Just use your code and give it the right endpoint
URL (f.ex. http://services.xmethods.net:80/perl/soaplite.cgi) and the
required parameters (look in the wsdl-document) and you will get the same
result - but then you have to handle all that type casting and other stuff.
So that's shortly the difference between "static" and "dynamic" invocation
of a web service.

In the user's guide there is a simple example of using the generated static
code:
--------
        // Make a service
        AddressBookService service = new AddressBookServiceLocator();
        // Now use the service to get a stub which implements the SDI.
        AddressBook port = service.getAddressBook();
        // Make the actual call
        Address address = new Address(...);
        port.addEntry("Russell Butek", address);
-------

If you use wsdl2java, you haven't to deal with all the endpoint URL of the
service and that kind of stuff. Then, you access and treat your object as if
it were on your local machine.

Regards.
Pascal.


-----Ursprüngliche Nachricht-----
Von: Sebastian.Beyer@wettschereck-partner.de
[mailto:Sebastian.Beyer@wettschereck-partner.de]
Gesendet: Freitag, 13. Dezember 2002 14:22
An: axis-user@xml.apache.org
Betreff: Deploying the client


Hi there,

I'm using Axis 1.0 and I set up the server. It is running and a normal small
client is able to invoke the methods. Also Serialization/DeSerialization of
JavaBeans works perfectly.
I wrote the client, as it is described in the userguide:

Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));

call.registerTypeMapping(beanClass, beanQName, new
org.apache.axis.encoding.ser.BeanSerializerFactory(beanClass, beanQName),
new 	org.apache.axis.encoding.ser.BeanDeserializerFactory(beanClass,
beanQName));

QName operation = new QName(nameSpace, methodName);
call.setOperationName(operation);
Object returnval = call.invoke(invokeArgs);

Now I want to go further with deployment on the client-side. I think there
are two ways: Using a wsdd-file or by using the wsdl2java-framework. Or did
I misunderstand something? Where can I learn something about that? I read
the articles on apache org about this, but I think they dont describe well.
Because they just dont explain how to really work with the generated files.
I already tried to include a wsdd-file by using class WSDDDocument but I
didnt manage that to the end.
I also generated the files by using wsdl2java, but I dont know how to handle
these files! How to use the Stub, and the BindingImpl, the Locator and
Factory. What do this classes describe?

Every help is appreciated!

Greetings from Hamburg/Germany

Sebastian Beyer