Eoin, I'm not the JAX-RS expert here. However, if you post up your service implementation, I bet that one of the JAX-RS experts would help you convert from the 'http binding' (nonstandard, JRA), to the official JAX-RS/REST binding. I believe that choices will work fine in there.
I believe that we also have samples. --benson On Thu, Oct 30, 2008 at 7:09 AM, Eoin Lane (JIRA) <[EMAIL PROTECTED]> wrote: > > [ > https://issues.apache.org/jira/browse/CXF-1892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643811#action_12643811 > ] > > Eoin Lane commented on CXF-1892: > -------------------------------- > > Benson, > > Thank you very much for your speedy response. > > I have no problem upgrading to JAX-RS, what ever gets this working :) > > > I have been using a recent dW article (which claims to be using a spring > framework) as my base here and then just creating a RESTful service based > around an XML Schema with the choice in it. > > https://www.ibm.com/developerworks/webservices/library/ws-pojo-springcxf2/ > > > I ran in two problem (all with write to the service, I can read no > problem). > > The first occurs when I am using CXF 2.1.x and it is a very generic error > which I reported here on the apache forum: > > http://www.nabble.com/Problems-with-CXF-2.1.x-tt20213983.html > > The second error, the XMLSchemaChoice occurs when I switch back to using > CXF 2.1 > > I wonder could you point me to a working example of using JAX-RS and I > will happily try and get that to work. > > Again thanks for your time and consideration. > > > Best wishes, > Eoin Lane Ph.D > > >> Support for XMLSchemaChoice >> --------------------------- >> >> Key: CXF-1892 >> URL: https://issues.apache.org/jira/browse/CXF-1892 >> Project: CXF >> Issue Type: Improvement >> Components: JAXB Databinding >> Affects Versions: 2.1.3 >> Reporter: Eoin Lane >> >> Get CXF to support >> org.apache.ws.commons.schema.XmlSchemaChoice >> >> I have generated java code using JAXB for a XML Schema that has choices in >> it e.g. >> >> <?xml version="1.0" encoding="UTF-8"?> >> <schema xmlns="http://www.w3.org/2001/XMLSchema" >> targetNamespace="http://www.example.org/NewXMLSchema" >> xmlns:tns="http://www.example.org/NewXMLSchema" >> xmlns:xs="http://www.w3.org/2001/XMLSchema" >> elementFormDefault="qualified"> >> <!-- topic ..................................................... --> >> <xs:element name="item"> >> <xs:complexType> >> <xs:sequence> >> <xs:element name="instanceOf" type="xs:anyURI" >> minOccurs="0" maxOccurs="1" /> >> <xs:choice minOccurs="0" maxOccurs="unbounded"> >> <xs:element name="name" >> type="xs:anyURI"/> >> <xs:element name="occurrence" >> type="xs:anyURI"/> >> </xs:choice> >> </xs:sequence> >> <xs:attribute name="id" type="xs:ID" use="required" /> >> </xs:complexType> >> </xs:element> >> </schema> >> >> However when I POST in an valid XML message the IriDecoderHelper class barks >> the below exception: >> >> Need to code in support for >> XmlSchemaChoice in IriDecoderHelper.interopolateParams(...) method? >> >> (BTW the offending line is here: >> for (int i = 0; i < seq.getItems().getCount(); i++) { >> XmlSchemaElement elChild = >> (XmlSchemaElement)seq.getItems().getItem(i); >> Param param = null; >> ) >> >> >> Oct 28, 2008 3:28:24 PM org.apache.cxf.phase.PhaseInterceptorChain >> doIntercept >> INFO: Interceptor has thrown exception, unwinding now >> java.lang.ClassCastException: org.apache.ws.commons.schema.XmlSchemaChoice >> incompatible with org.apache.ws.commons.schema.XmlSchemaElement >> at >> >> org.apache.cxf.binding.http.IriDecoderHelper.interopolateParams(IriDecoderHelper.java:307) >> at >> >> org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.mergeParams(URIParameterInInterceptor.java:122) >> at >> >> org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.handleMessage(URIParameterInInterceptor.java:103) >> at >> >> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221) >> at >> >> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78) >> at >> >> org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:92) >> at >> >> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:214) >> at >> >> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:113) >> at >> >> org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:170) >> at >> >> org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:148) >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) >> at >> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) >> at >> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) >> at >> >> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) >> at >> >> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) >> at >> >> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) >> at >> >> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) >> at >> >> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) >> at >> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) >> at >> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) >> at >> >> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) >> at >> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) >> at java.lang.Thread.run(Thread.java:803) > > -- > This message is automatically generated by JIRA. > - > You can reply to this email to add a comment to the issue online. > >
