Hello,
I am trying to use this JavaBean object as a message that I am passing
by around by means of a web service:
*** MessageTO.java ***
public class MessageTO implements Serializable {
private String description;
private long id;
private List<String> stuff;
public List<String> getStuff() {
return stuff;
}
public void setStuff(List<String> stuff) {
this.stuff = stuff;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
}
*** end code sample ***
I am trying to do this with Apache CXF 2.1 with the JAX-WS/JAXB
implementation. I can get most of it to work with the dynamic client,
except for the List property "stuff", which doesn't work.
Here is some code that I wrote that prints a list of methods and their
parameters from the MessageTO bean class:
*** code sample from dynamic client ***
URL[] classURLS = { new URL("http://mymessagews/MessageReceiver") };
URLClassLoader classLoader = new URLClassLoader(classURLS);
DynamicClientFactory dcf = DynamicClientFactory.newInstance();
Client client =
dcf.createClient("http://localhost:9000/MessageReceiver?wsdl",
classLoader);
Object message =
Thread.currentThread().getContextClassLoader().loadClass("mymessagews.Me
ssageTO").newInstance();
Method[] methods = message.getClass().getMethods();
for (Method m : methods) {
System.out.print("[ Method name: " + m.getName());
Class[] params = m.getParameterTypes();
for (Class p : params) {
System.out.print("\n\tParam: " + p.getName());
}
System.out.print("\n\tReturn: " +
m.getReturnType().getName());
System.out.println(" ]");
}
*** end code sample ***
*** output of above codesnippet ***
[ Method name: getId
Return: long ]
[ Method name: setDescription
Param: java.lang.String
Return: void ]
[ Method name: setId
Param: long
Return: void ]
[ Method name: getDescription
Return: java.lang.String ]
[ Method name: getStuff
Return: java.util.List ]
[ Method name: wait
Return: void ]
[ Method name: wait
Param: long
Param: int
Return: void ]
[ Method name: wait
Param: long
Return: void ]
[ Method name: hashCode
Return: int ]
[ Method name: getClass
Return: java.lang.Class ]
[ Method name: equals
Param: java.lang.Object
Return: boolean ]
[ Method name: toString
Return: java.lang.String ]
[ Method name: notify
Return: void ]
[ Method name: notifyAll
Return: void ]
*** end output ***
The getter seems to be there, but the setter is not. Is there any kind
of annotation that I can use to get java.util.List to work, so that I
can call the setStuff(List<String> stuff) method with the dynamic JAX-WS
client?
Sadly, aegis is not an option because I can't get that to work with the
dynamic client. I have poured over as much documentation as I could
find, but I couldn't seem to find a way to get this working.
Thanks!
Chris Dunphy
Software Developer, Enterprise Software Development
Shaw Cablesystems G.P. 750-7417 [EMAIL PROTECTED]
Suite 800 630 3rd Avenue SW, Calgary, Alberta, T2P 4L4
try {
succeed();
} catch (const failed_error& e) {
try {
try_again();
}
}