This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Complex type, using axis Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Complex type, using axis" Watch "Complex type, using axis" New topic
Author

Complex type, using axis

Garandi Garandi
Ranch Hand

Joined: Jan 07, 2003
Posts: 192
I am new to Soap, and using version 1.1 of axis, my question is about complex type.
Code for the interface.
public class FamilyInterfaceImpl {
public Family getFamily(){
Family f = new Family("MyFamily", 5);
return f;
}
}
Code for Family Class.
public class Family {

private String familyName;
private int numberOfMembers;

public Family(){}
public Family(String familyName, int numberOfMembers){
this.familyName = familyName;
this.numberOfMembers = numberOfMembers;
}
}
To get the wsdl file I use the following command.
java org.apache.axis.wsdl.Java2WSDL -o family.ws
dl -l"http://localhost:8080/axis/services/soapexample"
-n urn:soapexample -p"soapexample" urn:soapexample soapexample.FamilyInterface
where soapexample is the package name.
Now I have to generate the Server-side Wrapper Code and Stubs for Client Access I use the following command.
java org.apache.axis.wsdl.WSDL2Java -o . -d Session -s -p soapexample.ws family.wsdl
I got 8 file and one of them that I have to overwrite is
package soapexample.ws;
import soapexample.FamilyInterfaceImpl;
public class SoapexampleSoapBindingImpl implements soapexample.ws.FamilyInterface{
FamilyInterfaceImpl f = new FamilyInterfaceImpl();
public soapexample.ws.Family getFamily() throws java.rmi.RemoteException {
return f.getFamily();
}
}
This class does not compile, because the return type is of type soapexample.ws.Family and the method return soapexample.Family.
Question: How to make soap axis work for complex type
Thank you in advance
Garandi
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
It's been a while since I used java2wsdl/wsdl2java but shouldn't
be?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Garandi Garandi
Ranch Hand

Joined: Jan 07, 2003
Posts: 192
Lasse Koskela;
I have it soapexample.ws, because I want the generated code to be in soapexample.ws dir.
Thank you
Garandi
 
 
subject: Complex type, using axis
 
Similar Threads
Is a cycle a bad thing?
using servlet to set bean property and display it in JSP
Error - ; expected
static read-only datatype (class) as Servlet?
Complex type, using axis