I'm passing the JSON in the body of the http POST. The request is being sent using Mule ESB. Here is a log from the sending end.
I've configured the servlet param defaultDataFormat for json. Here is the config from web.xml
Code:
httpclient.wire.header: >> "POST /restapi?gwt.codesvr=127.0.0.1:9997 HTTP/1.1[\r][\n]" httpclient.wire.header: >> "Content-Type: application/x-www-form-urlencoded[\r][\n]" httpclient.wire.header: >> "X-MULE_ENDPOINT: http://127.0.0.1:8888/restapi?gwt.codesvr=127.0.0.1:9997[\r][\n]" httpclient.wire.header: >> "Content-Type: application/json;charset=UTF-8[\r][\n]" httpclient.wire.header: >> "X-MULE_ENCODING: UTF-8[\r][\n]" httpclient.wire.header: >> "X-MULE_ROOT_MESSAGE_ID: 4d39c03e-aa07-11e3-9367-7da4ed667d7b[\r][\n]" httpclient.wire.header: >> "X-MULE_SESSION: rO0ABXNyACNvcmcubXVsZS5zZXNzaW9uLkRlZmF1bHRNdWxlU2Vzc2lvbi7rdtEW7GGKAwAEWgAFdmFsaWRMAA1mbG93Q29uc3RydWN0dAAmTG9yZy9tdWxlL2FwaS9jb25zdHJ1Y3QvRmxvd0NvbnN0cnVjdDtMAAJpZHQAEkxqYXZhL2xhbmcvU3RyaW5nO0wAD3NlY3VyaXR5Q29udGV4dHQAJ0xvcmcvbXVsZS9hcGkvc2VjdXJpdHkvU2VjdXJpdHlDb250ZXh0O3hwAXB0ACQ0ZDNkZGVlZi1hYTA3LTExZTMtOTM2Ny03ZGE0ZWQ2NjdkN2Jwc3IAJWphdmEudXRpbC5Db2xsZWN0aW9ucyRTeW5jaHJvbml6ZWRNYXAbc/kJS0s5ewMAAkwAAW10AA9MamF2YS91dGlsL01hcDtMAAVtdXRleHQAEkxqYXZhL2xhbmcvT2JqZWN0O3hwc3IAJG9yZy5tdWxlLnV0aWwuQ2FzZUluc2Vuc2l0aXZlSGFzaE1hcJ3R2e9nRc4AAwAAeHB3DD9AAAAAAAAQAAAAAXQACkpTRVNTSU9OSUR0AAx6eWJuMmdmMzZ5Njh4cQB+AAl4eA==[\r][\n]" httpclient.wire.header: >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]" httpclient.wire.header: >> "Host: 127.0.0.1:8888[\r][\n]" httpclient.wire.header: >> "Cookie: $Version=0; JSESSIONID=zybn2gf36y68[\r][\n]" httpclient.wire.header: >> "Content-Length: 231[\r][\n]" httpclient.wire.header: >> "[\r][\n]" httpclient.wire.content: >> "{data:{_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:"description",operator:"iContains",value:"TUNIC"},{fieldName:"showNoteCategory",operator:"equals",value:"WEB"}]},dataSource:"Product",operationType:"fetch"}"
Code:
<servlet> <servlet-name>IpRESTHandler</servlet-name> <servlet-class>com.islandpacific.gui.server.IpRESTHandler</servlet-class> <init-param> <param-name>defaultDataFormat</param-name> <param-value>json</param-value> </init-param> <init-param> <param-name>dynamicDataFormatParamName</param-name> <param-value>format</param-value> </init-param> <init-param> <param-name>wrapJSONResponses</param-name> <param-value>false</param-value> </init-param> </servlet>
Comment