Some of you may be using my RESTFacade which I wrote and Oracle recently released as sample code on OTN (link).
There has been a couple of requests, or more "how to"s which I thought Id post here.
Adding CORs support is quite straightforward, simply open the web.xml file in the FusionRESTService project and add the following <init-param>
| <init-param> |
This one is a little trickier. The facade uses a collection of static proxies and although I am planning to rewrite the proxies as "dynamic" proxies we're not there yet (and I need to do some reading first).
The only way to use custom fields with the facade today is to regenerate the proxies against your Sales Cloud instance. Here I will go through the steps you will need to do, however in the near future I will release some "scripts" which will do it all for you.
The Facade has all its proxies in projects called "FusionProxy_<Object>Service. Within this project you will find the java classes are split between two packages
Identify the full package name of the proxy for the object you are going to regenerate. In my example here, im going to regenerate the Opportunity object and as you can see the package name is oracle.demo.pts.fusionproxy.opportunities
Shutdown JDeveloper, navigate to the source directory of the proxy project and delete both the src and classes
Startup JDeveloper, navigate to the FusionProxys project , in our case FusionProxy_OpportunityService, you should notice it is now "empty". If it is not the press the refresh button
This will generate the proxy from scratch , just note the generation of the proxy may take some time.
Within here edit the generateClasses script and modify dummy.oracle.com with your hostname for all rows.
open a shell prompt, navigate to this directory using your shell and execute this script. This regenerates all the JAXB objects..
Any questions do ask! and yes as I mentioned earlier I plan to create a script to automate all of this.