users@jax-rpc.java.net

Jax-rpc question (was posted to list before)

From: Steve Robenalt <steve_at_webcircuit.com>
Date: Mon, 03 Mar 2003 15:32:15 -0800

Hi Doug,

I posted a question to the list a couple of weeks ago and never saw a
reply, so I thought you might be able to help me. I've read up on my
problem and checked the samples and a variety of sources, some of which
lead me to suspect it's an easy one, but no examples of how it is done
and no replies to the list so far.

My problem pertains to passing an instance of a java class as a method
argument or receiving one as a reply. I have such an application and
have had problems with class compatibility in this case. The class I use
when defining the interface is in a different package than the service
itself. I build the service, deploy it to the server, and generate
client-side code based on the wsdl file for the server.

In the client-side code generation step, the generated code defines new,
equivalent classes that are used in the client code and are identical to
the originals, but have the same package as the service and the client.
These generated classes are translated across the service correctly, but
they still cause problems for my overall packaging strategy.

To put the problem in more concrete terms, I have the following:

interface class a.MyIF with method void f(MyClass arg);
implementation class a.MyImpl with implementation of above method.
client class a.MyClient which calls the above method via static binding.

MyClass is defined as part of package b, rather than package a.

After the wsdeploy and wscompile steps, there are a set of classes
generated, including a new a.MyClass, which is used in all of the
generated code.

If I force the package of the class via the interface declaration, I
wind up with two classes b.MyClass, and a.MyClass and the client will
only interoperate with a.MyClass.

My problems with this are twofold: first, I would like to have methods
as part of MyClass and these methods will not be part of the generated
b.MyClass; second, I need to define a third package c with another web
service c.MySecondIF with method g(Myclass arg) taking the same class as
an argument.

Can this problem be fixed via a custome type mapping? Most of the
examples I have seen do not cover this problem. The examples I have
found in books skirt the issue by illustrating a single package which
contains all classes used in the system including the client, server,
interface, and data class.

If a custom type mapping won't do it, is there some other configuration
I can use for this?

Thanks for any help you can offer.

- Steve Robenalt