Maybe ignore the below a bit since this image hopefully helps describe
the issue more clearly:

http://www.pastehere.com/?kndvie

(I am managing to get this service to work as 'null' will return from
my Test class, but ultimately what I want Employees being returned).

Thanks again for any help.

<rest of post left below for more detail, but no new comments below>

On 3/29/06, Rick Reumann <[EMAIL PROTECTED]> wrote:
> First off, pardon for this newbie-ish question. I have been googling
> for a long time and I'm also having difficulty finding an answer in
> the archives since I'm not sure how to phrase the questions (and too
> many search results on just WSDL2Java).
>
> Anyway, I was able to follow along with this tutorial on axis that I
> found very helpful
> http://www.onjava.com/pub/a/onjava/2002/06/05/axis.html?page=2 but now
> I want to have my simple service return something more complicated
> than an int so I decided to make a class that would return to me an
> array of Employee objects.
>
> In my com.maintenance package I have:
>
> Employee                          //simple POJO String employeeName;
> int employeeId
> EmployeeMaintenance       //interface
> EmployeeMaintenanceImpl //implemenation with Employee[] getEmployees method
>
> I then used Java2WSDL:
>
> java org.apache.axis.wsdl.Java2WSDL -o employee.wsdl
> -l"http://localhost:8080/axis/services/employee"; -n
> urn:com.maintenance -p"com.maintenance" urn:com.maintenance
> com.maintenance.EmployeeMaintenance
>
> to make my wsdl ( generated code I pasted here
> http://www.pastehere.com/?oivegh ).
>
> Now, following how I did things from the tutorial, I use WSDL2Java to
> create my stub classes. Running this from the classes dir where my
> wsdl is:
>
> java org.apache.axis.wsdl.WSDL2Java -o ..\src -d Session -s -p
> com.maintenance.ws employee.wsdl.
>
> When I look at the generated EmployeeSoapBindingImpl class in my new
> package  com.maintenance.ws, it has a method signature for
> getEmployees that looks like:
>
> public com.maintenance.ws.Employee[] getEmployees()
>     throws java.rmi.RemoteException {
>         return null;
>     }
>
> The problem now is that I want to edit this class like I did in the
> tutorial example so that I can return an Employee[] array that my
> com.maintenance.EmployeeMaintenanceIpml gives me, but for some reason
> the return signature on the SoapBindingImpl is using the
> com.mainteance.ws.Employee class it generated in the com.mainteance.ws
> package (not the package com.maintenance  ).
>
> If rather than try to to build the stub classes to a new package with
> WSDL2Java, I instead run it in the same package where I have my
> initial files (Employee, EmployeeMaintenance, EmployeeMaintenaceImpl),
> I end up getting Employee overwritten by the WSDL2Java command which I
> guess is ok since it really is basically the same file.
>
> In both situations, I'm also sure that this is probably a problem.
> Although my classes all compile, IDEA is letting me know that for the
> getEmployees() method below that
>
> "org.apache.axis.description.typedesc not public or does not allow
> instantiation."
>
> //EmployeeSoapBindingImpl implements com.maintenance.EmployeeMaintenance
> public com.maintenance.Employee[] getEmployees() throws
> java.rmi.RemoteException {
>
>
> I'm also running into problems trying to access getEmployees after I
> deploy it (stand along access connects but getting AxisFault
> NoClassDefFoundError. wsdl is out there and jar with bundled classes
> in axis/web-inf/lib looks ok). But rather than tackle that issue here
> (which might be related to something above), I'd like to make sure I'm
> at least doing things correctly above. I've been googling but I'm
> having trouble finding some good examples that demonstrate returning
> back arrays of objects or collections with axis/web services.
>
> Thanks for any help.
>
> --
> Rick
>


--
Rick

Reply via email to