Greetings.
I recently upgraded from cxf 2.0.4-incubator to 2.2.3.
After the upgrade it appears that my parameters are getting lost. I am
making POST JSON requests using http-binding. My config looks like this:
<jaxws:endpoint
id="fileManagerServiceJSON"
implementor="#fileManagerService"
implementorClass="com.xxx.xxx.service.filemanager.FileManagerServiceImpl"
address="/sysadmin/filemanager/json"
bindingUri="http://apache.org/cxf/binding/http">
<jaxws:serviceFactory>
<ref bean="json-service-factory" />
</jaxws:serviceFactory>
</jaxws:endpoint>
<bean id="json-service-factory"
class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"
scope="prototype">
<property name="properties">
<map>
<entry key="javax.xml.stream.XMLInputFactory"
value-ref="xmlIn" />
<entry key="javax.xml.stream.XMLOutputFactory"
value-ref="xmlOut" />
<entry key="Content-Type" value="text/plain" />
</map>
</property>
</bean>
<util:map id="nstojns" map-class="java.util.HashMap">
<entry key="http://domain.model.xxx.com/" value="" />
</util:map>
<bean id="xmlIn"
class="org.codehaus.jettison.mapped.MappedXMLInputFactory" >
<constructor-arg ref="nstojns" />
</bean>
<bean id="xmlOut"
class="org.codehaus.jettison.mapped.MappedXMLOutputFactory" >
<constructor-arg ref="nstojns" />
</bean>
A request to the server looks like this:
Address: /xxx/service/sysadmin/filemanager/json/getBatches
Encoding: UTF-8
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
referer=[http://localhost:8080/xxx/sysadmin/service-tests-admin/template.jsp?name=filemanager-getBatches&toke=null],
accept-charset=[ISO-8859-1,utf-8;q=0.7,*;q=0.7], pragma=[no-cache],
Content-Type=[application/x-www-form-urlencoded; charset=UTF-8],
x-ajax-reqid=[e], content-type=[application/x-www-form-urlencoded;
charset=UTF-8], cookie=[JSESSIONID=799AC2CFC9100A38C6BBCC7D732CD5D7;
fl-remember=FRd7UXI%3D; fl-user=; fl-pass=],
Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8],
keep-alive=[300], content-length=[40], cache-control=[no-cache],
host=[localhost:8080], accept-language=[en-us,en;q=0.5],
user-agent=[Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US;
rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2]}
Payload: {getBatches: {offset:0, maxResults:1}}
The service method looks like this:
public ListResult<Batch> getBatches(String offset, String maxResults) {
I've isolated the problem down to jettison, i think. When I use 1.0RC2
(what was used with CXF 2.0.4), the offset and maxResults come through
fine. When i use the new jettison 1.1, they are null. I *need* to use the
new jettison because of bug fixes relating to array and list processing.
Any ideas?
Thanks!
--
Nayan Hajratwala
http://agileshrugged.com
734.658.6032