Created
August 19, 2013 18:30
-
-
Save msrivastav13/6272456 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@HttpPost | |
global static string postwebserviceutil() { | |
//Extracting the data from the JSON HTTP request object sent from Timetrade | |
RestRequest req = RestContext.request; | |
RestResponse res=RestContext.response; | |
Blob body=req.requestBody; | |
String jsonToParse=body.toString(); | |
jsonToParse=jsonToParse.replace('class','classx'); //replacing if any keyword found | |
jsonToParse=jsonToParse.replace('limit','limitx'); | |
jsonToParse=jsonToParse.replace('_externalIDs','externalIDs'); | |
//Deserializing the data sent into concrete SFDC objects | |
DeserialisedClass var =(DeserialisedClass)JSON.deserialize(jsonToParse,DeserialisedClass.class); | |
system.debug('value'+var ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment