I have used Tomcat4.0, Axis(i dont remember the version), Jdk1.4, MYSql database
I am implementing web services which takes an object & returns another object.
Problem is that I am unable to retrieve the return object properly. It is not even giving any errors.
I have 5 files. I have attached the files & I think that the problem is either in the file ProjectClient or in deploy.wsdd
It is giving details about the items in the database properly in Admin.java (the one that is shown in output document).But when it receives the object in a variable named result, it is printing null values.
Can you please tell me where I am going wrong.
ProjectClient.java
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import org.apache.axis.AxisFault;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.utils.Options;
import java.io.*;
import java.lang.*;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
public class ProjectClient
{
public static void main(String [] args) throws Exception
{
DataInputStream in = new DataInputStream(System.in);
String username=new String();
String password = new String();
Options options = new Options(args);
Admin admin = new Admin();
DisplayItems result = new DisplayItems();
System.out.print("Enter admin username : ");
username = in.readLine();
admin.setUserName(username);
System.out.print("\nEnter admin password : ");
password = in.readLine();
admin.setPassword(password);
Service service = new Service();
Call call = (Call) service.createCall();
QName qn = new QName( "urn:BeanService", "Admin" );
QName qn1 = new QName( "urn:BeanService1", "DisplayItems" );
call.registerTypeMapping(Admin.class, qn,
new org.apache.axis.encoding.ser.BeanSerializerFactory(Admin.class, qn),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(Admin.class, qn));
call.registerTypeMapping(DisplayItems.class, qn1,
new org.apache.axis.encoding.ser.BeanSerializerFactory(DisplayItems.class, qn1),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(DisplayItems.class, qn1));
try
{
call.setTargetEndpointAddress( new java.net.URL(options.getURL()) );
call.setOperationName( new QName("OrderProject", "processProject") );
call.addParameter( "arg1", qn, ParameterMode.IN );
call.setReturnType( qn1 );
result = (DisplayItems) call.invoke( new Object[] { admin } );
}
catch (Exception e)
{
System.out.println("Error : " + e.getMessage());
}
for(int i=0;i<5; i++)
{
System.out.println(result.ItemName[i]+" "+result.ThresholdQuantity[i]+" "+result.QuantityRemaining[i]+" " +result.WholesalerID[i]);
}
System.out.println(result);
}
}
deploy.wsdd
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="OrderProject" provider="java:RPC">
<parameter name="className" value="ProjectBeanService"/>
<parameter name="allowedMethods" value="*"/>
<beanMapping qname="myNS:Admin" xmlns:myNS="urn:BeanService"
languageSpecificType="java:Admin"/>
<beanMapping qname="myNS

isplayItems" xmlns:myNS="urn:BeanService1"
languageSpecificType="java

isplayItems"/>
</service>
</deployment>