Keith, Thanks.
How do I do that with just a plain HTTP GET? Parameters on the URL? John On 6/11/07, keith chapman <[EMAIL PROTECTED]> wrote:
Hi John, Yes REST works for pojo services. It looks like the request should ne namespace qualified. Just try qualifying the request usung the namespace http://service.addressbook.sample/xsd . Thanks Keith. On 6/8/07, John G. Norman <[EMAIL PROTECTED]> wrote: > > Does the Axis2 1.2 REST (oops, I mean, POX over HTTP :-) work with a > POJO service? > > The short version of my question is that I'm making a GET request like this: > > http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John > > But am getting an exception regarding a namespace mismatch > > Here's what I did to samples/pojo: > > 1. Have the default constructor to the sample/pojo AddressBookService > add a couple of Entry. E.g., > > public AddressBookService() { > super(); > Entry e1 = new Entry(); > e1.setName("John"); > e1.setStreet("1 Broadway"); > e1.setCity("Cambridge"); > e1.setState("MA"); > e1.setPostalCode("02142"); > Entry e2 = new Entry(); > e2.setName("George"); > e2.setStreet("1600 Penn"); > e2.setCity("Washington"); > e2.setState("DC"); > e2.setPostalCode("01111"); > entries.put(e1.getName(), e1); > entries.put(e2.getName(), e2); > } > > 2. Build and deploy. > > 3. Try and access the service as follows: > > http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John > > 4. Get exception like this: > > Jun 8, 2007 1:56:30 PM > org.apache.axis2.rpc.receivers.RPCMessageReceiver invokeBusinessLogic > SEVERE: Exception occurred while trying to invoke service method findEntry > org.apache.axis2.AxisFault: namespace mismatch require > http://service.addressbook.sample/xsd found none > at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98) > at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive (AbstractInOutSyncMessageReceiver.java:39) > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144) > > 5. I haven't added a JIRA -- seems like this one deserves a sanity > check. Anyone? > > I found this in my own code where a service which worked via the 1.1.1 > Axis2RestServlet worked; but is now seemingly broken in the same way > as the above. > > 6. As an aside, the documentation here: > > http://ws.apache.org/axis2/1_2/rest-ws.html > > is quite thin. The very last section shows a regular GET accessing > version information via > http://127.0.0.1:8080/axis2/services/Version/getVersion -- that's > perfectly nice, but showing a few more examples, e.g., accessing a > service with parameters -- would be more realistic. To be sure, one > might write a Java REST client, but I would hazard a guess that many > users are clients are in scripting languages and they just want to hit > the URL and get the XML representation back. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Keith Chapman WSO2 Inc. Oxygen for Web Services Developers. http://wso2.org/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
