Always get XML responses in FB 4.6
I am working with webservices for iOS, whose request and response are in JSON format. When I access this web service through the Flash constructor, I get an XML response. But running the same app on iOS returns JSON.
private function service_activate(webservices:mx.rpc.http.HTTPService):void{
var args:String=new String("{\"SessionGuid\":\""+sessionid.text +"\"}");
webservices.resultFormat="text";
webservices.contentType="application/json";
webservices.send(args);
}
<fx:Declarations>
<s:HTTPService id="webservice"
url="http://webservices..."
method="POST" contentType="application/x-www-form-urlencoded"
result="webservice_resultHandler(event)"
fault="webservice_faultHandler(event)" />
</fx:Declarations>
Is there a way to get FlashBuilder response as JSON?
+3
source to share
1 answer
Is this a REST service? Is Spring? You can add ".xml" to the end of the url before the parameters:
i.e.
http://localhost/rest/users/byLastName.xml?lastName=Smith
If it's Spring: Take a look and see if ContentNegotiationViewResolver exists in your application context and what media types are defined there.
0
source to share