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 Yu-Hui Jin <yu...@gmail.com> on 2006/02/05 06:23:40 UTC

The REST call syntax

Hi, there,

In the user guide, there's a RESTful Web Service page in which an example is
given -- the REST call to getVersion.

After enabling the REST in my axis2.xml,  I tried to make a REST to the
Axis2SampleDocLitService that I made work by following the instructions.

To be more specific, I tried:

http://localhost:8080/axis2/services/Axis2SampleDocLitService/EchoString?EchoStringParam=nice

However it gives me errors such as the following. Anyone know the syntax for
REST when there's input messages? Thanks!

 --Hui


REST Response:
================
<soapenv:Envelope>
<soapenv:Header/>
−
    <soapenv:Body>
−
    <soapenv:Fault>
<faultcode>Client</faultcode>
−
    <faultstring>
Operation Not found EPR is
http://localhost:8080/axis2/services/Axis2SampleDocLitService/EchoString and
WSA Action = null
</faultstring>
<faultactor>http://myAxisServer/role/default</faultactor>
−
    <detail>
−
    <soapenv:Exception>
org.apache.axis2.AxisFault: Operation Not found EPR is
http://localhost:8080/axis2/services/Axis2SampleDocLitService/EchoString and
WSA Action = null
    at org.apache.axis2.engine.DispatchPhase.checkPostConditions(
DispatchPhase.java:46)
    at org.apache.axis2.engine.Phase.invoke(Phase.java:391)
    at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:351)
    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:322)
    at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPGetRequest(
HTTPTransportUtils.java:147)
    at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java
:103)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:868)
    at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Http11BaseProtocol.java:663)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
</soapenv:Exception>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

Re: The REST call syntax

Posted by Davanum Srinivas <da...@gmail.com>.
Click on "CREATE NEW ISSUE" on the top banner.

-- dims

On 2/13/06, Yu-Hui Jin <yu...@gmail.com> wrote:
> Hi,
>
> I wanted to add a JITA for this bug (and another one for the databinding). I
> checked out the following page but couldn't find a way to add new bug. how
> should I do that? Thanks!
>
>  http://issues.apache.org/jira/browse/AXIS2
>
>
> regards,
>
> -Hui
>
>
>
> On 2/7/06, Deepal Jayasinghe < deepal@opensource.lk> wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Hi Hui;
> >
> > I am not sure Axis2 support REST very good manner , there are number
> > of improvements need to be done to get it to the correct level. And
> > other thing that only support REST using GET , so that is not enough
> > as well, and SOAP envelop has to be create taking schema of the
> > service taking into account.
> >
> > So pls create a JIRA , so that it will fix in next release.
> >
> > Yu-Hui Jin wrote:
> >
> > > well, if I do that, then it's not a REST call anymore, assuming you
> > > are asking me to write a client side code to do that.
> > >
> > > I thought a REST call can be just made by a URL with optional params.
> > >
> > > So could it be that I'm just not getting the syntax of the URL
> > > right? Is there a working example at all?
> > >
> > >
> > > thanks,
> > >
> > > -Hui
> > >
> > >
> > >
> > > On 2/7/06, *Ajith Ranabahu* <ajith.ranabahu@gmail.com
> > > <ma...@gmail.com>> wrote:
> > >
> > > Hi,
> > > Hmm.. You seem to have done the right thing. Indeed services with
> > > parameters can be invoked through REST and we follow the IRI style
> > > (http://www.w3.org/2005/08/wsdl/style/iri) to construct
> a
> > > message from
> > > the parameters we get in the query string.
> > > The operation name is picked from the URL so your URL should
> > > contain
> > > the right service name (with correct case) and the opertion name
> > > also
> > > with the correct case.
> > > However I think the problem may be due to the URL based dispatching
> > > not working properly.
> > >
> > > You can try this workaround
> > > - Modify the request to include a SOAPAction with the value of the
> > > operation name
> > > That should force the SOAPActionBasedDispatcher to action and
> > > pick
> > > the right operation
> > >
> > >
> > > --
> > > Ajith Ranabahu
> > >
> > >
> >
> > - --
> > Thanks,
> > Deepal
> >
> ................................................................
> > ~Future is Open~
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.2 (MingW32)
> > Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> >
> >
> iD8DBQFD6aEMjOGcXNDx0CARAgMBAJ9zyUcwIHhiggpr/YF+Achjg/8gLACfUZvq
> > 8hrizfGEBDDFPYoOzmYfmSg=
> > =M7j5
> > -----END PGP SIGNATURE-----
> >
> >
> >
>
>


--
Davanum Srinivas : http://wso2.com/blogs/

Re: The REST call syntax

Posted by Yu-Hui Jin <yu...@gmail.com>.
Hi,

I wanted to add a JITA for this bug (and another one for the databinding). I
checked out the following page but couldn't find a way to add new bug. how
should I do that? Thanks!

http://issues.apache.org/jira/browse/AXIS2


regards,

-Hui



On 2/7/06, Deepal Jayasinghe <de...@opensource.lk> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Hui;
>
> I am not sure Axis2 support REST very good manner , there are number
> of improvements need to be done to get it to the correct level. And
> other thing that only support REST using GET , so that is not enough
> as well, and SOAP envelop has to be create taking schema of the
> service taking into account.
>
> So pls create a JIRA , so that it will fix in next release.
>
> Yu-Hui Jin wrote:
>
> > well, if I do that, then it's not a REST call anymore, assuming you
> > are asking me to write a client side code to do that.
> >
> > I thought a REST call can be just made by a URL with optional params.
> >
> > So could it be that I'm just not getting the syntax of the URL
> > right? Is there a working example at all?
> >
> >
> > thanks,
> >
> > -Hui
> >
> >
> >
> > On 2/7/06, *Ajith Ranabahu* <ajith.ranabahu@gmail.com
> > <ma...@gmail.com>> wrote:
> >
> > Hi,
> > Hmm.. You seem to have done the right thing. Indeed services with
> > parameters can be invoked through REST and we follow the IRI style
> > (http://www.w3.org/2005/08/wsdl/style/iri) to construct a
> > message from
> > the parameters we get in the query string.
> > The operation name is picked from the URL so your URL should
> > contain
> > the right service name (with correct case) and the opertion name
> > also
> > with the correct case.
> > However I think the problem may be due to the URL based dispatching
> > not working properly.
> >
> > You can try this workaround
> > - Modify the request to include a SOAPAction with the value of the
> > operation name
> > That should force the SOAPActionBasedDispatcher to action and
> > pick
> > the right operation
> >
> >
> > --
> > Ajith Ranabahu
> >
> >
>
> - --
> Thanks,
> Deepal
> ................................................................
> ~Future is Open~
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFD6aEMjOGcXNDx0CARAgMBAJ9zyUcwIHhiggpr/YF+Achjg/8gLACfUZvq
> 8hrizfGEBDDFPYoOzmYfmSg=
> =M7j5
> -----END PGP SIGNATURE-----
>
>
>

Re: The REST call syntax

Posted by Deepal Jayasinghe <de...@opensource.lk>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Hi Hui;

I am not sure Axis2 support REST very good manner , there are number
of improvements need to be done to get it to the correct level. And
other thing that only support REST using GET , so that is not enough
as well, and SOAP envelop has to be create taking schema of the
service taking into account.

So pls create a JIRA , so that it will fix in next release.

Yu-Hui Jin wrote:

> well, if I do that, then it's not a REST call anymore, assuming you
> are asking me to write a client side code to do that.
>
> I thought a REST call can be just made by a URL with optional params.
>
> So could it be that I'm just not getting the syntax of the URL
> right? Is there a working example at all?
>
>
> thanks,
>
> -Hui
>
>
>
> On 2/7/06, *Ajith Ranabahu* <ajith.ranabahu@gmail.com
> <ma...@gmail.com>> wrote:
>
> Hi,
> Hmm.. You seem to have done the right thing. Indeed services with
> parameters can be invoked through REST and we follow the IRI style
> (http://www.w3.org/2005/08/wsdl/style/iri) to construct a
> message from
> the parameters we get in the query string.
> The operation name is picked from the URL so your URL should
> contain
> the right service name (with correct case) and the opertion name
> also
> with the correct case.
> However I think the problem may be due to the URL based dispatching
> not working properly.
>
> You can try this workaround
> - Modify the request to include a SOAPAction with the value of the
> operation name
> That should force the SOAPActionBasedDispatcher to action and
> pick
> the right operation
>
>
> --
> Ajith Ranabahu
>
>

- --
Thanks,
Deepal
................................................................
~Future is Open~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
iD8DBQFD6aEMjOGcXNDx0CARAgMBAJ9zyUcwIHhiggpr/YF+Achjg/8gLACfUZvq
8hrizfGEBDDFPYoOzmYfmSg=
=M7j5
-----END PGP SIGNATURE-----



Re: The REST call syntax

Posted by Yu-Hui Jin <yu...@gmail.com>.
well, if I do that, then it's not a REST call anymore, assuming you are
asking me to write a client side code to do that.

I thought a REST call can be just made by a URL with optional params.

So could it be that I'm just not getting the syntax of the URL right? Is
there a working example at all?


thanks,

-Hui



On 2/7/06, Ajith Ranabahu <aj...@gmail.com> wrote:
>
> Hi,
> Hmm.. You seem to have done the right thing. Indeed services with
> parameters can be invoked through REST and we follow the IRI style
> (http://www.w3.org/2005/08/wsdl/style/iri) to construct a message from
> the parameters we get in the query string.
> The operation name is picked from the URL so your URL should contain
> the right service name (with correct case) and the opertion name also
> with the correct case.
> However I think the problem may be due to the URL based dispatching
> not working properly.
>
> You can try this workaround
> - Modify the request to include a SOAPAction with the value of the
> operation name
>    That should force the SOAPActionBasedDispatcher to action and pick
> the right operation
>
>
> --
> Ajith Ranabahu
>

Re: The REST call syntax

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi,
Hmm.. You seem to have done the right thing. Indeed services with
parameters can be invoked through REST and we follow the IRI style
(http://www.w3.org/2005/08/wsdl/style/iri) to construct a message from
the parameters we get in the query string.
The operation name is picked from the URL so your URL should contain
the right service name (with correct case) and the opertion name also
with the correct case.
However I think the problem may be due to the URL based dispatching
not working properly.

You can try this workaround
 - Modify the request to include a SOAPAction with the value of the
operation name
   That should force the SOAPActionBasedDispatcher to action and pick
the right operation


--
Ajith Ranabahu