I have been able to get my service deployed on my "server"
tomcat server and can get results when I run a native application, i.e. an
eclipse Run main, where I specify the appropriate classpaths on the run
statement.
I am looking for the "proper" way to integrate it into my
"client" tomcat server, which is a different machine than my "server" tomcat
server. I am trying put together a JSP that will call my axis
client. My axis service serves an array of classes(objects), where each
class/object consists of 3 simple strings. I am not sure where to put
what. That is on my "client" tomcat server where (what directories) do I
put a jsp that can call a flavor of the "test
client" (clientGetMyNames...not shown). I can probably kluge things
up by putting everything in the class path, but that feels
wrong.
Any clues or help would be greatly
appreciated.
Sample JSP page
<% MyNames[] mn;
mn =
clientGetMyNames("test");
int l = mn.length();
for (int i = 0;i mn.length(); i++)
{
out.println(mn[i].firstName+" "+mn[i].lastName);
out.println(mn[i].firstName+" "+mn[i].lastName);
} %>
Details:
the service:
public class MyTestSoapBindingImpl implements
my.test.package.MyTest {
my.test.package.MyNames[] getMyNames(java.lang.String in0) throws java.rmi.RemoteException {
my.test.package.MyNames[] getMyNames(java.lang.String in0) throws java.rmi.RemoteException {
MyNames[] mn = new
MyNames[5];
.... code to fill in the mn array ....
Return mn;
}
}
package my.test.package;
public
class MyNames {
String firstName;
String lastName;
String middleName;
}
The
test client:
public
static void main (String[] args) throws Exception
{
try {
MyTest binding = new MyTestServiceLocator().getMyNames();
MyNames[] value = null;
value = binding.getMyNames("*");
if (value == null)
System.out.println("null results");
else {
System.out.println("length: "+value.length);
for (int i = 0;i < value.length;i++) {
MyNames mn = value[i];
if (mn != null) {
System.out.println("Struct["+i+"]:= first: "+mn.firstName+
", last:"+mn.lastName+
", mid:"+mn.middleName); }
else {
System.out.println("String["+i+"]:= *novalue*");
}
}
}
}
try {
MyTest binding = new MyTestServiceLocator().getMyNames();
MyNames[] value = null;
value = binding.getMyNames("*");
if (value == null)
System.out.println("null results");
else {
System.out.println("length: "+value.length);
for (int i = 0;i < value.length;i++) {
MyNames mn = value[i];
if (mn != null) {
System.out.println("Struct["+i+"]:= first: "+mn.firstName+
", last:"+mn.lastName+
", mid:"+mn.middleName); }
else {
System.out.println("String["+i+"]:= *novalue*");
}
}
}
}
catch (java.rmi.RemoteException re)
{
System.out.println("error"+re.toString());
}
}
System.out.println("error"+re.toString());
}
}
Thank
you
Brad
Taylor