axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sagara Gunathunga <sagara.gunathu...@gmail.com>
Subject Re: New to Axis2 - Unable to see service
Date Mon, 19 Oct 2009 19:35:20 GMT
Hi

I'm not sure I have realized you approach here , I assume you have two
applications (axis2 and Axis2WebWs  ) in your server deploy folder. If
my assumption is correct ,   Within the scope of your application
server both axis2 and  Axis2WebWs  are two separate web applications.
You cant's expect define web service in one application (Axis2WebWs)
and it will show in a page that belong to the another web application
( listServices page of Axis2 application) . Above two applications use
two different Axis2 repositories . Admin console of  axis2 is only
display services of it's own repository.

These are some of my suggestions here.

1.) If you want to use Axis2 admin console,  package your web service
as .aar and deploy using the console If you have done correctly this
will bring your service details to console and you don't need  another
web application for this  approach. If you will  face faulty service
exception with this,  you can send the sample codes  of AAR to the
list and someone will help out.


2.) If you do not want to depend on admin console and want to package
as EAR content , my suggestion is first try to create your service as
a WAR content, You can refer this [1] . If you get success with this,
you can include the WAR content in your EAR package exactly like  you
placing any other .war content under EAR package. But you cant see
your services in the console. (Personally I haven't work with EAR and
Axis2 but Hope this will work )


3.) May be you can try to integrate those Admin console features to
your EAR file . But again I haven't try for that ,  better to try out.


[1] - http://www.developer.com/open/article.php/3777111/Embedding-Apache-Axis2-into-Existing-Applications.htm

Thanks,

On Mon, Oct 19, 2009 at 11:50 PM, mule_user <sgho@aol.com> wrote:
>
> I changed the directory structure as:
>
> Axis2WebWs
> |
> ----src
> |       |
> |       ----org.ncc.server
> |                               |
> |                                ----Calculator.java
> |                                ----ICalculator.java
> |
> ---WebContent
> |
> ----META-INF
> |
> ----WEB-INF
>      |
>      -----lib (has all the jar folders from Axis2)
>      |
>      ----web.xml
>     |
>     ----services
>           |
>           ----Calculator
>                 |
>                 ----META-INF
>                      |
>                       ----services.xml
>
> In other words, I removed services.xml from WebContent\META-INF. Instead, I
> created a new directory under WEB-INF as services\Calculator\META-INF and
> placed the same services.xml in that.
>
> After that, I re-deployed the EAR file. NO luck either. I see the same
> result as faulty services. I can only see getVersion, does not see
> Calculator.
>
>
>
>
>
>
> mule_user wrote:
>>
>> I am new to Axis2, but familiar with Axis1. I am trying to see the service
>> using the Axis2 admin console. I am unable to see the service. That can
>> mean many things. Any suggestion will be appreciated. Following are the
>> steps I ahve taken:
>>
>> 1. Deployed axis2.war. As such, I can successfully see
>> http://localhost:9081/axis2/services/listServices But obviously, the new
>> service created by me is not in that list.
>>
>> 2. Created a Java web project and deployed it in the same server where
>> axis2 admin application was deployed. The structure of the Java project
>> is:
>>
>> Axis2WebWs
>> |
>> ----src
>> |       |
>> |       ----org.ncc.server
>> |                               |
>> |                                ----Calculator.java
>> |                                ----ICalculator.java
>> |
>> ---WebContent
>> |
>> ----META-INF
>> |    |
>> |    ----services.xml
>> |
>> ----WEB-INF
>>       |
>>       -----lib (has all the jar folders from Axis2)
>>       |
>>       ----web.xml
>>
>> ////////////
>> package org.ncc.server;
>>
>> public class Calculator implements ICalculator{
>>        public int add(int a, int b) {
>>                return a + b;
>>       }
>> }
>> /////////////
>> package org.ncc.server;
>>
>> public interface ICalculator {
>>       int add (int x, int y);
>> }
>> //////////////////
>> <service name="Calculator" scope="application">
>>     <description>
>>         Simple Calculator Service
>>     </description>
>>
>>     <parameter name="ServiceClass">org.ncc.server.Calculator</parameter>
>>
>>     <operation name="add">
>>         <messageReceiver
>> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>>     </operation>
>>
>> </service>
>> ////////////////
>> <?xml version="1.0" encoding="UTF-8"?>
>> <web-app id="WebApp_ID" version="2.4"
>> xmlns="http://java.sun.com/xml/ns/j2ee"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>>       <display-name>
>>       Axis2WebWs</display-name>
>>       <servlet>
>>               <display-name>Apache-Axis Servlet</display-name>
>>               <servlet-name>AxisServlet</servlet-name>
>>
>> <servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
>>               <load-on-startup>1</load-on-startup>
>>       </servlet>
>>
>>       <servlet-mapping>
>>               <servlet-name>AxisServlet</servlet-name>
>>               <url-pattern>/servlet/AxisServlet</url-pattern>
>>       </servlet-mapping>
>>       <servlet-mapping>
>>               <servlet-name>AxisServlet</servlet-name>
>>               <url-pattern>*.jws</url-pattern>
>>       </servlet-mapping>
>>       <servlet-mapping>
>>               <servlet-name>AxisServlet</servlet-name>
>>               <url-pattern>/services/*</url-pattern>
>>       </servlet-mapping>
>> </web-app>
>> //////////////////////////
>> I create a EAR file for this project and deploy it. Axis2WebWs gets
>> deployed successfully. I am not (nor do want to) use Axis2 Admin console
>> for deploy. I was hoping that the url below will show my service add:
>> http://localhost:9081/axis2/services/listServices
>>
>> Instead it only lists getVersion method from Axis2 Admin console.
>>
>> What am I missing?
>>
>> Even though I do not want to deploy it using Axis2 Admin console, but for
>> troubleshooting purposes, I changed ear file to aar file and wanted to
>> upload that aar file using Axis2 Admin console. When I looked for the
>> service, it mentioned faulty service. I said that cannot find
>> services.xml.
>>
>> Any suggestion will be appreciated. Again, I want to deploy the EAR file
>> using Admin console of the app server only (will be scripted eventually),
>> instead of relying on Axis2 Admin console.
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/New-to-Axis2---Unable-to-see-service-tp25928644p25963099.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://people.apache.org/~sagara/

Mime
View raw message