axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brett G. Bisyak" <Bre...@CapitalStream.com>
Subject How do I pass User Defined objects in Axis ?
Date Fri, 26 Jul 2002 21:17:56 GMT
How do I pass User Defined objects in Axis ?

1. I create the following simple interface where the GuitarBody class exists
and is compiled successfully, and is passed as an argument to the
createGuitar method, along with an int (IGuitar.java ) shown below:

package guitars;

import guitars.GuitarBody;

public interface IGuitar {

    public void createGuitar( GuitarBody aBody, int nCount );

}

2. I create WSDL ( attached ) based on this interface using
org.apache.axis.wsdl.Java2WSDL.

3. I create an implementation of this interface as shown below (
IGuitarImpl.java )

package guitars;

import guitars.GuitarBody;

public class IGuitarImpl implements guitars.IGuitar {

    public void createGuitar( GuitarBody aBody, int nCount ) {

        if ( aBody == null ) {
             System.out.println("Passed a null guitar body. Only Eddie Van
Halen can use one of these");
             return;
        } else {
             System.out.println("We are a go for creating the guitar...");
        } 

        System.out.println("Creating Guitar now...");
    }

}

4. I run org.apache.axis.wsdl.WSDL2Java and it creates the associated client
stubs, etc into the guitars\ws directory without error.

5. I edit the guitars\ws\GuitarsSoapBindingImpl.java and add the text shown
in << >> below...
/**
 * GuitarsSoapBindingImpl.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis WSDL2Java emitter.
 */

package guitars.ws;

<<import guitars.IGuitarImpl;>>

public class GuitarsSoapBindingImpl implements guitars.ws.IGuitar{

    <<IGuitarImpl aGuitar = new IGuitarImpl();>>


    public void createGuitar(guitars.ws.GuitarBody in0, int in1) throws
java.rmi.RemoteException {
    
        <<aGuitar.createGuitar( in0, in1 );>>

    }

}

6. Heres the problem. When I try to compile using javac guitars\ws\*.java I
get the following error

guitars\ws\GuitarsSoapBindingImpl.java:19:
createGuitar(guitars.GuitarBody,int)
in guitars.IGuitarImpl cannot be applied to (guitars.ws.GuitarBody,int)
        aGuitar.createGuitar( in0, in1 );


which makes sense since guitars.ws.GuitarBody is not the same as
guitars.GuitarBody. 

So HOW DO I PASS USER DEFINED OBJECTS LIKE THIS ????

Thanks for your help in advance !!!

Brett G. Bisyak
206-548-1726


Mime
View raw message