I guess I should have looked harder. I found this post from yesterday:

http://marc.theaimsgroup.com/?l=axis-user&m=114946721715784&w=2

Does this mean this is not considered a bug in Axis and it won't be fixed?

thx

From:       "Anne Thomas Manes" <atmanes () gmail ! com>
Date:       2006-06-05 0:26:23
Message-ID: bf414ee60606041726v4a6ed6dcy9b9affd68f9ff2e1 () mail ! gmail ! com
[Download message RAW]

By definition, a "REST" interface does not expose multiple methods. In fact, defining any specific method (rather than the generic GET, POST, PUT, DELETE methods) is unRESTful. A POX interface can expose multiple methods, but if your goal is to design a REST-compliant resource, then you should comply
with the REST architecture.

See this excellent blog post on the difference between REST and "STREST": http://duncan-cragg.org/blog/post/strest-service-trampled-rest-will- break-web-20/

Anne


On Jun 5, 2006, at 6:48 PM, Jian Zhen wrote:

Hi all,

I am new to Axis2 and am having some issues trying to figure out how to make multiple operations work in the same service.

I have the following class

public class GetReport {
.
  public OMElement getReport (String authToken,
                                String reportName,
                                int fromTime,
                                int toTime,
                                String sortColumn) {
  .
  .
  }

  public OMElement getRealTimeReport (String authToken) {
  .
  .
  .
  }
.
.
}

getRealTimeReport is just a short cut for getReport, basically calls getReport using some default values.

However, I keep getting the following exception if I use the getRealTimeReport operation:

java.lang.NullPointerException
org.apache.axis2.description.AxisMessage.getSchemaElement (AxisMessage.java:109) org.apache.axis2.transport.http.util.RESTUtil.processGetRequest (RESTUtil.java:126) org.apache.axis2.transport.http.AxisRESTServlet.doGet (AxisRESTServlet.java:36)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I am using REST style URLs:
http://localhost:8080/logws/rest/GetReport/getRealTimeReport? authToken=TWP5WYAPU

I get a different exception if I call getReport:

java.lang.NullPointerException
org.apache.axis2.util.SchemaUtil.handleMediaTypeURLEncoded (SchemaUtil.java:105) org.apache.axis2.transport.http.util.RESTUtil.processGetRequest (RESTUtil.java:129) org.apache.axis2.transport.http.AxisRESTServlet.doGet (AxisRESTServlet.java:36)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

        
This all works fine if I have only ONE operation (e.g. get rid of the getRealTimeReport operation). But every time I try to add another operation to the service, I get these errors.

My services.xml is very simple:

<service name="GetReport">
<parameter name="ServiceClass" locked="false">org.abc.test.GetReport</parameter>

    <operation name="getReport">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
    </operation>

    <operation name="getRealTimeReport">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
    </operation>

</service>

Can anyone tell me what I am doing wrong?

thx very much for your help

--
Jian Zhen <[EMAIL PROTECTED]>
http://www.zhen.org




--
Jian Zhen <[EMAIL PROTECTED]>
http://www.zhen.org




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to