function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ron WildRon Wild 

Accessing Raw Post Data sent to a Visualforce Page

Does anyone know how to access the raw post data sent to a visualforce page I've exposed through Salesforce Sites?

I need to parse XML that has been posted to the page.

Thanks,


SuperfellSuperfell
AFAIK, you can't, VF can only handle x-www-form-urlencoded or multipart/form-data form posts.
Ron WildRon Wild
That's a drag.  I'm going to have to stick with an off-site xml processor/relay script now - or re-write my application to handle HTML name/value pairs.

If anyone else would like to see access to raw post data enabled in visualforce, please vote for it here:

http://ideas.salesforce.com/article/show/10093914/Enable_Access_to_Raw_Post_Data_in_Visualforce_Pages#skin=adn




hemmhemm
I don't think this has been implemented yet, but just checking.  Any update (or alternative approach) on this?  Would love to run relay scripts for PayPal and Google Checkout notifications on Sites.
Ron WildRon Wild
Checkout my appexchange listing PaymentConnect.  I've done just that. (Just not with raw post data ... don't think that's supported yet).
Message Edited by Ron Wild on 10-08-2009 04:53 PM
hemmhemm

Ron, did you have to change your Google Checkout setup to send HTML name-value pairs? 

 

I actually have a web service method that currently handles notifications from Google Checkout and it's been working for ~6 months.  I am hoping to move the endpoint Google communicates with to Sites, if possible.  Currently, it goes to a PHP script on my server that captures the XML, logs into Salesforce and sends the XML to the Web Service method.  The Apex Web Service method does all the actual work, but is reading XML data.

 

Looking at the HTML Notification API, the difference is that the data gets sent as name/value pairs in HTTP POST data.  Other than that, it seems fine.  I will likely just move to that and access the data using ApexPages.currentPage().getParameters('param1').  Is that what you did?  If so, any gotchas (e.g. escaped characters)?

Ron WildRon Wild

That's what I did with PaymentConnect initially, but getting customers through the install/setup process with external relay scripts

was a real headache.  I switched the Google notification over to NV  pairs, parsed it in the visualforce relay script and replaced the external script as soon as SF made Sites generally available.  It's much easier now.

 

AppExchange developers can build apps on top of PaymentConnect (or just connect them) so you might want to look at that option instead

of rewriting all that code :-) 

D.M.D.M.

Has there been any advance in this area?

 

I would really like to access POST data in my Sites page.