mike gaßmann wrote:
> hi keith
> 
> today i read about your DynamicResponseHandler module for axis2 to get a
> json response.
Nice to hear that.
> 
> i compiled it using maven and deployed it in tomcat and engaged it for
> my service.
You can even download from our maven repository at
http://dist.wso2.org/maven2/org/wso2/dynamicresponse/wso2dynamic-response/SNAPSHOT/
> 
> i configured the messageFormatter and the messageBuilder in axis2.xml
> 
> then i made a GET request via the "POSTER" plugin in firefox.
> the response had content type application/json
Getting a response back as application/json suggest that your formatter
is configured correctly.
> 
> so far, so good.
> 
> the thing is, the response message was empty.
> 
> 
> any idea what went wrong?
> 
> i have 3 parameters in my url for my service (keyword, results, config).
> could there be a problem?
This should not be a problem. But let me give you a hint here, when you
invoke a service as GET the only way that axis2 can dispatch your
request to the correct service and operation is via the URL hence you
should have
/services/<serviceName>/operationName?keyword=keywordValue&results=resultsValue&config=configValue&response=json

Here is an example of this in action.

http://mashups.wso2.org/services/system/digit2image/digit2image?digit=1&size=small&response=json

in the following example the service Name is digit2image and the
operation name is digit2image. This operation expects 2 parameters digit
and size. You can try it out this yourself by accessing the above URL
(Thats a running instance of the WSO2 Mashup Server which is powered by
axis2).

Also I have done some enhancements to this module. I have provided some
mappings in the module.xml file as follows

    <parameter name="mappedjson">application/json</parameter>
    <parameter name="json">application/json/badgerfish</parameter>
    <parameter name="pox">application/xml</parameter>
    <parameter name="soap">application/soap+xml</parameter>

so now you can say ?response=json instead of
?response=application/json/badgerfish

You can define your own mappings here.

Hope this clears things for you and that you will be able to get it working.

Thanks,
Keith.
> 
> thanx for any help,
> mike
> 
> 
> _______________________________________________
> Commons-dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
> 


_______________________________________________
Commons-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev

Reply via email to