Hi

In this case the provider is not registered directly with the endpoint, so it does not work, I've just tested it, I thought may be "urn:uddi-org:api_v3" was confusing JAXB, but no, works OK

Thanks, Sergey
On 07/12/13 00:49, Alex O'Ree wrote:
Hi I have a JAXB annotated (wsimport) jaxws service that i'm writing
an adapter for using jaxrs and jettison with 2.7.5.

When service the rest endpoint with XML using the jaxws objects, it
works just fine. However when serving JSON encoding data in response,
I get this.

Caused by: java.lang.IllegalStateException: Invalid JSON namespace:
urn:uddi-org:api_v3
         at 
org.codehaus.jettison.mapped.MappedNamespaceConvention.getJSONNamespace(MappedNamespaceConvention.java:252)
         at 
org.codehaus.jettison.mapped.MappedNamespaceConvention.createKey(MappedNamespaceConvention.java:260)
         at 
org.codehaus.jettison.mapped.MappedXMLStreamWriter.writeStartElement(MappedXMLStreamWriter.java:220)
         at 
com.sun.xml.bind.v2.runtime.output.XMLStreamWriterOutput.beginStartTag(XMLStreamWriterOutput.java:118)

Beans.xml config file

   <jaxrs:server id="inquiryRestService" address="/inquiryRest">
        <jaxrs:serviceBeans>
       <ref bean="inquiryRest" />
     </jaxrs:serviceBeans>
   </jaxrs:server>
   <bean id="inquiryRest"
class="org.apache.juddi.api.impl.rest.UDDIInquiryJAXRS" >
     </bean>
<bean id="jaxbProvider" class="org.apache.cxf.jaxrs.provider.json.JSONProvider">
   <property name="ignoreNamespaces" value="true"/>
</bean>


this part works
@GET
     @Path("/XML/businessDetail/{id}")
     @Produces("application/xml")
     @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details
of a business entity in XML")
     public org.uddi.api_v3.BusinessEntity
getBusinessDetailXML(@PathParam("id") String id) throws
WebApplicationException {
         return getBusinessDetail(id);
     }


this part does not
@GET
     @Path("/JSON/businessDetail/{id}")
     @Produces("application/json")
     @org.apache.cxf.jaxrs.model.wadl.Description("Returns the details
of a business entity in JSON")
     public org.uddi.api_v3.BusinessEntity
getBusinessDetailJSON(@PathParam("id") String id) throws
WebApplicationException {
         return getBusinessDetail(id);
     }

The complete code is over here:
http://svn.apache.org/repos/asf/juddi/trunk/juddi-rest-cxf/

 From googling, I've seen that adding the ignoreNamespaces=true should
fix this, but I'm not sure if I have it in the write place. The docs
don't have a clear example of this



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to