You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by psm041 <ps...@ig.com.br> on 2005/01/06 17:08:50 UTC

Importing packages

Hi all, im new to the list (and to axis too) and i have one question to 
start... 

I`ve published the following service just for test and all went well 
(Sum.jws): 


public class Sum { 
   public int sum(int valor1, int valor2) { 
      return valor1 + valor2; 
   } 
} 


Now i want to publish another service that uses the one above, here is the 
code (Sum6.jws): 


import org.apache.axis.client.Service; 
import org.apache.axis.client.Call; 

public class Sum6 { 
	public int sum(int valor1) 
	{ 
		String local = "http://localhost:8081/axis/Sum.jws"; 
		Call call = (Call) new Service().createCall(); 
		call.setTargetEndpointAddress(local); 
		call.setOperationName("sum"); 
		Object[] param = new Object[]{new Integer(valor1), Integer(6)} 
		Integer ret = (Integer)call.invoke(param); 
		return ret; 
	} 
} 


...and i've got the following from axis (while generating wsdl): 


AXIS error 

Sorry, something seems to have gone wrong... here are the details: 

Fault - Error while compiling:  
/usr/local/jakarta-tomcat-4.1.27/webapps/axis/WEB-INF/jwsClasses/Soma6.java 

AxisFault 
 faultCode: {http://xml.apache.org/axis/}Server.compileError 
 faultSubcode: 
 faultString: Error while compiling:  
/usr/local/jakarta-tomcat-4.1.27/webapps/axis/WEB-INF/jwsClasses/Soma6.java 
 faultActor: 
 faultNode: 
 faultDetail: 
	{}Errors: Error compiling 
/usr/local/jakarta-tomcat-4.1.27/webapps/axis/WEB-INF/jwsClasses/Soma6.java: 
Line 0, column 0: could not parse error message:  Note: sun.tools.javac.Main 
has been deprecated. 
/usr/local/jakarta-tomcat-4.1.27/webapps/axis/WEB-INF/jwsClasses/Soma6.java:10: 
Exception javax.xml.rpc.ServiceException must be caught, or it must be 
declared in the throws clause of this method. 
		Call call = (Call) new Service().createCall(); 
		                                           ^ 

Line 14, column 7:  Method Integer(int) not found in class Soma6. 
Line 15, column 36:  Exception java.rmi.RemoteException must be caught, or 
it must be declared in the throws clause of this method. 
Line 16, column 2:  Incompatible type for return. Can't convert 
java.lang.Integer to int. 
Line 0, column 0: 
4 errors, 1 warning 

ps: i've put axis.jar file in 
/usr/local/jakarta-tomcat-4.1.27/webapps/axis/WEB-INF/classes/ directory for 
the imports, right? 

Any help will be REALLY appreciated :) 
Paulo Sérgio.