axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NY...@aol.com
Subject Returning an Array over Axis
Date Wed, 14 Jul 2004 16:27:53 GMT
 
I have a very nice Axis Web Service running in which I call a "query"  
function which returns an arbitrarily sized array of type String[].
 
I call the axis implementation file with the following call (Assume all  
setup of service is correct):
 
java.lang.String[] yes_list = (java.lang.String[])handler.query(groupName,  
password, accountName, conditions);
 
handler.query is the function which returns the String[]. Regardless, this  
function, while actually successfully running through Axis, brings about the  
following exception on the local machine:
 
java.lang.ClassCastException
java.lang.ClassCastException
at $Proxy0.query(Unknown Source)
at  
_2._0._0._127.axis.services.adminHandlerServicePort.adminHandlerClient2.main(adminHandler
Client2.java:77)
 
I have checked the mailing list for possible causes but to know avail.  Would 
somebody be kind enough to offer some advice as to how I could stop this  
message from coming up? 
 
Below is my client program:
package placeholder.axis.services.clientHandlerServicePort;
 
public class clientHandlerClient2
{
static String  url     = 
"_http://placeholder/axis/services/clientHandlerServicePort_ (http://placeholder/axis/services/clientHandlerServicePort)
";
static String router  = "_http://placeholder/axis/clientDirect_ 
(http://placeholder/axis/clientDirect) ";
 
    static String service =  "clientDirectService.wsdl";   
 

public static void main(String[]  args)
{
try
{
System.err.println("This Client tests getReport");
 
    ServiceFactory sf =  ServiceFactory.newInstance();
URL u = new URL(router + "/" +  service);
QName  serviceName = new  QName(url,"clientHandlerService");
Service s = sf.createService(u,serviceName);
 
           QName portName  = new QName(url,"clientHandlerServicePort");
 
           List  handlerChain =  
s.getHandlerRegistry().getHandlerChain(portName);
HandlerInfo hi = new  HandlerInfo(LoggingHandler.class,null,null);
handlerChain.add(hi);
 
           //Checking for  proper syntax of  call
if  (args.length!=3)
{
System.err.println("Incorrect  usage of Client. Please use the following:");
System.err.println("clientHandlerClient" + " [Account Name]" +  "   
[Password]" + "    [Conditions]");
}
else
{
System.out.println("Thank You. Processing. . .");
ClientHandler  handler = (ClientHandler) s.getPort(portName, 
ClientHandler.class); 
 
  String accountName   =  args[0];
String password    =  args[1];
String conditions = args[2];

if(s == null)
System.out.println("Service Not Working Properly");
 
  String[] queryList = handler.query(accountName, password,  conditions);
 
  System.out.println("Testing in csv  format");
String format = "csv";
 
  String[] rawQueryList = handler.getQuery(accountName, password,  queryList, 
format);
 
  System.out.println("Finished.");
}
}
catch(Exception  e)
{
System.err.println("Error running  Client:");
System.err.println(e);
e.printStackTrace();
}
}
}
 
I would appreciate any comments on this manner. I have checked the  
axis-mailing list for previous solutions however have found none have been  helpful for 
me to diagnose. 
 
Sincere Thanks,
James Crosson
 


Mime
View raw message