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 Chris Kelly <ab...@tolstoy.com> on 2004/06/12 09:40:47 UTC

Sharing types between services: update

On 5/13 I asked how to share types between services:
http://www.mail-archive.com/axis-user@xml.apache.org/msg19382.html

I later pointed to a .NET article discussing the same problem:
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/dnservice/html/service07162002.asp

In lieu of a better solution, I solved this partially by hand.

I have a set of bootstrap classes representing the types and services involved. The steps I was 
following are:

1. Compile the bootstrap classes.

2. Use Java2WSDL and WSDL2Java to create Axis' boilerplate .java files and the WSDL files.

3. Compile those axis-created .java files.

However, the WSDL files and the Axis-created .java files have the wrong namespace for the 
common classes.

For instance, Service1 claims CommonClass as its own, as does Service2.

So, what I have to do is add several additional steps between #2 and #3:

A. In each Axis-created .java file, change
    "urn:Service1", "CommonClass"
        to
    "urn:CommonClasses", "CommonClass"
and likewise with the other services and the other common classes.

B. In each WSDL file, add
    xmlns:cmmn="urn:CommonClasses"
to the wsdl:definitions tag at start of <wsdl:types> section.

C. In each WSDL file, replace
    "impl:CommonClass"
with
    "cmmn:CommonClass"

D. In each WSDL file's <wsdl:types> section, replace the current definitions of each 
CommonClass with ones having the correct namespace. (I had previously generated the 
replacement text using Java2WSDL)

E. In each WSDD file, put the common classes in the correct namespace similar to with the 
WSDL files. I also added a type mapping to deal with java:java.lang.Object[] for that 
namespace.

This is not fun, so if there's a better way please let us know, or indicate where to start in the 
Axis utilities' source code would need to be changed to make this automatic.


On 11 Jun 2004 at 15:01, tekberg@midrid.com wrote:

> 
> 
> Chris Kelly (others please ignore), 
> 
> I noticed your message on 5/13 regarding sharing types between services. Did you get a resolution 
> on that? I'm having the same trouble. 
> 
> Tom Ekberg
> Middleberg, Riddle and Gianna
> 214-220-6630