Skip to content

Instantly share code, notes, and snippets.

@ryanewtaylor
Created April 13, 2012 15:11
Show Gist options
  • Save ryanewtaylor/2377563 to your computer and use it in GitHub Desktop.
Save ryanewtaylor/2377563 to your computer and use it in GitHub Desktop.
JSON serialization filter to remove the .d from ASP.NET JSON web services
package
{
import com.adobe.serialization.json.JSON;
import mx.rpc.http.AbstractOperation;
import mx.rpc.http.SerializationFilter;
public class JSONSerializationFilter extends SerializationFilter
{
public static const RESULT_FORMAT_JSON:String = "json";
public function JSONSerializationFilter()
{
super();
}
override public function deserializeResult(operation:AbstractOperation, result:Object):Object
{
var o:Object = JSON.decode(String(result));
if (o.hasOwnProperty("d"))
{
return o.d;
}
return o.d;
}
}
}
@bartelink
Copy link

@bartelink
Copy link

@bartelink He's doing it client side in a language where JS inst in play - spend a few more seconds scanning will ya!

@roger-russel
Copy link

Where I have to put it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment