axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suran Jayathilaka <su...@wso2.com>
Subject Re: Problem building available services
Date Wed, 03 Oct 2007 09:29:42 GMT
Ana Belén Antón Gironés wrote:
>  
> Hello Suran, 
>
> My service makes use of several packages and classes and interfaces. It has
> a complex structure. So, I have created the following folder structure:
>
> C:\Program Files\Apache Software Foundation\Tomcat
> 5.5\webapps\axis2\WEB-INF\services\
> 	- MyService
> 		-eu
> 			- myproject
> 				- serviceone
> 					-myservice
> 						-MyService.class
> 						-MyService.java
> 						-Otherclass.class [other
> object which MyService needs]
> 						-Otherclass.java
> 					-folder1[other folders with the code
> of the rest of classes and interfaces ]
> 						-Class11.class
> 						-Class11.java
> 						-Class12.class
> 						-Class12.java
> 					-folder2
> 						-Class21.class
> 						-Class21.java
> 						- ...
> 					- ...	
> 		-lib [libs used by my application] 
> 			-commons-codec-1.3.jar
> 			-commons-httpclient-3.0.1.jar
> 			-commons-logging-api-1.1.jar
> 			-dom4j-1.6.1.jar
> 			-jaxen-1.1-beta-5.jar
> 			- ...
> 		-META-INF
> 			-services.xml
> 		-[several .xml files needed by my service]
>
> Note that the "eu" folder is a full copy of the "src" folder created in my
> workspace. 
>
> My "MyService.java" is:
>
> package eu.myproject.serviceone.myservice;
>
> import java.io.IOException;
> import java.net.MalformedURLException;
> import java.util.ArrayList;
> import java.util.Iterator;
> import java.util.List;
>
> import org.dom4j.Document;
> import org.dom4j.DocumentException;
> import org.dom4j.DocumentHelper;
> import org.dom4j.Node;
>
> import eu.myproject.serviceone.exceptions.AGSCException;
> import eu.myproject.serviceone.exceptions.AGSException;
> import eu.myproject.serviceone.exceptions.AGSNFException;
> import eu.myproject.serviceone.folder1.Class11;
> import eu.myproject.serviceone.folder2.Class21;
> import eu.myproject.serviceone.folder3.Class31;
> import eu.myproject.serviceone.folder3.Class32;
>
> public class MyService implements Class32{
> 	
> 	public List<Class21> getAllClassObj(List<Class31> constraintsList)
> throws AGSNFException {
> 		List<Class21> ClassObjList = new ArrayList<Class21>();
> 		//code..
>        	return ClassObjList ;
> 	}
>
>
> 	//
> ----------------------------------------------------------------------	
> 	
> 	public Class21 getClassObj(String id) throws AGSNFException{
> 		//Class21 is an interface and Class21 is the object which
> implements the interface
> 		Class21Object classobj = null;
> 		//code...
> 		return classobj;
> 	}
> 	
> 	//
> ----------------------------------------------------------------------
> 	
> 	private boolean method1(List<Class31> constraints){
> 		// code...
> 		return true;
> 	}
> 	//
> ----------------------------------------------------------------------
> 	private String method2(List<Class31> constraints){	
> 		String Xpath = "";
> 		//code...
> 		return Xpath;	
> 	}
> 	
> 	//
> ----------------------------------------------------------------------
> 	
> 	private String method3(Integer id){
> 		String path = "";
> 		//code...
> 		return path;
> 	}
>
> }
>
> Please, note that this class implements an interface (called Class32..) and
> my service offers only two available operations.
>
> I hope you understand the aforementioned complex structure and code. I
> haven't copy the full class code because it is very long!
>
>
> Finally, my "services.xml" file is:
>
> <service name="MyService" scope="application">
>     <description>
>        MyService
>     </description>
>     <messageReceivers>
>         <messageReceiver 
>             mep="http://www.w3.org/2004/08/wsdl/in-only"
>     class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
>         <messageReceiver
>             mep="http://www.w3.org/2004/08/wsdl/in-out"
>     class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
>     </messageReceivers>
>     <parameter name="ServiceClass">
>         eu.myproject.serviceone.myservice.MyService
>     </parameter>
> </service>
>
>  
> Regarding the .aar file...I work with Eclipse and I have installed a plugin
> to generate .aar files ("Axis Service Archiver 1.0.0"). I have added the
> plugin "Axis2 Coden Wizard 1.2.0" too. Using the first tool Eclipse
> generates an .aar file, but it doesn't work when I upload the service. I
> could explain step to step what I do for that.
>
> Thank you very much for your interest in it and I hope you can help me
> because I am very lost. Kind regards,
>
> Ana Belén.
>
>
>   
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>   
Hi Ana,

First of all, I see that your class uses generics. Please note that 
Axis2 only supports simple-types, arrays and beans. Since Axis2 is 
JDK1.4 compliant, generics are not supported.
So what you can do is replace your genericised List arguments with arrays.
e.g.: replace List<Class32> with Class32[].

Your service folder structure looks ok to me. When the eclipse plugin 
has created the .aar file, check whether it contains the intended structure.
(rename the .aar file to .zip and you'll be able to deal with it using 
any zip tool, or extract the .aar file somewhere and take a look at the 
extracted structure, or do "jar tvf" on the archive).

Hope it helps.
Suran.




Mime
View raw message