Yes, I think those are your only options for edits on a sync'd server. You might need to set one of those Allow headers in your java app. The browser includes that by default. Perhaps thats why the 405 is getting thrown?
Ben On Mon, Mar 26, 2012 at 11:17 AM, Jim Grace <[email protected]> wrote: > Thanks Ben, I'll try compiling from the module trunk. > > I'm calling webservices.rest from my own Java app. Though I also tried the > URLs in a browser. We're piloting Sync at FACES now, so now I'll have to go > through the API for the kind of database changes I'd heretofore made with > SQL. For example as we start to pilot sync we're still using remote form > entry at many sites, and sometimes we load the same entries twice resulting > in exact duplicate encounters (all same encounter and obs values). I've > written an SQL script to find and void these exact duplicates, but now I > need to rewrite it to use the API. With Sync, it looks like my options are > (1) write and install a module using the API on a synced server, (2) use > Groovy, or (3) webservices. Is there another option I'm missing? I thought > I might prefer Java to Groovy, and I didn't want to keep installing my own > modules on our production server, so webservices.rest looked attractive. > > I'm writing a small wrapper around java.net.HttpURLConnection to make the > REST calls and return the results to my Java code. I'd be happy to share > it. Would it be appropriate to include it as sample code in a child page > under Rest Web Services API, with a page title something like "Calling REST > Web Services from Java"? > > Cheers, > Jim > > ----------------------------- > > At 04:55 PM 26-03-12, Ben Wolfe wrote: > 405 is an interesting status code, I haven't seen that one before: > > *10.4.6 <http://??> 405 Method Not Allowed > The method specified in the Request-Line is not allowed for the resource > identified by the Request-URI. The response MUST include an Allow header > containing a list of valid methods for the requested resource. *How are > you calling the url? Tomcat/Jetty/Other? Curl? Browser? App? > > The lack of GET on some urls is a known issue: > https://tickets.openmrs.org/browse/RESTWS-193 > > You could compile from source to get the fix immediately. > > Ben > > On Sun, Mar 25, 2012 at 1:04 PM, Jim Grace <[email protected] > > wrote: > Hi All. When I try webservices.rest GET with a subdomain I get an error > with HTTP response code 405. But a GET without a subdomain works just fine. > Is this a bug, or am I doing something wrong? I'm using Rest Web Services > 0.8.21639 with OpenMRS 1.8.3. > > Successful URLs include: > http://localhost:8080/openmrs/ws/rest/v1/catalog > http://localhost:8080/openmrs/ws/rest/v1/patient?q=timon > > http://localhost:8080/openmrs/ws/rest/v1/patient/00fcf8d8-ab5b-102d-be97-85aedb3d9f67 > > http://localhost:8080/openmrs/ws/rest/v1/person/00fcf8d8-ab5b-102d-be97-85aedb3d9f67 > > Failing URLs include: > > http://localhost:8080/openmrs/ws/rest/v1/person/00fcf8d8-ab5b-102d-be97-85aedb3d9f67/names > > http://localhost:8080/openmrs/ws/rest/v1/patient/00fcf8d8-ab5b-102d-be97-85aedb3d9f67/encounters > > http://localhost:8080/openmrs/ws/rest/v1/patient/00fcf8d8-ab5b-102d-be97-85aedb3d9f67/identifiers > > The returned body on error includes: > > org.springframework.web.HttpRequestMethodNotSupportedException: Request > method 'GET' not supported > at > org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter$ServletHandlerMethodResolver.resolveHandlerMethod(AnnotationMethodHandlerAdapter.java:623) > at > org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:421) > at > org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414) > at > org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) > at > org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) > at > org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) > at > org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:65) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76) > at > org.openmrs.module.webservices.rest.web.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:100) > at > org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:74) > at > org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:58) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) > at > org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:74) > at > org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:112) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) > at > org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861) > at > org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579) > at > org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584) > at java.lang.Thread.run(Unknown Source) > > Any ideas? > > Thanks, > Jim > > _________________________________________ > > To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to > [email protected] with "SIGNOFF openmrs-devel-l" in the body > (not the subject) of your e-mail. > > [ > mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l<[email protected]%3Fbody=SIGNOFF%20openmrs-devel-l> > ] > > > ------------------------------ > Click here to > unsubscribe<[email protected]?body=SIGNOFF%20openmrs-devel-l>from > OpenMRS Developers' mailing list > ------------------------------ > Click here to > unsubscribe<[email protected]?body=SIGNOFF%20openmrs-devel-l>from > OpenMRS Developers' mailing list _________________________________________ To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [email protected] with "SIGNOFF openmrs-devel-l" in the body (not the subject) of your e-mail. [mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

