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 jayachandra <ja...@gmail.com> on 2005/02/28 07:27:20 UTC

[Axis2] problems with new web service deployment

Hi Axis 2 Community!

I wanted to deploy in Axis2 a small webservice whose implementation
class is myEchoExample (similar as Echo.java provided under test
directory)

The class code looks as simple as 

package examples;
import org.apache.axis.om.OMElement;
public class myEchoExample {
    public myEchoExample() {
    }
    public void echoVoid() {
        System.out.println("echo Service Called");
    }
    public OMElement echoOMElement(OMElement omEle) {
        omEle.setLocalName(omEle.getLocalName() + "Response");
        return omEle;
    }
    public String echoString(String in) {
        return in;
    }
    public int echoInt(int in) {
        return in;
    }
}

I compiled this and also wrote a meta-inf/service.xml as follows

<service provider="org.apache.axis.providers.RawXMLProvider"
style="rpc" contextPath="services">
  <java:implementation class="examples.myEchoExample"
xmlns:java="http://ws.apache.org/axis2/deployment/java" />
  <operation name="echoVoid" /> 
  <operation name="echoOMElement" /> 
  <operation name="echoString" /> 
  <operation name="echoInt" /> 
</service>

I then packaged the class file and service.xml (retaining their
directory structure) into a myEchoExample.jar and dumped it inside
web-inf/services directory (I even tried the upload.jsp web
interface). But I don't seem to find myEchoExample listed as a
service. Did I miss something.
Plz kindly help.

Thanks in advance,
Jayachandra

Re: [Axis2] problems with new web service deployment

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi jaya,
Hmmmm...Your code seems to be slightly problamatic to me. 

You have the RAWXmlProvider as the provider. but you do have methods
that return strings and ints as the output. The problem is
RawXMLProvider doesn't know how to do the conversion!!!!. So you will
need to write a custom provider for that.
Have a look at the samples and particularly at the
encoding.sample.EchoProvider class. You will get the idea.
have a look at the user guide and the step by step building of the samples.

BTW your deployment problem may not be directly tied with this one.
Enable the logging by setting the log level to INFO or something.
The log4j.properties file can be found at the axis2/web-inf/classes directory.
Check the axis.log file (which would be created in the tomcats bin
directory if you are using tomcat) to see what the problem is

On Mon, 28 Feb 2005 11:57:20 +0530, jayachandra <ja...@gmail.com> wrote:
> Hi Axis 2 Community!
> 
> I wanted to deploy in Axis2 a small webservice whose implementation
> class is myEchoExample (similar as Echo.java provided under test
> directory)
> 
> The class code looks as simple as
> 
> package examples;
> import org.apache.axis.om.OMElement;
> public class myEchoExample {
>    public myEchoExample() {
>    }
>    public void echoVoid() {
>        System.out.println("echo Service Called");
>    }
>    public OMElement echoOMElement(OMElement omEle) {
>        omEle.setLocalName(omEle.getLocalName() + "Response");
>        return omEle;
>    }
>    public String echoString(String in) {
>        return in;
>    }
>    public int echoInt(int in) {
>        return in;
>    }
> }
> 
> I compiled this and also wrote a meta-inf/service.xml as follows
> 
> <service provider="org.apache.axis.providers.RawXMLProvider"
> style="rpc" contextPath="services">
>  <java:implementation class="examples.myEchoExample"
> xmlns:java="http://ws.apache.org/axis2/deployment/java" />
>  <operation name="echoVoid" />
>  <operation name="echoOMElement" />
>  <operation name="echoString" />
>  <operation name="echoInt" />
> </service>
> 
> I then packaged the class file and service.xml (retaining their
> directory structure) into a myEchoExample.jar and dumped it inside
> web-inf/services directory (I even tried the upload.jsp web
> interface). But I don't seem to find myEchoExample listed as a
> service. Did I miss something.
> Plz kindly help.
> 
> Thanks in advance,
> Jayachandra
> 


-- 
Ajith Ranabahu

Re: [Axis2] problems with new web service deployment

Posted by jayachandra <ja...@gmail.com>.
Thanx guys!
It turned out to be META-INF naming. The reason why I used meta-inf
(lowercase) was that I opened a sample jar  (sample1.jar) in winzip
and saw the folder of service.xml displayed by winzip to be in lower
case. May be that's the winzip custom style.
Ajith! thanks for the explanatory notes.

Thanks
Jayachandra

On Mon, 28 Feb 2005 13:34:37 +0600, Deepal Jayasinghe
<de...@opensource.lk> wrote:
> Hi;
> I have doubt about your meta-inf  , it should be META-INF not meta-inf , try
> to make that changes and try again.
> You can also use the tool that we have provide to build service jar file
> using that you can build the jar file and you can replace your service.xml
> with the one default service.xml.
> 
> 
> Deepal
> 
> ----- Original Message -----
> From: "jayachandra" <ja...@gmail.com>
> To: <ax...@ws.apache.org>
> Sent: Monday, February 28, 2005 12:27 PM
> Subject: [Axis2] problems with new web service deployment
> 
> > Hi Axis 2 Community!
> >
> > I wanted to deploy in Axis2 a small webservice whose implementation
> > class is myEchoExample (similar as Echo.java provided under test
> > directory)
> >
> > The class code looks as simple as
> >
> > package examples;
> > import org.apache.axis.om.OMElement;
> > public class myEchoExample {
> >    public myEchoExample() {
> >    }
> >    public void echoVoid() {
> >        System.out.println("echo Service Called");
> >    }
> >    public OMElement echoOMElement(OMElement omEle) {
> >        omEle.setLocalName(omEle.getLocalName() + "Response");
> >        return omEle;
> >    }
> >    public String echoString(String in) {
> >        return in;
> >    }
> >    public int echoInt(int in) {
> >        return in;
> >    }
> > }
> >
> > I compiled this and also wrote a meta-inf/service.xml as follows
> >
> > <service provider="org.apache.axis.providers.RawXMLProvider"
> > style="rpc" contextPath="services">
> >  <java:implementation class="examples.myEchoExample"
> > xmlns:java="http://ws.apache.org/axis2/deployment/java" />
> >  <operation name="echoVoid" />
> >  <operation name="echoOMElement" />
> >  <operation name="echoString" />
> >  <operation name="echoInt" />
> > </service>
> >
> > I then packaged the class file and service.xml (retaining their
> > directory structure) into a myEchoExample.jar and dumped it inside
> > web-inf/services directory (I even tried the upload.jsp web
> > interface). But I don't seem to find myEchoExample listed as a
> > service. Did I miss something.
> > Plz kindly help.
> >
> > Thanks in advance,
> > Jayachandra
> >
> >
> 
> 


-- 
-- Jaya

Re: [Axis2] problems with new web service deployment

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi;
I have doubt about your meta-inf  , it should be META-INF not meta-inf , try 
to make that changes and try again.
You can also use the tool that we have provide to build service jar file 
using that you can build the jar file and you can replace your service.xml 
with the one default service.xml.


Deepal

----- Original Message ----- 
From: "jayachandra" <ja...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Monday, February 28, 2005 12:27 PM
Subject: [Axis2] problems with new web service deployment


> Hi Axis 2 Community!
>
> I wanted to deploy in Axis2 a small webservice whose implementation
> class is myEchoExample (similar as Echo.java provided under test
> directory)
>
> The class code looks as simple as
>
> package examples;
> import org.apache.axis.om.OMElement;
> public class myEchoExample {
>    public myEchoExample() {
>    }
>    public void echoVoid() {
>        System.out.println("echo Service Called");
>    }
>    public OMElement echoOMElement(OMElement omEle) {
>        omEle.setLocalName(omEle.getLocalName() + "Response");
>        return omEle;
>    }
>    public String echoString(String in) {
>        return in;
>    }
>    public int echoInt(int in) {
>        return in;
>    }
> }
>
> I compiled this and also wrote a meta-inf/service.xml as follows
>
> <service provider="org.apache.axis.providers.RawXMLProvider"
> style="rpc" contextPath="services">
>  <java:implementation class="examples.myEchoExample"
> xmlns:java="http://ws.apache.org/axis2/deployment/java" />
>  <operation name="echoVoid" />
>  <operation name="echoOMElement" />
>  <operation name="echoString" />
>  <operation name="echoInt" />
> </service>
>
> I then packaged the class file and service.xml (retaining their
> directory structure) into a myEchoExample.jar and dumped it inside
> web-inf/services directory (I even tried the upload.jsp web
> interface). But I don't seem to find myEchoExample listed as a
> service. Did I miss something.
> Plz kindly help.
>
> Thanks in advance,
> Jayachandra
>
>