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 Soactive Inc <so...@gmail.com> on 2006/06/11 21:32:54 UTC

[Axis2] Exception in test web service

I am trying to migrate services written using Axis 1.2 to Axis 2. I started
off by writing a very simple service as follows:

// service code
package samples;

public class EchoHeaders {
    public String whoami() {
        return "Hello caller";
    }

    public String echo(String param) {
        return param;
    }
}
// end service code

And here's my service.xml file contents:

  <service name="echoheaders">
    <description>
        This is a sample service for echoing certain user-supplied inputs.
    </description>
    <parameter name="ServiceClass">samples.EchoHeaders</parameter>
    <operation name="echo">
            <messageReceiver class="
org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
   </operation>
  </service>

I created the the following directory structure under
axis2/WEB-INF/services:
- echoheaders
   - samples
      - EchoHeaders.class
   - META-INF
      - services.xml

Next, I created an aar archive using the 'jar cvf echoheaders.aar .' command
under the echoheaders dir.

Finally, I restarted the Axis2 server, and I get the following exception
when I access the URL: http://localhost:8080/axis2/services/echoheaders?wsdl

−
    <error>
<description>Unable to generate WSDL for this service</description>
−
    <reason>
Either user has not dropped the wsdl into META-INF or operations use message
receivers other than RPC.
</reason>
</error>

== But when I check the deployed services on the Axis2 console I see the
service with 2 operations (echo and whoami).

Any idea whats going on here? Appreciate your help.

Re: [Axis2] Exception in test web service

Posted by Soactive Inc <so...@gmail.com>.
Hi Deepal, Kinichiro:

Thanks a lot. The issue was exactly what you pointed me to. I need to
specify each and every operation in the services.xml file.

Best,
Ron

On 6/11/06, Deepal Jayasinghe <de...@opensource.lk> wrote:
>
> Hi;
> Can you please have a look at followings;
>
> http://www.wso2.net/kb/104
> http://www.wso2.net/kb/113
>
> Soactive Inc wrote:
>
> > I am trying to migrate services written using Axis 1.2 to Axis 2. I
> > started off by writing a very simple service as follows:
> >
> > // service code
> > package samples;
> >
> > public class EchoHeaders {
> > public String whoami() {
> > return "Hello caller";
> > }
> >
> > public String echo(String param) {
> > return param;
> > }
> > }
> > // end service code
> >
> > And here's my service.xml file contents:
> >
> > <service name="echoheaders">
> > <description>
> > This is a sample service for echoing certain user-supplied inputs.
> > </description>
> > <parameter name="ServiceClass">samples.EchoHeaders</parameter>
> > <operation name="echo">
> > <messageReceiver
> > class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
> > </operation>
> > </service>
> >
> > I created the the following directory structure under
> > axis2/WEB-INF/services:
> > - echoheaders
> > - samples
> > - EchoHeaders.class
> > - META-INF
> > - services.xml
> >
> > Next, I created an aar archive using the 'jar cvf echoheaders.aar .'
> > command under the echoheaders dir.
> >
> > Finally, I restarted the Axis2 server, and I get the following
> > exception when I access the URL:
> > http://localhost:8080/axis2/services/echoheaders?wsdl
> >
> > −
> > <error>
> > <description>Unable to generate WSDL for this service</description>
> > −
> > <reason>
> > Either user has not dropped the wsdl into META-INF or operations use
> > message receivers other than RPC.
> > </reason>
> > </error>
> >
> > == But when I check the deployed services on the Axis2 console I see
> > the service with 2 operations (echo and whoami).
> >
> > Any idea whats going on here? Appreciate your help.
>
>
> --
> Thanks,
> Deepal
> ................................................................
> ~Future is Open~
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: [Axis2] Exception in test web service

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi;
Can you please have a look at followings;

http://www.wso2.net/kb/104
http://www.wso2.net/kb/113

Soactive Inc wrote:

> I am trying to migrate services written using Axis 1.2 to Axis 2. I
> started off by writing a very simple service as follows:
>
> // service code
> package samples;
>
> public class EchoHeaders {
> public String whoami() {
> return "Hello caller";
> }
>
> public String echo(String param) {
> return param;
> }
> }
> // end service code
>
> And here's my service.xml file contents:
>
> <service name="echoheaders">
> <description>
> This is a sample service for echoing certain user-supplied inputs.
> </description>
> <parameter name="ServiceClass">samples.EchoHeaders</parameter>
> <operation name="echo">
> <messageReceiver
> class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
> </operation>
> </service>
>
> I created the the following directory structure under
> axis2/WEB-INF/services:
> - echoheaders
> - samples
> - EchoHeaders.class
> - META-INF
> - services.xml
>
> Next, I created an aar archive using the 'jar cvf echoheaders.aar .'
> command under the echoheaders dir.
>
> Finally, I restarted the Axis2 server, and I get the following
> exception when I access the URL:
> http://localhost:8080/axis2/services/echoheaders?wsdl
>
> −
> <error>
> <description>Unable to generate WSDL for this service</description>
> −
> <reason>
> Either user has not dropped the wsdl into META-INF or operations use
> message receivers other than RPC.
> </reason>
> </error>
>
> == But when I check the deployed services on the Axis2 console I see
> the service with 2 operations (echo and whoami).
>
> Any idea whats going on here? Appreciate your help.


-- 
Thanks,
Deepal
................................................................
~Future is Open~ 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2] Exception in test web service

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Soactive;
In oder to generate wsdl at the runtime you have to either put your wsld
in side meta-inf or
- Each and every operations has to use RPCMessageReceiver

By changing your services.xml as following will solve the problem

<service name="echoheaders">
<description>
This is a sample service for echoing certain user-supplied inputs.
</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">samples.EchoHeaders</parameter>
</service>

Soactive Inc wrote:

> I am trying to migrate services written using Axis 1.2 to Axis 2. I
> started off by writing a very simple service as follows:
>
> // service code
> package samples;
>
> public class EchoHeaders {
> public String whoami() {
> return "Hello caller";
> }
>
> public String echo(String param) {
> return param;
> }
> }
> // end service code
>
> And here's my service.xml file contents:
>
> <service name="echoheaders">
> <description>
> This is a sample service for echoing certain user-supplied inputs.
> </description>
> <parameter name="ServiceClass">samples.EchoHeaders</parameter>
> <operation name="echo">
> <messageReceiver
> class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
> </operation>
> </service>
>
> I created the the following directory structure under
> axis2/WEB-INF/services:
> - echoheaders
> - samples
> - EchoHeaders.class
> - META-INF
> - services.xml
>
> Next, I created an aar archive using the 'jar cvf echoheaders.aar .'
> command under the echoheaders dir.
>
> Finally, I restarted the Axis2 server, and I get the following
> exception when I access the URL:
> http://localhost:8080/axis2/services/echoheaders?wsdl
>
> −
> <error>
> <description>Unable to generate WSDL for this service</description>
> −
> <reason>
> Either user has not dropped the wsdl into META-INF or operations use
> message receivers other than RPC.
> </reason>
> </error>
>
> == But when I check the deployed services on the Axis2 console I see
> the service with 2 operations (echo and whoami).
>
> Any idea whats going on here? Appreciate your help.


-- 
Thanks,
Deepal
................................................................
~Future is Open~ 




---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2] Exception in test web service

Posted by Kinichiro Inoguchi <in...@yahoo.com>.
How about adding
    <operation name="whoami">
        <messageReceiver
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
    </operation>
to your services.xml ?

Regards,
kinichiro

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org