X

Angelo Santagata's Blog

Recent Posts

PaaS 4 SaaS

Creating custom Fusion Application User Interfaces using Oracle JET

IntroductionJET is Oracle's new mobile toolkit specifically written for developers to help them build client slide applications using JavaScript. Oracle Fusion Applications implementers are often given the requirement to create mobile, or desktop browser, based custom screens for Fusion Applications. There are many options available to the developer for example Oracle ADF (Java Based) and Oracle JET (JavaScript based). This blog article gives the reader a tutorial style document on how to build a hybrid application using data from Oracle Fusion Sales Cloud Data. It is worth highlighting that although this tutorial is using Sales Cloud, the technique below is equally applicable to HCM cloud, or any other Oracle SaaS cloud product which exposes a REST API.Main ArticlePre-RequisitesIt is assumed that you've already read the getting started guide on the Oracle Jet website and installed all the pre-requisites. In addition if you are to create a mobile application then you will also need to install the mobile SDKs from either Apple (XCode) or Android (Android SDK). You must have a Apple Mac to be able to install the Apple IOS developer kit (XCode), it is not possible to run XCode on a Windows PC Dealing with SaaS SecurityBefore building the application itself we need to start executing the REST calls and getting our data and security is going to be the first hurdle we need to cross.Most Sales Cloud installations allow "Basic Authentication" to their APIs,  so in REST this involves creating a HTTP Header called "Authorization" with the value "Basic <your username:password>" , with the <username:password> section encoded as Base64. An alternative approach used when embedding the application within Oracle SaaS is to use a generated JWT token. This token is generated by Oracle SaaS using either groovy or expression language. When embedding the application in Oracle SaaS you have the option of passing parameters, the JWT token would be one of these parameters and can subsequently be used instead of the <username:password>. When using JWT token the Authorization string changes slightly so that instead of "Basic" it become "Bearer", UsageHeader NameHeader ValueBasic AuthenticationAuthorizationBasic <your username:password base64 encoded>JWT AuthenticationAuthorizationBearer <JWT Token> Groovy Script in SalesCloud to generate a JWT Tokendef thirdpartyapplicationurl = oracle.topologyManager.client.deployedInfo.DeployedInfoProvider.getEndPoint("My3rdPartyApplication" )def crmkey= (new oracle.apps.fnd.applcore.common.SecuredTokenBean().getTrustToken())def url = thirdpartyapplicationurl +"?jwt ="+crmkeyreturn (url)Expression Language in Fusion SaaS (HCM, Sales, ERP etc) to generate a JWT Token#{EndPointProvider.externalEndpointByModuleShortName['My3rdPartApplication']}?jwt=#{applCoreSecuredToken.trustToken}Getting the data out of Fusion Applications using the REST APIWhen retrieving  data from Sales Cloud we need to make sure we get the right data, not too much and not too little. Oracle Sales Cloud, like many other Oracle SaaS products, now supports the REST API for inbound and outbound data access. Oracle HCM also has a REST API but at the time of writing this article, the API is in controlled availability.Looking at the documentation hosted at Oracle Help Center :http//docs.oracle.com/cloud/latest/salescs_gs/FAAPS/ The REST call to get all Sales Cloud Opportunities looks like this :https://yourCRMServer/salesApi/resources/latest/opportunitiesIf you executed the above REST call you will notice that the resulting payload is large, some would say huge. There are good reasons for this, namely that the Sales Cloud Opportunity object contains a large number fields, secondly the result not only contains data but also contains metadata and finally the request above is a select all query. The metadata includes links to child collections, links to List of Values, what tabs are visible in Sales Cloud , custom objects, flexfields etc. Additionally the query we just executed is a the equivalent of a select * from table, i.e. it brings back everything so we'll also need to fix that. Example snippet of a SalesCloud Opportunity REST Response showing custom fields,tabs visible, child collections etc"Opportunity_NewQuote_14047462719341_Layout6": "https://mybigm.bigmachines.com/sso/saml_request.jsp?RelayState=/commerce/buyside/document.jsp?process=quickstart_commerce_process_bmClone_4%26formaction=create%26_partnerOpportunityId=3000000xxx44105%26_partnerIdentifier=fusion%26_partnerAccountId=100000001941037", "Opportunity_NewQuote_14047462719341_Layout6_Layout7": "https://mybigMmachine.bigmachines.com/sso/saml_request.jsp?RelayState=/commerce/buyside/document.jsp?process=quickstart_commerce_process_bmClone_4%26formaction=create%26_partnerOpportunityId=300000060xxxx5%26_partnerIdentifier=fusion%26_partnerAccountId=100000001941037", "ExtnFuseOpportunityEditLayout7Expr": "false", "ExtnFuseOpportunityEditLayout6Expr": "false", "ExtnFuseOpportunityCreateLayout3Expr": "false", "Opportunity_NewQuote_14047462719341_Layout8": "https://mybigm-demo.bigmachines.com/sso/saml_request.jsp?RelayState=/commerce/buyside/document.jsp?process=quickstart_commerce_process_bmClone_4%26formaction=create%26_partnerOpportunityId=300000060744105%26_partnerIdentifier=fusion%26_partnerAccountId=100000001941037", "ExtnFuseOpportunityEditLayout8Expr": "false", "CreateProject_c": null, "Opportunity_DocumentsCloud_14399346021091": "https://mydoccloud.documents.us2.oraclecloud.com/documents/embed/link/LF6F00719BA6xxxxxx8FBEFEC24286/folder/FE3D00BBxxxxxxxxxxEC24286/lyt=grid", "Opportunity_DocsCloud_14552023624601": "https://mydocscserver.domain.com:7002/SalesCloudDocCloudServlet/doccloud?objectnumber=2169&objecttype=OPPORTUNITY&jwt=eyJhxxxxxy1pqzv2JK0DX-xxxvAn5r9aQixtpxhNBNG9AljMLfOsxlLiCgE5L0bAI", "links": [ { "rel": "self", "href": "https://mycrmserver-crm.oracledemos.com:443/salesApi/resources/11.1.10/opportunities/2169", "name": "opportunities", "kind": "item", "properties": { "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000002770400000010737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B020000787200106A6176612E6C616E672E4F626A65637400000000000000000000007870000000017371007E00020000000178" } }, { "rel": "canonical", "href": "https://mycrmserver-crm.oracledemos.com:443/salesApi/resources/11.1.10/opportunities/2169", "name": "opportunities", "kind": "item" }, { "rel": "lov", "href": "https://mycrmserver-crm.oracledemos.com:443/salesApi/resources/11.1.10/opportunities/2169/lov/SalesStageLOV", "name": "SalesStageLOV", "kind": "collection" },Thankfully we can tell the REST API that we :Only want to see the data, achieved by adding onlyData=true parameterOnly want to see the following fields OpportunityNumber,Name,CustomerName (TargetPartyName), achieved by adding a fields=<fieldName,fieldname> parameterOnly want to see a max of 10 rows, achieved by adding the limit=<value> parameterOnly want to see open opportunities, achieved by adding the q= parameter with a query string, in our case StatusCode=OPENIf we want to get the data in pages/blocks we can use the offset parameter. The offset parameter tells the REST service to get the data "from" this offset. Using offset and limit we can effectively page through the data returned by Oracle Fusion Applications REST Service.Our final REST request URL would look like :https://myCRMServeroracledemos.com/salesApi/resources/latest/opportunities?onlyData=true&fields=OptyNumber,Name,Revenue,TargetPartyName,StatusCode&q=StatusCode=OPEN&offset=0&limit=10The Oracle Fusion Applications REST API is documented in the relevant Oracle Fusion Applications Documentation, e.g. for Sales Cloud, http://docs.oracle.com/cloud/latest/salescs_gs/FAAPS/ but it is also worth noting that the Oracle Fusion Applications REST Services are simply an implementation of the Oracle ADF Business Components REST Services, these are very well documented here  https://docs.oracle.com/middleware/1221/adf/develop/GUID-8F85F6FA-1A13-4111-BBDB-1195445CB630.htm#ADFFD53992Our final tuned JSON result from the REST service will look something like this (truncated) :{ "items": [ { "Name": "Custom Sentinel Power Server @ Eagle", "OptyNumber": "147790", "StatusCode": "OPEN", "TargetPartyName": "Eagle Software Inc", "Revenue": 104000 }, { "Name": "Ultra Servers @ Beutelschies & Company", "OptyNumber": "150790", "StatusCode": "OPEN", "TargetPartyName": "Beutelschies & Company", "Revenue": 175000 }, { "Name": "Diablo Technologies 1012", "OptyNumber": "176800", "StatusCode": "OPEN", "TargetPartyName": "Diablo Technologies", "Revenue": 23650 }}Creating the Hybrid ApplicationNow we have our datasource defined we can start to build the application. We want this application to be available on a mobile device and therefore we will create a "Mobile Hybrid" application using Oracle JET, using the --NavDrawer template.yo oraclejet:hybrid OSCOptyList --template=navDrawer --platforms=androidOnce the yeoman script has built your application, you can test the (basic) application using the following two commands.grunt build --platform=android grunt serve --platform=android --web=trueThe second grunt serve command has a web=true parameter at the end, this is telling the script that we're going to be testing this in our browser and not on the device itself. When this is run you should see basic shell [empty] application in your browser window.ForBuilding Our JavaScript UINow that we have our data source defined we can now get onto to task of building the JET User Interface. Previously you executed the yo oraclejet:hybrid command, this created you a hybrid application using a template. Opening the resulting project in an IDE, like NetBeans, we can see that the project template has created a collection of files and that one of them is "dashboard.html" (marked 1 in the image), edit this file using your editor. Within the file delete everything and replace it with this snippet of html code<div class="oj-hybrid-padding"> <div class="oj-flex"> <div class="oj-flex-item"> <button id= "prevButton" data-bind="click: previousPage, ojComponent: { component: 'ojButton', label: 'Previous' }"> </button> <button id= "nextButton" data-bind="click: nextPage, ojComponent: { component: 'ojButton', label: 'Next' }"> </button> </div> </div> <div class="oj-flex-item"> <div class="oj-panel oj-panel-alt1 oj-margin"> <table id="table" summary="Opportunity List" aria-label="Opportunity List" data-bind="ojComponent: {component: 'ojTable', data: opportunityDataSource, columnsDefault: {sortable: 'none'}, columns: [{headerText: 'Opty Number', field: 'OptyNumber'}, {headerText: 'Name', field: 'Name'}, {headerText: 'Revenue', field: 'Revenue'}, {headerText: 'Customer Name', field: 'TargetPartyName'}, {headerText: 'Status Code', field: 'StatusCode'} ]}"> </table> </div> </div></div>The above piece of html adds a JET table to the page, for prettiness we've wrapped the table in a decorative panel and added a next and previous buttons. The table definition tells Oracle JET that the data is coming from a JavaScript object called "opportunityDataSource", it also defines defines the columns, column header text and that the columns are not sortable. The button definitions reference two functions in our JavaScript (to follow) which will paginate the data.Building The logicWe can now move onto the JavaScript side of things, that is the part where we get the data from Sales Cloud and makes it available to the table object in the html file. For this simplistic example we'll get the data direct from Sales Cloud and display it in the table, with no caching and nothing fancy like collection models for pagination .Edit the dashboard.js file, this is marked as 2 in the above image. This file is a RequiresJS AMD (Application Module Definition File) and is pre-populated to support the dashboard.html page.Within this file, cut-n-paste the following JavaScript snippet.define(['ojs/ojcore', 'knockout', 'jquery', 'ojs/ojtable', 'ojs/ojbutton'], function (oj, ko, $) { function DashboardViewModel() { var self = this; var offset = 0; var limit = 10; var pageSize = 10; var nextButtonActive = ko.observable(true); var prevButtonActive = ko.observable(true); // self.optyList = ko.observableArray([{Name: "Fetching data"}]); console.log('Data=' + self.optyList); self.opportunityDataSource = new oj.ArrayTableDataSource(self.optyList, {idAttribute: 'Name'}); self.refresh = function () { console.log("fetching data"); var hostname = "https://yourCRMServer.domain.com"; var queryString = "/salesApi/resources/latest/opportunities?onlyData=true&fields=OptyNumber,Name,Revenue,TargetPartyName,StatusCode&q=StatusCode=OPEN&limit=10&offset=" + offset; console.log(queryString); $.ajax(hostname + queryString, { method: "GET", dataType: "json", headers: {"Authorization": "Basic " + btoa("username:password")}, // Alternative Headers if using JWT Token // headers : {"Authorization" : "Bearer "+ jwttoken; success: function (data) { self.optyList(data.items); console.log('Data returned ' + JSON.stringify(data.items)); console.log("Rows Returned"+self.optyList().length); // Enable / Disable the next/prev button based on results of query if (self.optyList().length < limit) { $('#nextButton').attr("disabled", true); } else { $('#nextButton').attr("disabled", false); } if (self.offset === 0) $('#prevButton').attr("disabled", true); }, error: function (jqXHR, textStatus, errorThrown) { console.log(textStatus, errorThrown); } } ); }; // Handlers for buttons self.nextPage = function () { offset = offset + pageSize; console.log("off set=" + offset); self.refresh(); }; self.previousPage = function () { offset = offset - pageSize; if (offset < 0) offset = 0; self.refresh(); }; // Initial Refresh self.refresh(); } return new DashboardViewModel; });Lets examine the codeLine 1: Here we've modified the standard define so that it includes a ojs/table reference. This is telling RequiresJS , which the JET toolkit uses, that this piece of JavaScript uses a JET Table object Line 8 & 9 : These lines maintain variables to indicate if the button should be enabled or not Line 11: Here we created a variable called optyList, this is importantly created as a knockout observableArray. Line 13: Here we create another variable called "opportunityDataSource", which is the variable the HTML page will reference. The main difference here is that this variable is of type oj.ArrayTableDataSource and that the primary key is OptyNumber Lines 14-47 :  Here we define a function called "refresh". When this javascript function is called we execute a REST Call back to SalesCloud using jquery's ajax call. This call retrieves the data and then populates the optyList knockout data source with data from the REST call. Specifically here note that we don't assign the results to the optyData variable directly but we purposely pass a child array called "items". If you execute the REST call, we previously discussed, you'll note that the data is actually stored in an array called items Line 23 : This line is defining the headers, specifically in this case we're defining a header called "Authorization" , with the username & password formatted as "username:password" and then the base64 encoded. Line 24-25  :These lines define an alternative header which would be appropriate if a JWT token was being used. This token would be passed in as a parameter rather than being hardcoded Lines 31-40 : These query the results of the query and determine if the next and previous buttons should be enabled or not using jQuery to toggle the disabled attribute Lines 50-63 : These manage the next/previous button events Finally on line 65 we execute the refresh() method when the module is initiated.Running the example on your mobileTo run the example on your mobile device execute the follow commandsgrunt build --platform=android grunt serve --platform=androidor if you want to test on a devicegrunt serve --platform=android -destination=[device or emulator name]If all is well you should see a table of data populated from Oracle Sales Cloud For more information on building JavaScript applications with the Oracle JET tool make sure to check out our other blog articles on JET here , the Oracle JET Website here and the excellent Oracle JET You Tube channel hereRunning the example on the browser and CORSIf you try and run the example on your browser you'll find it probably won'twork. If you look at the browser console (control+shift+I on most browsers) you'll probably see that the error was something like "XMLHttpRequest cannot load..." etcThis is because the code has violated "Cross Origin Scripting" rules. In a nut shell "A JavaScript application cannot access a resource which was not served up by the server which itself was served up from".. In my case the application was served up by Netbeans on http://localhost:8090, whereas the REST Service from Sales Cloud is on a different server, thankfully there is a solution called "CORS". CORS stands for Cross Origin Resource Sharing and is a standard for solving this problem, for more information on CORS see this wikipedia article, or other articles on the internet.Configuring CORS in Fusion ApplicationsFor our application to work on a web browser we need to enable CORS in Fusion Applications, we do this by the following steps :1. Log into Fusion Applications (SalesCloud, HCM etc) using a user who has access to "Setup and Maintenance"2. Access setup and Maintenance screens3. Search for Manage Administrator Profile Values and then navigate to that task4. Search for "Allowed Domains" profile name (case sensitive!!).5. Within this profile name you see a profile option called "site", this profile option has a profile value6. Within the profile value add the hostname, and port number, of the application hosting your JavaScript application. If you want to allow "ALL" domains set this value to "*" (a single asterisk )WARNING : Ensure you understand the security implication of allowing ALL Domains using the asterisk notation!7. Save and Close and then retry running your JET Application in your browser.[caption id="attachment_38119" align="alignnone" width="300"] CORS Settings in Setup and Maintenance (Click to enlarge)[/caption]If all is good when you run the application on your browser, or mobile device, you'll now see the application running correctly.[caption id="attachment_38120" align="alignnone" width="300"] Running JET Application (Click to enlarge)[/caption] Final Note on SecurityTo keep this example simple the security username/password was hard-coded in the mobile application, not suitable for a real world application. For a real application you would create a configuration screen, or use system preferences, to collect and store the username , password and the SalesCloud Server url which would then be used in the application.If the JET Application is to be embedded inside a Fusion Applications Page then you will want to use JWT Token authentication. Modify the example so that the JWT token is passed into the application URL as a parameter and then use that in the JavaScript (lines 24-25) accordingly.For more information on JWT Tokens in Fusion Applications see these blog entries (Link 1, Link 2) and of course the documentationConclusionAs we've seen above its quite straightforward to create mobile, and browser, applications using the Oracle JET Framework. The above example was quite simple and only queried data, a real application would also have some write/delete/update operations and therefore you would want to start to look at the JET Common Model and Collection Framework (DocLink) instead. Additionally in the above example we queried data direct from a single SalesCloud instance and did no processing on it.. Its very likely that a single mobile application will need to get its data from multiple data sources and require some backend services to "preprocess" and probably post process the data, in essence provide an API.. We call this backend a  "MBaaS", ie Mobile Backend As A Service, Oracle also provides a MBaaS in its PaaS suite of products and it is called Oracle Product is called "Mobile Cloud Service"..In a future article we will explore how to use Oracle Mobile Cloud Service (Oracle MCS) to query SalesCloud and Service cloud and provide an API to the client which would be using the more advanced technique of using the JET Common Model/Collection framework.  

Introduction JET is Oracle's new mobile toolkit specifically written for developers to help them build client slide applications using JavaScript. Oracle Fusion Applications implementers are...

PaaS 4 SaaS

Accessing Fusion Data from BI Reports using Java

IntroductionIn a recent article by Richard Williams on A-Team Chronicles, Richard explained how you can execute a BI publisher report from a SOAP Service and retrieve the report, as XML, as part of the response of the SOAP call.  This blog article serves as a follow on blog article providing a tutorial style walk through on how to implement the above procedure in Java.This article assumes you have already followed the steps in Richard's blog article and created your report in BI Publisher, exposed it as a SOAP Service and tested this using SOAPUI, or another SOAP testing tool.Following Richards guidance we know that he correct SOAP call could look like this<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://xmlns.oracle.com/oxp/service/PublicReportService"> <soap:Header/> <soap:Body> <pub:runReport> <pub:reportRequest> <pub:reportAbsolutePath>/~angelo.santagata@oracle.com/Bi report.xdo</pub:reportAbsolutePath> <pub:reportRawData xsi:nil="true" >true</pub:reportRawData> <pub:sizeOfDataChunkDownload>-1</pub:sizeOfDataChunkDownload> <pub:flattenXML>true</pub:flattenXML> <pub:byPassCache>true</pub:byPassCache> </pub:reportRequest> <pub:appParams/> </pub:runReport> </soap:Body></soap:Envelope>Tip :One easy way to determine the reports location is to run the report and then examine the URL in the browser. Implementing the SOAP call using JDeveloper 11gWe can now need to implement the Java SOAP Client to call our SOAP Service. For this blog we will use JDeveloper 11g, the IDE recommended for extending Oracle Fusion, however you are free to use your IDE of choice, e.g. NetBeans, Eclipse, VI, Notepad etc, the steps will obviously be different.Creating the projectWithin JDeveloper 11g start by creating a new Application and within this application create two generic projects. Call one project “BISOAPServiceProxy” and the other “FusionReportsIntegration”. The "BISOAPServiceProxy" project will contain a SOAP Proxy we are going to generate from JDeveloper 11g and the "FusionReportsIntegration" project will contain our custom client code. It is good practice to create separate projects so that the SOAP Proxies resides in its own separate project, this allows us to regenerate the proxy from scratch without affecting any other code.Generating the SOAP ProxyFor this example we will be using the SOAP Proxy wizard as part of JDeveloper. This functionality generates a static proxy for us, which in turn makes it easier to generate the required SOAP call later.1. With the BISOAPService project selected, start the JDeveloper SOAP Proxy wizard. File-> New-> Business Tier-> Web Services-> Web Service Proxy 2. Click Next3. Skipping the first welcome screen, in step 2 enter the JAX-WS Style as the type of SOAP Proxy you wish to generate in step 3 enter the WSDL of your Fusion Application BI Publisher webservice WSDL. It’s best to check this URL returns a WSDL document in your web browser before entering it here. The WSDL location will normally be something like : http://<your fusion Applications Server>/xmlpserver/services/ExternalReportWSSService?wsdlIt's recommended that you leave the copy WSDL into project check-box selected.4. Give a package name, unless you need to it's recommended to leave the Root Package for generated types to be left blank5. Now hit FinishFixing the project dependenciesWe now need to make sure that the “FusionReportsIntegration” is able to see classes generated by the  “BISOAPServiceProxy” proxy. To resolve this in JDeveloper we simply need to setup a dependency between the two projects.1. With the FusionReportsIntegration project selected, right-mouse click on the project and select “Project properties”2. In the properties panel select Dependencies3. Select the little pencil icon and in the resulting dialog select “Build Output”. This selection tells JDeveloper that “this project depends on the successful build output” of the other project.4. Save the Dialog 5. Close [OK] the Project Properties dialog6. Now is a good time to hit compile and make sure the SOAP proxy compiles without any errors, given we haven't written any code yet it should compile just fine.Writing the code to execute the SOAP callWith the SOAP Proxy generated, the project dependency setup, we’re now ready to write the code which will call the BI Server using the generated SOAP Proxy1. With the Fusion Reports Integration selected , right mouse Click -> New -> Java -> Java Class ​2. Enter a name, and java package name, for your class3. Ensure that “Main Method” is selected. This is so we can execute the code from the command line, you will want to change this depending on where you execute your code from, e.g. A library, a servlet etc.4. Within the main method you will need to enter the following code snippet, once this code snippet is pasted you will need to correct and resolve imports for your project.1.ExternalReportWSSService_Service externalReportWSSService_Service;2.// Initialise the SOAP Proxy generated by JDeveloper based on the following WSDL xmlpserver/services/ExternalReportWSSService?wsdl3.externalReportWSSService_Service = new ExternalReportWSSService_Service();4.// Set security Policies to reflect your fusion applications5.SecurityPoliciesFeature securityFeatures = new SecurityPoliciesFeature(new String[]6.{ "oracle/wss_username_token_over_ssl_client_policy" });7.// Initialise the SOAP Endpoint8.ExternalReportWSSService externalReportWSSService = externalReportWSSService_Service.getExternalReportWSSService(securityFeatures);9.// Create a new binding, this example hardcodes the username/password, 10.// the recommended approach is to store the username/password in a CSF keystore11.WSBindingProvider wsbp = (WSBindingProvider)externalReportWSSService;12.Map<String, Object> requestContext = wsbp.getRequestContext();13.//Map to appropriate Fusion user ID, no need to provide password with SAML authentication14.requestContext.put(WSBindingProvider.USERNAME_PROPERTY, "username");15.requestContext.put(WSBindingProvider.PASSWORD_PROPERTY, "password");16.requestContext.put(WSBindingProvider.ENDPOINT_ADDRESS_PROPERTY, "https://yourERPServer:443/xmlpserver/services/ExternalReportWSSService");17.// Create a new ReportRequest object using the generated ObjectFactory18.ObjectFactory of = new ObjectFactory();19.ReportRequest reportRequest = of.createReportRequest();20.// reportAbsolutePath contains the path+name of your report21.reportRequest.setReportAbsolutePath("/~angelo.santagata@oracle.com/Bi report.xdo");22.// We want raw data23.reportRequest.setReportRawData("");24.// Get all the data25.reportRequest.setSizeOfDataChunkDownload(-1); 26.// Flatten the XML response27.reportRequest.setFlattenXML(true);28.// ByPass the cache to ensure we get the latest data29.reportRequest.setByPassCache(true);30.// Run the report31.ReportResponse reportResponse = externalReportWSSService.runReport(reportRequest, "");32.// Display the output, note the response is an array of bytes, you can convert this to a String33.// or you can use a DocumentBuilder to put the values into a XLM Document object for further processing34.System.out.println("Content Type="+reportResponse.getReportContentType());35.System.out.println("Data ");36.System.out.println("-------------------------------");37.String data=new String (reportResponse.getReportBytes());38.System.out.println(data);39.System.out.println("-------------------------------");Going through the code LineWhat does it do1-3This is the instantiation of a new class containing the WebService Proxy object. This was generated for us earlier5Initialise a new instance of a security policy object, with the correct security policy, for your Oracle Fusion server . The most common security policy is that of “oracle/wss_username_token_over_ssl_client_policy", however your server maybe setup differently8Calls the factory method to initialise a SOAP endpoint with the correct security features set9-16These lines setup the SOAP binding so that it knows which endpoint to execute (i.e. the Hostname+URI of your webservice which is not necessarily the endpoint where the SOAP Proxy was generated, the username and the password.In this example we are hard coding the details because we are going to be running this example on the command line. If this code is to be  executed on a JEE server, e.g. Weblogic, then we recommend this data is stored in the Credential store as CSF keys.17-19Here we create a reportRequest object and populate it with the appropriate parameters for the SOAP call. Although not mandatory its recommended that you use the objectFactory generated by the SOAP proxy wizard in JDeveloper.21This set the ReportPath parameter, including path to the report23This line ensures we get the raw data without decoration, layouts etc.25By default BI Publisher publishes data on a range basis, e.g. 50 rows at a time, for this usecase we want all the rows, and setting this to -1 will ensure this27Tells the webservice to flatten out the XML which is produced29This is an optional flag which instructs the BI Server to bypass the cache and go direct to the database30This line executes the SOAP call , passing the “reportReport” object we previously populated as a parameter. The return value is a reportResponse object34-39These lines print out the results from the BI Server. Of notable interest is the XML document is returned as a byte array. In this sample we simply print out the results to the output, however you would normally pass the resulting XML into Java routines to generate a XML Document.  Because we are running this code from the command line as a java client code we need to import the Fusion Apps Certificate into the Java Key Store. If you run the code from within JDeveloper then the java keystore is stored in <JDeveloperHome>\wlserver_10.3\server\lib\DemoTrust.jksImporting certificates 1. Download the Fusion Applications SSL certificate, using a browser like internet explorer navigate to the SOAP WSDL URL2. Mouse click on the security Icon which will bring you to the certificate details3. View Certificate 4. Export Certificate as a CER File5. From the command line we now need to import the certificate into our DemoTrust.jks file using the following commandkeytool -import -alias fusionKey -file fusioncert.cer -keystore DemoIdentity.jksNow ready to run the code!With the runReport.java file selected press the “Run” button, if all goes well then the code will execute and you should see the XML result of the BI Report displayed on the console. 

Introduction In a recent article by Richard Williams on A-Team Chronicles, Richard explained how you can execute a BI publisher report from a SOAP Service and retrieve the report, as XML, as part of...

Oracle Fusion Sales Cloud - Payloads

Adding a contact to a sales cloud account

A common question is how do you add a contact to a Account in Sales Cloud? Ive seen developers (including me) try to issue a mergeOrganizaiton on the org, however this is not correct. In Oracle Fusion , Contacts are not "addded" to accounts but they are "related" to accounts.. Therefore to add a contact to a account you need to add a "Relationship" which links the contact and the organization. Here's a sample payloadWSDL<host>/crmCommonSalesParties/RelationshipService?wsdlSOAP Request Payload<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/crmCommon/salesParties/relationshipService/types/" xmlns:rel="http://xmlns.oracle.com/apps/crmCommon/salesParties/relationshipService/">   <soapenv:Header/> <soapenv:Body>      <typ:createRelationship>         <typ:relationship><!-- ContactId -->            <rel:ObjectPartyId>300000000943126</rel:ObjectPartyId><!-- AccountId -->            <rel:SubjectPartyId>300000000943078</rel:SubjectPartyId>            <rel:RelationshipType>CONTACT</rel:RelationshipType>            <rel:RelationshipCode>CONTACT</rel:RelationshipCode>            <rel:CreatedByModule>HZ_WS</rel:CreatedByModule>            <rel:Status>A</rel:Status>         </typ:relationship>      </typ:createRelationship>   </soapenv:Body></soapenv:Envelope>Groovy Script Exampledef addContact =[        ObjectPartyId        : '300000000943126', /*Contact */        SubjectPartyId       : '300000000943078', /*Account */        RelationshipType  : 'CONTACT',        RelationshipCode  : 'CONTACT',        CreatedByModule : 'HZ_WS',        Status  : 'A'];adf.webServices.RelationshipService.createRelationship(addContact);

A common question is how do you add a contact to a Account in Sales Cloud? Ive seen developers (including me) try to issue a mergeOrganizaiton on the org, however this is not correct. In Oracle Fusion...

General

Streamline Oracle Development with Cloud Services

Streamline Java Development with Cloud Services On-Demand Webinar Replay Learn to deliver java applications to market faster.Reduce hardware and software costs for new development and testing environments. Improve DevOps efficiency. Build, test and run enterprise-grade applications in the Cloud and on premise.Listen to this webinar replay with development expert James Governor, co-founder of RedMonk, and Daniel Pahng, President and CEO of mFrontiers, LLC, an ISV with hands-on experience developing enterprise mobility and Internet of Things (IOT) solutions, as they present this webcast on developing applications in the cloud. Listen today! June 2015: Streamline Java Development with Cloud Services On-demand replayMay 2015: Introducing Oracle Documents Cloud Service On-demand ReplayApril 2015: Oracle Developer Cloud Service On-demand replayFor more information: Learn about Oracle's Java Cloud ServicesSubscribe to The Cloud Front blog to keep up to date on Java Cloud Service news, events and success stories!July 2015                                                                                          Oracle Corporation - All rights reserved

Streamline Java Development with Cloud Services On-Demand Webinar Replay Learn to deliver java applications to market faster.Reduce hardware and software costs for newdevelopment and testing...

Oracle Fusion

Calling Fusion SOAP Services from Ruby

Just completed some integration work with a partner of ours using the Ruby language. Given that a lot of startups like Ruby I thought it would be useful to cut-n-paste the sample code here.This example creates a simple (minimal) opportunity using the SOAP API in Sales Cloud. That said the code would be almost identical if you were querying HCM Data,The approach we took here was to prototype the SOAP call using SOAPUI and then cut-n-paste the SOAP payload into the data variable. In a real industrialized solution I'd create the payloads in template form.   def create_opportunity   # Change yourhostname.com to your Fusion SOAP Endpoint Hostname    uri = URI.parse("https://yourhostname.com/opptyMgmtOpportunities/OpportunityService")    http = Net::HTTP.new(uri.host, uri.port)    http.use_ssl = true    path = uri.request_uri    http.read_timeout = 5    http.open_timeout = 5   # Change authorization header to contain Base64encoded string of username/password    headers = {    'Content-Type' => 'text/xml',    'soapAction' => 'http://xmlns.oracle.com/apps/sales/opptyMgmt/opportunities/opportunityService/createOpportunity',    'authorization' => 'Basic bBase64EncodedCredentialHere='    }       # Data Contains the payload    data = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/sales/opptyMgmt/opportunities/opportunityService/types/" xmlns:opp="http://xmlns.oracle.com/apps/sales/opptyMgmt/opportunities/opportunityService/" xmlns:rev="http://xmlns.oracle.com/apps/sales/opptyMgmt/revenues/revenueService/" xmlns:not="http://xmlns.oracle.com/apps/crmCommon/notes/noteService" xmlns:not1="http://xmlns.oracle.com/apps/crmCommon/notes/flex/noteDff/" xmlns:rev1="http://xmlns.oracle.com/oracle/apps/sales/opptyMgmt/revenues/revenueService/" xmlns:act="http://xmlns.oracle.com/apps/crmCommon/activities/activitiesService/">    <soapenv:Header/>    <soapenv:Body>    <typ:createOpportunity>    <typ:opportunity>    <opp:Name>Joel Test New1</opp:Name>    </typ:opportunity>    </typ:createOpportunity>    </soapenv:Body>    </soapenv:Envelope>'    resp, data = http.post(path, data, headers)  end!TIP!A quick test in a SOAP testing tool like JDevelopers Http Analyzer or SOAPUI is a MUST before executing this!

Just completed some integration work with a partner of ours using the Ruby language. Given that a lot of startups like Ruby I thought it would be useful to cut-n-paste the sample code here. This...

Cloud PaaS

URL Encoding and other from Groovy

There are times when you want to execute some code within Groovy which Oracle Sales Cloud's groovy doesn’t like. A very common example is URLEncode and Base64Encoding, however there are many others..Native Groovy supports both base64 encoding/decoding and URL Encoding/Decodinge.g.String encoded = s.bytes.encodeBase64.toString() Alas the groovy interpreter within Sales Cloud doesn’t support either the base64 encoding/decoding classes or the URLEncoding classes. Thankfully there is a an easy workaround, Sales Cloud does support the ability to call a SOAP Service from Sales Cloud and given that many SalesCloud installations will have a Java Cloud SX instance available to them its quite easy to create a Java SOAP Service, deploy it to JCSSX and then call this from Sales Cloud to do the stuff that Sales Cloud’s groovy wont allow you to do.Steps to recreate thisCreate a new Project within your favourite IDE (I use JDeveloper11g for Sales Cloud Development, Netbeans for other stuff)Ensure your project has support for JAX-WS WebServices, within JDeveloper  create a JEE project. Within your project create a new Java class, I’ve called PTSEncoderNow cut and paste the following code into this class, obviously rename the Class name if you havent used the same name as I havepackage oracle.pts.encoder;import java.io.IOException;import java.io.UnsupportedEncodingException;import java.net.URLDecoder;import java.net.URLEncoder;import javax.jws.WebMethod;import javax.jws.WebService;import javax.xml.bind.DatatypeConverter;@WebServicepublic class PTSEncoder {   public PTSEncoder() {       super();   }   /**    *    * @param s - String to be translated    * @return    */ @WebMethod(operationName = "encode")   public String utf8encode(String s) {       String result = "";       try {           result = URLEncoder.encode(s, "UTF-8");           System.out.println("Encoded URL " + result);       } catch (UnsupportedEncodingException e) {           System.err.println(e);       }       return result;   }   /**    *    * @param s - String to be translated    * @param enc - The name of a supported character encoding    * @return    */   @WebMethod(operationName = "encodeWithEncType")   public String ptsEncodeWithEncType(String s, String enc) {       String result = "";       try {           if (enc == null || enc.length() <= 0) {               enc = "UTF-8";           }           result = URLEncoder.encode(s, enc);           System.out.println("Encoded URL " + result);       } catch (UnsupportedEncodingException e) {           System.err.println(e);       }       return result;   }   /**    *    * @param s - String to be translated    * @return    */   @WebMethod(operationName = "decode")   public String ptsDecode(String s) {       String result = "";       try {           result = URLDecoder.decode(s, "UTF-8");           System.out.println("Decoded URL " + result);       } catch (UnsupportedEncodingException e) {           System.err.println(e);       }       return result;   }   /**    *    * @param s - String to be translated    * @param enc - The name of a supported character encoding    * @return    */   @WebMethod(operationName = "decodeWithEncType")   public String ptsDecodeWithEncType(String s, String enc) {       String result = "";       try {           if (enc == null || enc.length() <= 0) {               enc = "UTF-8";           }           result = URLDecoder.decode(s, enc);           System.out.println("Decoded URL " + result);           // String decodedUrl = URLDecoder.decode(encodedUrl, "UTF-8");           //System.out.println("Dncoded URL " + decodedUrl);       } catch (UnsupportedEncodingException e) {           System.err.println(e);       }       return result;   }   /**    * @param s    * @return    * @throws IOException    */ @WebMethod(operationName = "encodebase64")   public String ptsEncodeBase64(String s) throws IOException {               return DatatypeConverter.printBase64Binary(s.getBytes());   }   /**    * @param s    * @return    * @throws IOException    */   @WebMethod(operationName = "decodebase64")   public String ptsDecodeBase64(String s) throws IOException {           String result = new String(DatatypeConverter.parseBase64Binary(s));        return result;   } // Simple tester @WebMethod(exclude = true)   public static void main(String[] args) {       PTSEncoder pTSEncode = new PTSEncoder();       pTSEncode.utf8encode("Angelo Woz here");       pTSEncode.ptsEncodeWithEncType("Angelo Woz Here", "UTF-8");       pTSEncode.utf8encode("------------");       pTSEncode.ptsDecode("Jo was here");       pTSEncode.ptsDecodeWithEncType("Jo Was here", "UTF-8");       try {           System.out.println("Encode Angelo = "+pTSEncode.ptsEncodeBase64("Encode Angelo"));       } catch (IOException e) {           e.printStackTrace();       }   }}For interest I created this class by first creating the methods and then using J Developers wizard to convert a class+methods into a SOAP WebService. This class uses Java annotations which tell at JEE server that most (not all) of these methods are WebService calls. This is done using server side injection at deployment time. If within JDeveloper you created your project as a web/jee project you can simply deploy it as is to your JCSSX, or local WLS Application ServerRight Mouse Click on the Project, deploy to your deployment profileDeploy to Application ServerChoose your application server and deployCheck the deploymentYou can now test the SOAP Service using a SOAP testing tool like Http Analyzer or SOAP UI. The WSDL of the service would be the contextRoot+WebService Name. For JDeveloper this can be found if you right-click on the Webservice Class,Java WebServices Editor and look at the generation options So in my instance the WSDL will be available athttps://<JCSSXServer>.java.us2.oraclecloudapps.com/PTSEncoder/PTSEncoderService?wsdlYou can put this into SOAPUI or Http Analyzer and test awayNow last you can register it in Sales Cloud as a web service and use it from GroovyActivate a Sandbox,  that way you can undo changes if oyu wantNavigate to Application ComposerNavigate to the application you will be using the SOAP WebService from (Common,Sales etc)Select WebServicesEnter a name for the WebService, this name becomes the groovy package nameSecurity None (for testing only)Then finally use the SoapService from any groovy script you desire, remember the Palette helps you find different services registered on you system Sample Groovy Codedef base64result = adf.webServices.PTSBase64.encodebase64("Angelo Woz Here")Final footnoteThis example shows how to execute a base64 encoding externally using Java Cloud ServiceSaaS eXtensions (JCSSX), the example could easily have used Java Cloud Service, or some other Cloud service. More importantly you can code extensions using Java Cloud Service and call them from SalesCloud. Given that most JCSSX instances are going to be co-located within the same datacentre this makes the operation quick, efficient and very flexible!Lastly, the service I deployed didn’t contain any security because it’s a stateless service and ok for anyone to call, that said in a production environment I would still add a medicum of security to the service just to make sure someone doesn’t try and abuse it.AngeloEnjoy!

There are times when you want to execute some code within Groovy which Oracle Sales Cloud's groovy doesn’t like. A very common example is URLEncode and Base64Encoding, however there are many others.. Na...

Oracle Fusion Sales Cloud - Payloads

SalesCloud Payload : How to create a Activity(Task)

From SalesCloud R9 onwards we now have Activities.. Activities can be tasks, appointments etc. Object NameActivityWSDLhttps://<hostname>:443/appCmmnCompActivitiesActivityManagement/ActivityService?wsdlVersion Tested on R9 DescriptionThis payload demonstrates how to create an activity of type TASK, assign a primary lead owner OperationcreateActivity Parameters*RequiredPriorityCode*,StatusCodeActivityContactActivityTypeCode*ActivityFunctionCode*Subject Payload<soapenv:Envelopexmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:typ="http://xmlns.oracle.com/apps/crmCommon/activities/activityManagementService/types/"xmlns:act="http://xmlns.oracle.com/apps/crmCommon/activities/activityManagementService/"xmlns:not="http://xmlns.oracle.com/apps/crmCommon/notes/noteService"xmlns:not1="http://xmlns.oracle.com/apps/crmCommon/notes/flex/noteDff/">  <soapenv:Header/>  <soapenv:Body>     <typ:createActivity>        <typ:activity><!-- Priority = 1,2,3 , high, medium, low -->           <act:PriorityCode>1</act:PriorityCode>           <act:StatusCode>NOT_STARTED</act:StatusCode>           <act:ActivityContact><!-- Primary contact ID-->              <act:ContactId>300000093409168</act:ContactId>           </act:ActivityContact>           <act:ActivityAssignee><!-- Party ID of Assignnee -->              <act:AssigneeId>300000050989179</act:AssigneeId>           </act:ActivityAssignee>           <act:ActivityTypeCode>MEETING</act:ActivityTypeCode>           <act:ActivityFunctionCode>TASK</act:ActivityFunctionCode>                       <act:Subject>Test assign to Matt Hooper forPicard</act:Subject>        </typ:activity>     </typ:createActivity>   </soapenv:Body></soapenv:Envelope>

From SalesCloud R9 onwards we now have Activities.. Activities can be tasks, appointments etc.  Object Name Activity WSDL https://<hostname>:443/appCmmnCompActivitiesActivityManagement/ActivityService?wsdl...

Oracle Fusion Sales Cloud - Payloads

Creating Sales Cloud Opportunity

Common Payload creating opportunities   <createOpportunity>    <opportunity>      <ChildRevenue>        <ProdGroupId>300000000537006</ProdGroupId>        <RevnAmount>45000.0</RevnAmount>        <ResourcePartyId>300000000519815</ResourcePartyId>      </ChildRevenue>      <SalesStageId>300000000157471</SalesStageId>      <Comments>Provide training to 250 salespersons and support staff</Comments>      <EffectiveDate>2012-09-30</EffectiveDate>      <WinProb>5.0</WinProb>      <Name>New Sales Training</Name>      <OptyCreationDate>2012-08-27T00:00:00.000</OptyCreationDate>      <TargetPartyId>300000001025130</TargetPartyId>      <OwnerResourcePartyId>300000000519815</OwnerResourcePartyId>      <OpportunityResource>        <ResourceId>300000000519815</ResourceId>        <OwnerFlag>true</OwnerFlag>      </OpportunityResource>    </opportunity>  </createOpportunity> Sample Java Code 1. Generate Proxy using Java Tooling (like JDeveloper)2. Java Code Snippet public static void main(String[] args) {         // Default Values        String username = "matt.hooper";        String password = "somepassword";        String SSLSecurityPolicy = "oracle/wss_username_token_over_ssl_client_policy";         SecurityPolicyFeature[] securityFeature = new SecurityPolicyFeature[] { new    SecurityPolicyFeature(SSLSecurityPolicy) };         String url="https://<yourhost>/opptyMgmtOpportunities/OpportunityService?WSDL";        // Setup the webservice interface        OpportunityService_Service opportunityService_Service = new opportunityService_Service();        OpportunityService opportunityService = opportunityService_Service.getopportunityServiceSoapHttpPort(securityFeature);        // Get the request context to set the outgoing addressing properties        WSBindingProvider wsbp = (WSBindingProvider)opportunityService;        Map<String, Object> requestContext = wsbp.getRequestContext();        requestContext.put(WSBindingProvider.USERNAME_PROPERTY, username);        requestContext.put(WSBindingProvider.PASSWORD_PROPERTY, password);        requestContext.put(WSBindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);        System.out.println("Example of creating an opportunity ");         // Create Payload                ObjectFactory factory = new ObjectFactory();        opportunity newopportunity=factory.createopportunity();        newOpportunity.setName("Name of Opportunity");        // Set other values        //        Opportunity result=opportunity.createOpportunity();        // and so on

Common Payload creating opportunities   <createOpportunity>     <opportunity>       <ChildRevenue>         <ProdGroupId>300000000537006</ProdGroupId>         <RevnAmount>45000.0</RevnAmount>       ...

Oracle Fusion Sales Cloud - Payloads

Sample Payload : Creating a Lead

Very common operation  Object Name Lead Version Tested on R9  Description This payload demonstrates how to create a salesLead, assign a primary lead owner AND add additional resources to the lead Operation createSalesLead  Parameters*Required Name*StatusCodeCustomerIdResourceIdPrimaryFlag  Payload <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/marketing/leadMgmt/leads/leadService/types/"xmlns:lead="http://xmlns.oracle.com/oracle/apps/marketing/leadMgmt/leads/leadService/"xmlns:lead1="http://xmlns.oracle.com/apps/marketing/leadMgmt/leads/leadService/">   <soapenv:Header/>   <soapenv:Body>      <typ:createSalesLead>         <typ:salesLead>            <lead:Name>gold2 - cust</lead:Name>            <lead:StatusCode>UNQUALIFIED</lead:StatusCode>            <lead:CustomerId>100000000055319</lead:CustomerId>            <!--PartyID of person you want to assign it to-->            <lead:OwnerId>300000000629932</lead:OwnerId>            <lead:MklLeadResources>        <!-- ResourceID is PartyID of additional Resource -->               <lead1:ResourceId>300000000623680</lead1:ResourceId>               <lead1:PrimaryFlag>false</lead1:PrimaryFlag>            </lead:MklLeadResources>         </typ:salesLead>      </typ:createSalesLead>   </soapenv:Body></soapenv:Envelope>

Very common operation  Object Name Lead Version Tested on R9  Description This payload demonstrates how to create a salesLead, assign a primary lead owner AND add additional resources to the lead Operation cre...

Cloud PaaS

Getting inaccessible URL when executing REST calls within JCSSX????

Recently I was coding up a REST client for use with Oracle Documents Cloud, using Jersey REST client, and it needed to be deployed to Oracle Java Cloud SX (aka JCSSX). The client code worked perfectly on a local Weblogic 11g but when deployed to the JCSSX instance it would give the following error : java.lang.RuntimeException:java.security.AccessControlException: access denied ("java.net.SocketPermission""partners-pts.documents.us2.somecloud.com:443","connect,resolve") Initially I was convinced that this was some sort of networking issue in JCSSX, I.e. it couldn't connect to the documents cloud server via the network.. I even tried manually setting the proxy in the Java Code all to no avail.. After quite a while looking I discovered the problem... This is the detailed error message I got : Caused by: java.security.AccessControlException: access denied ("java.net.SocketPermission" "partners-pts.documents.us2.somecloud.com:443" "connect,resolve")at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)at java.security.AccessController.checkPermission(AccessController.java:559)at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at java.lang.SecurityManager.checkConnect(SecurityManager.java:1051)at sun.net.www.http.HttpClient.openServer(HttpClient.java:510)at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1300)at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)... 81 more The bold bits hint at the issue.. For some reason my code was using the Sun HTTP Handler which isn't supported on the JCSSX stack but I hadnt configured it to use the Sun Http Handler...You can get your code to use the Sun Http Handler by either setting the system property "UseSunHttpHandler=true" in code or by using Oracle Cloud SDK to set it as a system property. To check if you have the UseSunHttpHandler set, issue the following command (changing your JCSSX details)  javacloud list-system-properties -user <username> -p <password> -id <identityDomain>-si  <serverInstance> -httpproxy <httpProxy:port> -datacenter <dataCenterName> If you have the UseSunHttpHander set to true, or even present, then remove it! Someone had set it in my instance but none of my team members would admit to it.....  javacloud delete-system-property -user <username> -p <password> -id <identityDomain>-si  <serverInstance> -httpproxy <httpProxy:port> -datacenter <dataCenterName> -name UseSunHttpHandler Restart your instance and all should then be well. We've logged an enhancement request to get JCSSX to ignore this specific system property but just incase you hit it before the ER hits the JCSSX servers.

Recently I was coding up a REST client for use with Oracle Documents Cloud, using Jersey REST client, and it needed to be deployed to Oracle Java Cloud SX (aka JCSSX). The client code worked perfectly...

Oracle Fusion

Getting Started with Oracle Fusion Cloud Integrations

Updated: 4-May-2015 Hey all, If your getting started with integrating your application with Oracle Fusion Cloud then I wholeheartedly recommend you read the following resources before starting.. Most of the below is specific to Oracle Sales Cloud because it has App Composer, however much of the below is also applicable to HCM, ERP and other Fusion products..  Some of these are a MUST have read before you start integrating/coding/customizing :-) I've put them here in the order I think would work for most people... Kinda like a getting started check-list I consider this blog entry an living blog entry, in that  I'll be updating it on a regular basis, so make sure you periodically check this location  Top 5 Fusion Integrations Must Reads  1. Familiarise yourself with the Sales Cloud Documentation. Specifically : Go through the "User" section, documents like "Using Sales Cloud", "book. If your a techie like me you'll sit there and think, "Hey this is functional why do I need to read this?", well you do.. Even as a technical person, reading through the various user documents like the Using Sales Cloud" bits as an end user helps you understand what the different concepts/topics are.. You'll also understand things like the difference between a Prospect and a Sales Account, territories, assessments and much more.. Its worth a quick read, but do make sure you have a functional consultant to hand to make sure your not building something which can be done by configuration.... Read through all the books in the "Extensibility" section. The only anomaly here is the "Business Card Scanner mobile App" document. Its a walk-through of how to integrate Sales Cloud with a 3rd party Service to do business card scanning with MAF... Id leave that till last... Peruse the Development section, this section contains a number of example use-cases, ie how to create a customer in R8, how to call an outbound service, its a good read.... 2. Get an overview of the tasks you might do... Once you've this then look at the "Tasks" section of the docs....Here the curriculum development folk have categorised some of the most common tasks and put short cuts to the documentation detailing how to do this.. e.g. like adding a field to Sales Cloud, calling a soap webservice etc 3. Are you going to be customizing the SalesCloud User Interface? Many Sales Cloud integrations involve customizing the Sales Cloud User Interface. The customization could be as simple as adding a few fields to a standard object (like Opportunity), creating new objects (like MyOrder), validation or adding external content to one or many pages. If your adding fields make sure you read the "Introduction to SalesCloud Customizations" section. If you will be adding validation, triggers or calling webservices from Sales Cloud then make sure you read up on groovy scripting, and specifically the chapter on calling outbound SOAP webservices from groovy. Make sure you understand the difference between calling a SOAP Service from groovy and creating an outbound webservice call using object workflows.  In a nutshell , calling SOAP Services from groovy is a synchronous call, and calling a SOAP Service from a object workflow is a fire-and-forget asynchronous call If you need to make sure an outbound webservice call is executed successfully then call the outbound webservice from a groovy script and surround it with an exception handler to catch any errors On the subject of groovy be aware that in Sales Cloud you do not have access to the entire groovy language, thus make sure you understand that we only support a number of groovy functions (white-listing) and these are documented at the end of the book , Appendix A Supported Groovy Classes and Methods 4. Are you going to be accessing data from SalesCloud from the external app?? If you think you will be calling SOAP WebServices in Sales Cloud then the "Getting started with WebServices" is a MUST read...  This doc goes into details into how to look up the SOAP webservice in Fusion OER, how to create static proxies, querying data and how to perform CRUD operations... Get to know Oracle Fusion OER,, its a gold mine of information....... Read Arvinds ( A-Team Chronicles Blog ) excellent "Invoking Sales Cloud SOAP Services from external Applications (part 1)" blog entry. This blog entry describes the steps aronud looking up a SOAP service (ie Opportunities) and then how to create a SOAP JAX-WS static proxy using JDeveloper11g. I personally would the JAX-WS Proxy approach (vs the Data Control) and then building Java code around this to support your application. 5. Do you need your app to know who is calling it?  Many integrations involve embedding a 3rd party web app into Oracle Sales Cloud as an iFrame or pressing a button in SalesCloud and calling the 3rd party app (either a UI or WebService call) . If your doing this then you'll almost certainly need to pass a "token" to the 3rd party application so it can use that it can call back to Sales Cloud with a key rather than a plain text username/password combo.. We call this key JWT TOKEN and its based on industry standards (http://jwt.io/) .  For a starters read my JWT Getting started blog  entry and then use the links to read the core documentation That covers the top 5 areas of integration.. Now for a list of locations where you can get even MORE useful information : More Information Oracle Learning Centres Quick Webinars on SalesCloud Integration I worked with Development to get this mini tutorial series done, its excellent but Im obviously not biased eh  ;-)  R9 Simplified WebServices doc This is a new document we recently completed based on how to use the new R9 Simplified SOAP TCA Services..  Although the document is targetted at R9 developers, it covers many of the standard topics like how to create a proxy, how to create a create operation etc.. It even has some sample CRUD payloads which are really really useful  Oracle Fusion Developer Relations Good friends of mine, they host a fantastic blog, youtube channel and whitepapers for Fusion Developers, another gold mine of information covering customization , extensions and integration code. Oracle Fusion Developer Relations Youtube channel : Not content with an awesome blog the Developer Relations folk even have a you tube channel where they host a collection of short "tutorials", showing all sorts such as "How to add a field to a page" , " How to call a webservice" etc.. Oracle Fusion Developer Relations Whitepapers And finally there is my humble blog (which you are reading now) where I try and blog on things which aren't documented anywhere else.. If they are documented and are interesting I often link to it.. mainly because I want to find it myself :-) Thats it folks! If there are blog entries you'd like to see, or specific how to's, then feel free to contact me at angelo.santagata@oracle.com Angelo 

Updated: 4-May-2015 Hey all, If your getting started with integrating your application with Oracle Fusion Cloud then I wholeheartedly recommend you read the following resources before starting.. Most of...

Got problems with Nulls with ServiceCloud's objects in REST?

Using Oracle RightNow, Jersey 1.18, JAX-WS, JDeveloper 11.1.1.7.1 Whilst trying to creating a REST interface to our RightNow instance for a mobile application I was hitting an issue with null values being rendered by Jersey (Jackson) The way I access RightNow is via JAX-WS  generated proxies which generates JAXB Objects. In the past I've been able to simply return the JAXB object to Jersey and it gets rendered all lovely jubbly.. However with the RightNow WSDL I'm getting lots of extra (null) fields rendered.. This doesn't occur with Sales Cloud so I'm assuming its something to do with the WSDL definition.. { "incidents" : [{"Asset" : null, "AssignedTo" : {"Account" : null, "StaffGroup" : {"ID" : {"id" : 100885},"Name" : "B2CHousewares"},"ValidNullFields" : null},"BilledMinutes" : null, "Category" : {"ID" : {"id" : 124},"Parents" : [{..... Look at all those "null" values, yuck... Thankfully I found a workaround (yay!), I simply needed to create a custom Object Mapper and tell it *not* to render nulls. This worked for both the JAXB objects which were generated for me and other classes Simply create a class which overrides the normal object Mapper factory and to make sure its used, ensure the @Provider tag is present package myPackage;import javax.ws.rs.ext.ContextResolver;import javax.ws.rs.ext.Provider;import org.codehaus.jackson.map.DeserializationConfig;import org.codehaus.jackson.map.ObjectMapper;import org.codehaus.jackson.map.SerializationConfig;import org.codehaus.jackson.map.annotate.JsonSerialize;@Providerpublic class CustomJSONObjectMapper implements ContextResolver<ObjectMapper> { private ObjectMapper objectMapper; public CustomJSONObjectMapper() throws Exception { System.out.println("My object mapper init"); objectMapper= new ObjectMapper(); // Force all conversions to be NON_NULL for JSON objectMapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL); } public ObjectMapper getContext(Class<?> objectType) { System.out.println("My Object Mapper called"); return objectMapper; }} And the result is lovely.. No null values and ready for my mobile app to consume ....  {"organization" : [{"id" : {"id" : 68},"lookupName" : "AngieSoft", "createdTime" : 1412166303000, "updatedTime" : 1412166303000, "name" : "AngieSoft", "salesSettings" : {"salesAccount" : {"id" : {"id" : 2}},"totalRevenue" : {"currency" : {"id" : {"id" : 1}}}},"source" : {"id" : {"id" : 1002},"parents" : [{"id" : {"id" : 32002}}]},"crmmodules" : {"marketing" : true, "sales" : true, "service" : true}}]} Oh heads up Im using Jersey 1.18 because I want to deploy it to Oracle Java Cloud Service, if your using Jersey 2.x I believe the setSerializationInclusion method has changed..

Using Oracle RightNow, Jersey 1.18, JAX-WS, JDeveloper 11.1.1.7.1 Whilst trying to creating a REST interface to our RightNow instance for a mobile application I was hitting an issue with null values...

Oracle Fusion

Oracle Applications Cloud Release 8 User Experience Rapid Development Kit

Good resources from the UX Team If you’re building or integrating the Oracle Applications Cloud or building SaaS through PaaS, use the User Experience Rapid Development Kit laid out here to get the guidance you need and point you to the right tools to use. The Oracle Applications User Experience team has released a User Experience Rapid Development Kit on simplified user interface (UI), the same user experience design in Oracle Applications Cloud release 8. The kit is designed to help Oracle ADF developers get up to speed quickly so they can start designing and building the Oracle Applications Cloud simplified UIs, which are the tablet-friendly UIs for Oracle Sales Cloud and Oracle HCM Cloud, in a matter of hours. The User Experience Rapid Development Kit contains the following tools: Coded ADF page templates. Coding tips from Oracle’s developers. ADF screen overlays showing the use of components in the simplified UI. An eBook on user experience (UX) design patterns and guidelines(right), and example wireframe stencils of page types and components in Microsoft Visio and Balsamiq Mockups formats. Sample wireframe of a simplified UI page flow. How would you like to get started? Tell me more about the simplified user interface for Oracle Applications Cloud. Show me demos of simplified UI in the Oracle Applications Cloud. Oracle HCM Cloud. Oracle Sales Cloud Admin UI What’s coming next in the Oracle Applications Cloud user experience? Start Designing and Building a Simplified User Interface Designing the Oracle Applications Cloud Simplified User Interface with Oracle ADF: Simple to Use, Simple to Build oWireframes stencils in Balsamiq and Visio oWireframe example oSimplified User Experience Design Patterns eBook Oracle Technology Network code samples includes Rich UI with Data Visualization Components and JWT UserToken validation extending Oracle Sales Cloud oRequires JDeveloper (11.1.1.7.1) Overview of Oracle ADF Components Used to Create the Oracle Applications Cloud Simplified UI 11 Coding Best Practices for the Oracle Applications Cloud Simplified UI Using Oracle ADF Developers Toolkit Review: The Resources You Need to Design & Code Your Own Simplified UI for the Oracle Applications Cloud Learn more Become a UX developer guru. Follow the UsableApps blog to see what’s next for applications cloud developers. See where Oracle Applications Cloud user experiences are going next. Share your design with us on Twitter: @usableapps. Check our Events pages and meet up with us at a conference near you.

Good resources from the UX Team If you’re building or integrating the Oracle Applications Cloud or building SaaS through PaaS, use the User Experience Rapid Development Kit laid out here to get the...

Oracle Fusion

Fusion Developer Relations Resources - A must have for Sales Cloud integrators

All, Full Disclosure I received this from an email from Apps Developer Relations but its soooo good I wanted to share it with all. Bottom line if your integrating your product/package/system with Sales Cloud after you've perused the standard documentation (which we are evolving rapidly) this is a treasure trove of articles/blogs/viewlets you can use..  Obviously use this in conjunction with the standard Oracle Cloud Documentation (http://docs.oracle.com/cloud/latest/salescs_gs/index.html)  Enjoy! Title: Introducing the Oracle Fusion Applications Developer Relations Team Abstract: You’ll find a wealth of resources and hands-on expertise available from the Oracle Fusion Applications Developer Relations Team. : If you are evaluating or designing customizations and extensions for your Fusion Applications environment (SaaS or On-Premises) then you’ll find a wealth of resources and hands-on expertise available from this Oracle group. The team was formed to help customers and partners be successful with their development projects using the Fusion Applications platform, and provide the following publically available services: An extensive Blog Site with over 150 articles covering many types of customization, extension, and integration. An open Forum Site for technical questions from the development community. A popular YouTube Channel with over 100 bite-size videos demonstrating a broad range of customization and extension features. Whitepapers on topics including custom application development, ESS development, and Groovy and Expression Language. So check out their resources or get in touch, and make your own development project tasks a little easier.

All, Full Disclosure I received this from an email from Apps Developer Relations but its soooo good I wanted to share it with all. Bottom line if your integrating your product/package/system with Sales...

Oracle Fusion

Using SalesCloud RESTFacade with Custom Fields & CORS support

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. How to add CORS support (Cross Origin Resource Sharing) support How to use the facade with custom fields defined in AppComposer How to add CORS support (Cross Origin Resource Sharing) support  Adding CORs support is quite straightforward, simply open the web.xml file in the FusionRESTService project and add the following <init-param> <init-param> <paramname>com.sun.jersey.spi.container.ContainerResponseFilters</param-name><param-value>oracle.fusion.pts.ResponseCorsFilter</param-value></init-param> Simples :-) How to use the facade with CustomFields 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. 1. Identify the correct package name 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 com.oracle.xmlns : This contains all the standard generated types oracle.demo.pts.fusionproxy.<objectName> : This one contains the proxy itself 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  2. Delete the contents of the proxy directory. 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 4.  Regenerate the proxy from scratch Select the project, right mouse click and select new... Select "Web Service proxy" from the Web Services Categories.. If it doesnt show try typing it in the search  dialog Enter the appropriate WSDL Document. This is the Hostname of your service + Endpoint URL. You can get this information from the fusionconfig.properties file.E.g. For opportunities it is https://<hostname>/opptyMgmtOpportunities/OpportunityService?wsdlHint: Check it works in a webbrowser first! Next, Wait a bit.... For the package name, use the name you identified in step 1, for the Root Package leave it blank Un-Select "Generate As Async" Next Next Select "Don't generate any asynchronous methods" Next  Select "Oracle/wss_username_token_over_ssl_client_policy" Next, then Finish This will generate the proxy from scratch , just note the generation of the proxy may take some time.  5. Go to the XJS_Beans project 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.. 6. Finally do a Build/Clean All followed by a Build/Make and deploy as normal Any questions do ask! and yes as I mentioned earlier I plan to create a script to automate all of this. 

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. How...

Oracle Fusion

Common usecases and techniques when integrating a 3rd party application with Oracle Sales Cloud

Over the last year or so I've see a lot of partners migrating and integrate their applications with Oracle Sales Cloud. Interestingly I'd say 60% of the partners use the same set of design patterns over and over again. Most of the time I see that they want to embed their application into Oracle Sales Cloud, within a tab usually, perhaps click on a link to their application (passing some piece of data + credentials) and then within their application update sales cloud again using webservices. Here are some examples of the different use-cases I've seen , and how partners are embedding their applications into Sales Cloud, NB : The following examples use the "Desktop" User Interface rather than the Newer "Simplified User Interface", I'll update the sample application soon but the integration patterns are precisely the same Use Case 1 :  Navigator "Link out" to third party application This is an example of where the developer has added a link to the global navigator and this links out to the 3rd Party Application. Typically one doesn't pass any contextual data with the exception of perhaps user credentials, or better still JWT Token. Techniques Used   Adding Link to Menu Item Using JWT Token in Sales Cloud Use Case 2 : Application Embedded within the Sales Cloud Dashboard Within the Oracle Sales Cloud application there is a tab called "Sales", within this tab its possible to embed a SubTab and embed a iFrame pointing to your application. To do this the developer simply needs to edit the page in customization mode, add the tab and then add the iFrame, simples! The developer can pass credentials/JWT Token and some other pieces of data but not object data (ie the current OpportunityID etc)  Techniques Used Adding a page to the dashboard  Using JWT Token in Sales Cloud  Use Case 3 : Embedding a Tab and Context Linking out from a Sales Cloud object to the 3rd party application In this usecase the developer embeds two components into Oracle Sales Cloud. The first is a SubTab showing summary data to the user (a quote in our case) and then secondly a hyperlink, (although it could be a button) which when clicked navigates the user to the 3rd party application. In this case the developer almost always passes context specific data (i.e. the opportunityId) and a security token (username password combo or JWT Token). The third party application usually takes the data, perhaps queries more data using the Sales Cloud SOAP/WebService interface and then displays the resulting mashup to the user for further processing. When the user has finished their work in the 3rd party application they normally navigate back to Oracle Sales Cloud using what's called a "DeepLink", ie taking them back to the object [opportunity in our case] they came from. This image visually shows a "Happy Path" a user may follow, and combines linking out to an application , webservice calls and deep linking back to Sales Cloud. Techniques Used Extending a SalesCloud application with a custom button Using JWT Token in Sales Cloud Extending Oracle Sales Cloud [Opportnity] with a custom tab exposing External Content Retrieving Data from Oracle Sales cloud using WebServices Coding some groovy script to generate the URLs required (Doc 1571200.1 on MyOracle Support) DeepLinking to specific Oracle Sales Cloud Pages (Doc 1516151.1 on My Oracle Support) Use-Case 4 :  Server Side processing/synchronization This usecase focuses on the Server Side processing of data, in this case synchronizing data. Here the 3rd party application is running on a "timer", e.g. cron or similar, and when triggered it queries data from Oracle Sales Cloud, then it queries data from the 3rd party application, determines the deltas and then inserts the data where required. Specifically here we are calling Oracle Sales Cloud using SOAP/WebServices and the 3rd party application is being communicated to using the REST API, for Oracle Sales Cloud one would use standard JAX-WS WebService calls and for REST one would use the JAX-RS api and perhap the Jackson api for managing JSON objects.. This is a very common use case and one which specifically lends itself to using the Oracle Java Cloud Service as the ideal application server where to host the mediator between the two applications.  Techniques Used Using JWT Token in Sales Cloud Integrating with the Oracle Java Cloud Service Retrieving Data from Oracle Sales cloud using WebServices General Resources The above is just a small set of techniques and use-cases which are used today. There are plenty of other sources of documentation and resources available on the internet but to get you started here are a few of my favourite places  Sales Cloud General Documentation Sales Cloud Customize Tab is useful for general customization of Sales Cloud Sales Cloud Integration Tab focuses on the 3rd party integration techniques  Official Oracle Fusion Developer Relations Blog Official Oracle Fusion Developer Relations YouTube Channel Enjoy integrating! 

Over the last year or so I've see a lot of partners migrating and integrate their applications with Oracle Sales Cloud. Interestingly I'd say 60% of the partners use the same set of design patterns...

Oracle Fusion

How to restrict data coming back from a SOAP Call

In sales cloud a big positive of the SOAP interface is thatlots of related data is returned by issuing a single query, includingmaster-detail data (ie multiple email addresses in contacts) however thesepayloads can be very very large, e.g. In my system querying singleperson you get 305 Lines(!), whereas I only want the firstName,LastName and partyIdwhich is 3 lines per record.. Solution For each findCriteria element you can add multiple<findAttribute> element indicating what elements you want to return. Bydefault if you provide <findAttribute> entries then only those attributesare returned, and this functionality can be reversed by setting the<excludeAttributes> to true. Example 1 :  only retrieving PersonLastName,PersonFirstName,PartyId <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/cdm/foundation/parties/personService/applicationModule/types/" xmlns:typ1="http://xmlns.oracle.com/adf/svc/types/">    <soapenv:Header/>    <soapenv:Body>       <typ:findPerson>          <typ:findCriteria xsi:type="typ1:FindCriteria" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">                 <typ1:fetchStart>0</typ1:fetchStart>                 <typ1:fetchSize>100</typ1:fetchSize> <typ1:findAttribute>PersonLastName</typ1:findAttribute>                 <typ1:findAttribute>PersonFirstName</typ1:findAttribute>                 <typ1:findAttribute>PartyId</typ1:findAttribute>             <typ1:excludeAttribute>false</typ1:excludeAttribute>          </typ:findCriteria>       </typ:findPerson>    </soapenv:Body> </soapenv:Envelope> Notes findAttributes work on the level1 attributes of that findCriteria, the value can be a attribute or an element If you want to restrict SubElements you can use childFindCriterias for that subelement and then add findAttributes within that Example 2 :  Only Retrieving PartyId, and withinEmail element only EmailAddress      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/cdm/foundation/parties/personService/applicationModule/types/" xmlns:typ1="http://xmlns.oracle.com/adf/svc/types/">    <soapenv:Header/>    <soapenv:Body>       <typ:findPerson>          <typ:findControl>             <typ1:retrieveAllTranslations/>          </typ:findControl>          <typ:findCriteria xsi:type="typ1:FindCriteria" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">             <typ1:fetchStart>0</typ1:fetchStart>             <typ1:fetchSize>100</typ1:fetchSize> <typ1:findAttribute>PartyId</typ1:findAttribute>             <typ1:findAttribute>Email</typ1:findAttribute>             <typ1:excludeAttribute>false</typ1:excludeAttribute> <typ1:childFindCriteria>                <typ1:fetchStart>0</typ1:fetchStart>                <typ1:fetchSize>10</typ1:fetchSize> <typ1:findAttribute>EmailAddress</typ1:findAttribute>                <typ1:excludeAttribute>false</typ1:excludeAttribute>                <typ1:childAttrName>Email</typ1:childAttrName> </typ1:childFindCriteria>          </typ:findCriteria>       </typ:findPerson>    </soapenv:Body> </soapenv:Envelope> Notes For a childFindCriteria to work you must query it in the parent, which is why “Email” is referenced in a findAttribute on line 14

In sales cloud a big positive of the SOAP interface is that lots of related data is returned by issuing a single query, includingmaster-detail data (ie multiple email addresses in contacts) however...

Oracle Fusion

Inserting a interaction into Sales Cloud using Java

Hey all, Quick snippet of code showing how to create an interaction for an opportunity using Java. This is only a snippet, I assume/note : You've already created a Web-service proxy for the Interaction Service  (ie http://host/appCmmnCompInteractions/InteractionService) and added it to the project dependencie You've tested a simple getInteraction() works fine If you run standalone Java client, then make sure you import the Sales Cloud certificates into your keystore If you run this as within Weblogic Server then the step of importing the Sales Cloud certificates isn't require Tested and works on Sales Cloud R7 XML Payload is shown at the end This is sample code Java package oracle.fusion.pts.samples.clients;import com.oracle.xmlns.apps.crmcommon.interactions.interactionservice.Interaction;import com.oracle.xmlns.apps.crmcommon.interactions.interactionservice.InteractionAssociation;import com.oracle.xmlns.apps.crmcommon.interactions.interactionservice.InteractionParticipant;import com.oracle.xmlns.apps.crmcommon.interactions.interactionservice.ObjectFactory;import com.sun.xml.ws.api.addressing.AddressingVersion;import com.sun.xml.ws.developer.WSBindingProvider;import java.util.Date;import java.util.GregorianCalendar;import java.util.Map;import javax.xml.datatype.DatatypeConfigurationException;import javax.xml.datatype.DatatypeFactory;import javax.xml.ws.WebServiceRef;import oracle.pts.fusion.samples.interaction.InteractionService;import oracle.pts.fusion.samples.interaction.InteractionService_Service;import oracle.pts.fusion.samples.interaction.ServiceException;import weblogic.wsee.jws.jaxws.owsm.SecurityPolicyFeature;public class createInteraction { @WebServiceRef //Define the security policy private static final SecurityPolicyFeature[] securityFeature = new SecurityPolicyFeature[] { new SecurityPolicyFeature("oracle/wss_username_token_over_ssl_client_policy") }; private static final AddressingVersion WS_ADDR_VER = AddressingVersion.W3C; public static void main(String[] args) { // Default Values String username = "matt.hooper"; String password = "somepassword"; String url="https://yourhost:443/appCmmnCompInteractions/InteractionService"; // Sample data, in a real system these would be either parameters to the function or queried as part of the code Long participantPartyId = new Long("100000000099058"); String opportunityId="300000000667205"; Long customerId= new Long("300000000592745"); // Setup the webservice interface InteractionService_Service interactionService_Service = new InteractionService_Service(); InteractionService interactionService = interactionService_Service.getInteractionServiceSoapHttpPort(securityFeature); // Get the request context to set the outgoing addressing properties WSBindingProvider wsbp = (WSBindingProvider)interactionService; Map<String, Object> requestContext = wsbp.getRequestContext(); requestContext.put(WSBindingProvider.USERNAME_PROPERTY, username); requestContext.put(WSBindingProvider.PASSWORD_PROPERTY, password); requestContext.put(WSBindingProvider.ENDPOINT_ADDRESS_PROPERTY, url); System.out.println("Example of creating an interaction on a opportunity"); // Create Payload ObjectFactory factory = new ObjectFactory(); Interaction newInteraction=factory.createInteraction(); // Create XMLGregorianCalendar Object with todays date/time DatatypeFactory dtf=null; Date today= new Date(); try { dtf = DatatypeFactory.newInstance(); } catch (DatatypeConfigurationException e) { e.printStackTrace(); // Duh error System.exit(1); } GregorianCalendar gc=new GregorianCalendar(); gc.setTimeInMillis(today.getTime()); // Set Date newInteraction.setInteractionStartDate(dtf.newXMLGregorianCalendar(gc)); newInteraction.setCustomerId(customerId); // CustomerId can be obtained from TargetPartyId from the opportunity newInteraction.setInteractionDescription(factory.createInteractionInteractionDescription("Angelos Test Interaction "+today.toString())); newInteraction.setOutcomeCode(factory.createInteractionOutcomeCode("SUCCESSFUL")); // Configured in Setup/maintenance newInteraction.setInteractionTypeCode("EMAIL"); // Custom types can be configured newInteraction.setDirectionCode("INBOUND"); // INBOUND or OUTBOUND newInteraction.setMediaItemId(0L); // Default =0 newInteraction.setMediaTypeCode(factory.createInteractionMediaTypeCode(""));// Leave Empty // Create & Add Participant, can be RESOURCE and/or CONTACT InteractionParticipant participant= factory.createInteractionParticipant(); participant.setParticipantId(participantPartyId); participant.setParticipantTypeCode("RESOURCE"); newInteraction.getInteractionParticipant().add(participant); // Create & Add Association, this links it back to Opportunity InteractionAssociation association = factory.createInteractionAssociation(); association.setAssociatedObjectCode("OPPORTUNITY"); association.setAssociatedObjectUid(opportunityId); newInteraction.getInteractionAssociation().add(association); // Do the insert Interaction result=null; try { result = interactionService.createInteraction(newInteraction); } catch (ServiceException e) { e.printStackTrace(); } System.out.println("end - interaction "+result.getInteractionId()+" created"); }} XML  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/crmCommon/interactions/interactionService/types/" xmlns:int="http://xmlns.oracle.com/apps/crmCommon/interactions/interactionService/"> <soapenv:Header/> <soapenv:Body> <typ:createInteraction> <typ:interaction> <int:InteractionStartDate>2013-04-27T04:41:11.259-07:00</int:InteractionStartDate> <int:InteractionEndDate xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><!-- CustomerID= SalesParty Customer, also known as TargetPartyId in Opportunity --> <int:CustomerId>300000000592745</int:CustomerId> <int:InteractionDescription>CTI Detected customer callback </int:InteractionDescription> <int:OutcomeCode>SUCCESSFUL</int:OutcomeCode><!-- InteractionTypeCode is part of the standard Lookup types --> <int:InteractionTypeCode>EMAIL</int:InteractionTypeCode> <int:DirectionCode>OUTBOUND</int:DirectionCode> <int:MediaItemId>0</int:MediaItemId> <int:MediaTypeCode xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <int:InteractionParticipant><!-- ParticipantId is partyID for contact --> <int:ParticipantId>100000000099058</int:ParticipantId> <int:ParticipantTypeCode>CONTACT</int:ParticipantTypeCode> </int:InteractionParticipant> <int:InteractionAssociation><!-- AssociatedObjectUid is OPPORTUNITY you want to assocaite this with --> <int:AssociatedObjectUid>300000000667205</int:AssociatedObjectUid> <int:AssociatedObjectCode>OPPORTUNITY</int:AssociatedObjectCode> </int:InteractionAssociation> </typ:interaction> </typ:createInteraction> </soapenv:Body></soapenv:Envelope>

Hey all, Quick snippet of code showing how to create an interaction for an opportunity using Java. This is only a snippet, I assume/note : You've already created a Web-service proxy for the...

Oracle Fusion

More complete RESTful Services for Oracle Sales Cloud Sample/Demo Application

This sample codebuilds on the previous code examples in my blog showing how you can create a RESTful Facade for Oracle Sales Cloud. Specifically this example concentrates on the six main objects people tend to work with : Opportunities Leads Locations SalesParty Person Interactions Thisapplication is an extension of a previous blog article https://blogs.oracle.com/angelo/entry/rest_enabling_oracle_fusion_sales, it is recommended that this article, and tutorial, are followed first.  Please note this code is SAMPLEWARE anddelivered with no guarantees, warranties or  support Functionality / Features Supports Oracle Sales Cloud Release 7 and JDeveloper 11.1.1.7 Ability to query data in a RESTFul way (using GET/PUT verbs) Data can be queried using JSON or XML data formats URIs can contain parameters which reduce the amount of data which is returned , e.g. only bring back Opportunity IDs and Names URI can contain SIMPLE queries, e.g. where OptyID=12323232 Complex queries can be passed in as a POST query when the URI ends in /xmlquery User Credentials, CRM Server, FetchSize and FetchStart can be provided in httpHeaders, thus can be encrypted by SSL Default Server can be setup so that credentials are not needed Project can be extended to cover other objects Limitations Read only is implemented, if you want to issue writes (PUTS) or updates then I recommend custom methods for each operation you require. In the future Oracle Sales Cloud will likely have support REST support natively; This software will work fine against future versions of Oracle Sales Cloud but you are probably better off using the native Oracle Sales Cloud REST support when it  Material Source code (7zip format) Documentation 

This sample codebuilds on the previous code examples in my blog showing how you can create a RESTful Facade for Oracle Sales Cloud. Specifically this example concentrates on the six main objects...

Oracle Fusion

JAXB Errors and Best Practices when Generating WebService Proxies for Oracle Sales Cloud (Fusion CRM)

I've recently been building a REST Service wrapper for Oracle Sales Cloud and initially all was going well, however as soon as I added all of my Web Service proxies I started to get weird errors..  My project structure looks like this What I found out was if I only had the InteractionsService & OpportunityService WebService Proxies then all worked ok, but as soon as I added the LocationsService Proxy, I would start to see strange JAXB errors. Example of the error message Exception in thread "main" javax.xml.ws.WebServiceException: Unable to create JAXBContextatcom.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:164)atcom.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:94)atcom.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:281)at com.sun.xml.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:762)atweblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.buildRuntimeModel(WLSProvider.java:982)atcom.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:746)at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:737)at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:361)at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.internalGetPort(WLSProvider.java:934)atweblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate$PortClientInstanceFactory.createClientInstance(WLSProvider.java:1039)...... Looking further down I see the error message is related to JAXB not being able to find an objectFactory for one of its types Caused by: java.security.PrivilegedActionException:com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 6 counts ofIllegalAnnotationExceptionsThere's no ObjectFactory with an @XmlElementDecl for theelement{http://xmlns.oracle.com/apps/crmCommon/activities/activitiesService/}AssigneeRsrcOrgIdthis problem is related to the following location:at protected javax.xml.bind.JAXBElementcom.oracle.xmlns.apps.crmcommon.activities.activitiesservice.ActivityAssignee.assigneeRsrcOrgId at com.oracle.xmlns.apps.crmcommon.activities.activitiesservice.ActivityAssignee This is very strange... My first thoughts are that when I generated the WebService Proxy I entered the package name as "oracle.demo.pts.fusionproxy.servicename" and left the generated types as blank. This way all the generated types get put into the same package hierarchy and when deployed they get merged... Sounds resaonable and appears to work but not in this case..  To resolve this I regenerate the proxy but this time setting : Package name : To the name of my package eg. oracle.demo.pts.fusionproxy.interactionsRoot Package for Generated Types :  Package where the types will be generated to, e.g. oracle.demo.pts.fusionproxy.SalesParty.types When I ran the application now, it all works , awesome eh???? Alas no, there is a serious side effect. The problem now is that to help coding I've created a collection of helper classes , these helper classes take parameters which use some of the "generic" datatypes, like FindCriteria. e.g. This wont work any more public static FindCriteria createCustomFindCriteria(FindCriteria pFc,String pAttributes) Here lies a gremlin of a problem.. I cant use this method anymore, this is because the FindCriteria datatype is now being defined two, or more times, in the generated code for my project. If you leave the Root Package for types blank it will get generated to com.oracle.xmlns, and if you populate it then it gets generated to your custom package.. The two datatypes look the same, sound the same (and if this were a duck would sound the same), but THEY ARE NOT THE SAME... Speaking to development, they recommend you should not be entering anything in the Root Packages section, so the mystery thickens why does it work.. Well after spending sometime with some colleagues of mine in development we've identified the issue.. Alas different parts of Oracle Fusion Development have multiple schemas with the same namespace, when the WebService generator generates its classes its not seeing the other schemas properly and not generating the Object Factories correctly...  Thankfully I've found a workaround Solution Overview When generating the proxies leave the Root Package for Generated Types BLANK When you have finished generating your proxies, use the JAXB tool XJC and generate Java classes for all datatypes  Create a project within your JDeveloper11g workspace and import the java classes into this project Final bit.. within the project dependencies ensure that the JAXB/XJC generated classes are "FIRST" in the classpath Solution Details Generate the WebServices SOAP proxies When generating the proxies your generation dialog should look like this Ensure the "unwrap" parameters is selected, if it isn't then that's ok, it simply means when issuing a "get" you need to extract out the Element Generate the JAXB Classes using XJC XJC provides a command line switch called -wsdl, this (although is experimental/beta) , accepts a HTTP WSDL and will generate the relevant classes. You can put these into a single batch/shell script xjc -wsdl https://fusionservername:443/appCmmnCompInteractions/InteractionService?wsdlxjc -wsdl https://fusionservername443/opptyMgmtOpportunities/OpportunityService?wsdl Create Project in JDeveloper to store the XJC "generated" JAXB classes Within the project folder create a filesystem folder called "src" and copy the generated files into this folder. JDeveloper11g should then see the classes and display them, if it doesnt try clicking the "refresh" button In your main project ensure that the JDeveloper XJC project is selected as a dependancy and IMPORTANT make sure it is at the top of the list. This ensures that the classes are at the front of the classpath And voilà.. Hopefully you wont see any JAXB generation errors and you can use common datatypes interchangeably in your project, (e.g. FindCriteria etc)

I've recently been building a REST Service wrapper for Oracle Sales Cloud and initially all was going well, however as soon as I added all of my Web Service proxies I started to get weird errors..  My...

Oracle Fusion

REST Enabling Oracle Fusion Sales Cloud using Java

Oracle Fusion Sales Could (Rel7)currently has a WebServices/SOAP interface however many clients & partnersare interested in accessing Oracle Fusion Sales Cloud using REST & JSON.The main difference between a SOAP service and a REST service is the “way” youget access to the data and methods you use. Whilst SOAP is very powerful, verycomplete and also can be quite complex perhaps over-complex. REST in comparison is rather simple anduses the http verbs (GET,POST,PUT etc) to define the operation and can be aspowerful as you desire. There are many documents on theweb which discuss REST vs SOAP but in summary :               SOAP Originally defined as Simple Object Access Protocol. A protocol specification for exchanging structured information in the implementation of Web Services in computer networks. An envelope, which defines what is in the message and how to process itA set of encoding rules for expressing instances of application-defined datatypesAnd a convention for representing procedure calls and responses. Relies on eXtensible Markup Language (XML) as its message format, and usually relies on other Application Layer protocols (most notably Remote Procedure Call (RPC) and HTTP) for message negotiation and transmission. This XML based protocol consists of three parts: REST RESTful web service (also called a RESTful web API) is a simple web service implemented using HTTP and the principles of REST. Such a web service can be thought about as a collection of resources. The definition of such a web service can be thought of as comprising three aspects: The base URI for the web service, such as http://example.com/resources/ The MIME type of the data supported by the web service. This is often JSON, XML or YAML but can be any other valid MIME type. The set of operations supported by the web service using HTTP methods (e.g., POST, GET, PUT or DELETE). References · http://en.wikipedia.org/wiki/Representational_State_Transfer#RESTful_web_services · http://en.wikipedia.org/wiki/SOAP Why would youwant to use REST instead of SOAP? There are many reasons why onewould/could want to use REST instead of SOAP, one reasons is that SOAP isconsidered too heavy-weight for mobile applications, where payload size iscritical, and also instead of XML, JSON is the preferred  message format. The JSON message format isalso very appropriate when interfacing with systems that use JavaScript (suchas browsers or node.js) and hence adds weight to the desire to use REST insteadof SOAP for accessing Oracle Fusion Sales Cloud. So getting to the matter at hand and getting RESTful So enough of why REST , how does one do it for Oracle Sales Cloud (aka CRM). Thankfully this is rather straightforward, at Oracle OpenWorld 2013 you would have seen Thomas Kurian demonstrate our new Oracle SOA Suite and how it can transform a SOAP service into a REST service whilst this is excellent and incredibly productive some clients dont want to install SOA Suite soley for this purpose. Thankfully its possible to do the same using pure Java and deploy it to a cloud infrastructure, like the newly release Oracle Java Cloud Service. It is however worth noting that using SOA Suite is preferable because it accelerates the deployment tremendously and would ultimately be more "agile".  So what are the basic steps to REST enable a Fusion Sales Cloud Service?   Download and install the Jersey REST libraries, we'll use these for the creation of the RESTful service Generate the SOAP Client Side Proxie(s) for Oracle Sales Cloud. In this example we're using static proxies however for a more industrialized approach Id recommend going down the dynamic proxy route, more flexible and less likely to break at runtime, however at a development cost. Create "wrapper" JAXB Objects so that you can return XML data. This is needed because the baseline SOAP clients dont have @RootElement  (s) defined. Create the RESTful project and expose the services you require. Deploy to your runtime Java contain, like the Oracle Java Cloud Service Consume by your favourite client, like a mobile phone etc  For the purpose of the tutorial (in the document), I've documented step by step how you can build the above, query Oracle Fusion Sales Cloud, manage security  (for development & production) and how to deploy the code to the Oracle Java Cloud. Obviously take note that this document is more of a tutorial than anything else when building your own custom REST Adaptor you would tailor it specifically to what services your client (mobile phone, javascript widget etc) requires. Happy reading Material Document Template Files Complete Solution (needs Jersey files downloadable separately)  Note This document and source code is sample code and assumes no support from Oracle Corporation or myself. 

Oracle Fusion Sales Could (Rel7) currently has a WebServices/SOAP interface however many clients & partners are interested in accessing Oracle Fusion Sales Cloud using REST & JSON.The main difference...

Oracle Fusion Sales Cloud - Payloads

Sample Payload : Batch insert/update

Question came up in a call today, is it possible to do batch webservice updates using the Oracle Sales Cloud webservice interface?? The answer is YES, but not all webservices support this. The operation is called "process<ObjectName>",and you need to check in the ADFService list of operations, in FusionOER , that the service supports the process<xxx> syntax. For example LocationService and  OpportunityService support the process operation but the SalesPartyService does not. Also you will find there are typically two operations, process<object> and processCS<object> the difference being that the first one you supply it with a list of objects and one operation (ie update all locations), whereas in processCS you can provide a unique operation for each and every object. From FusionOER for the opportunity service Operation Description  Parameters  Return value processOpportunity Performs a Create, Update, Delete, or Merge operation on a list of Opportunity rows. The specified operation is applied to all objects in the given list. String changeOperation ,java.util.List Opportunities,processControl oracle.jbo.common.service.types.ProcessControl  A list of opportunities that are successfully processed processCSOpportunity  Performs a Create, Update, or Delete operation on a list of Opportunity rows. Different operations may be applied to different objects, depending on what is specified in the ChangeSummary object. oracle.jbo.common.service.types.ProcesssData processData,processControl oracle.jbo.common.service.types.ProcessControl  A list of opportunities that are successfully processed And a sample payload looks like <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/cdm/foundation/parties/locationService/applicationModule/types/" xmlns:loc="http://xmlns.oracle.com/apps/cdm/foundation/parties/locationService/" xmlns:par="http://xmlns.oracle.com/apps/cdm/foundation/parties/partyService/" xmlns:sour="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/sourceSystemRef/" xmlns:loc1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/location/" xmlns:typ1="http://xmlns.oracle.com/adf/svc/types/">    <soapenv:Header/>    <soapenv:Body>       <typ:processLocation>          <typ:changeOperation>Merge</typ:changeOperation>          <typ:location>             <loc:CreatedByModule>AMS</loc:CreatedByModule>             <loc:Address1>510 Quercia Marcozzi</loc:Address1>             <loc:Address2>Building 300</loc:Address2>             <loc:City>Caserta</loc:City>             <loc:Country>IT</loc:Country>             <loc:State>CE</loc:State>             <loc:PostalCode>90102</loc:PostalCode>          </typ:location>          <typ:location>             <loc:CreatedByModule>AMS</loc:CreatedByModule>             <loc:Address1>510 Quazi Marcozzi 2</loc:Address1>             <loc:Address2>Building 500</loc:Address2>             <loc:City>Caserta2</loc:City>             <loc:Country>IT</loc:Country>             <loc:State>CE</loc:State>             <loc:PostalCode>90104</loc:PostalCode>          </typ:location>          <typ:processControl>             <typ1:partialFailureAllowed>true</typ1:partialFailureAllowed>          </typ:processControl>       </typ:processLocation>    </soapenv:Body> </soapenv:Envelope>

Question came up in a call today, is it possible to do batch webservice updates using the Oracle Sales Cloud webservice interface?? The answer is YES, but not all webservices support this....

Oracle Fusion Sales Cloud - Payloads

Some Fusion CRM payloads for creating SalesAccounts

Some payloads for creating customers in FusionCRM, namely Create a location in Fusion CRM Add the location to the Sales_Prospect making it into a SalesAccount Add a sales person to the SalesAccount Make the salesPerson the primary account owner 1.       Create a new  Location,using createLocation in the  LocationService <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/cdm/foundation/parties/locationService/applicationModule/types/" xmlns:loc="http://xmlns.oracle.com/apps/cdm/foundation/parties/locationService/" xmlns:par="http://xmlns.oracle.com/apps/cdm/foundation/parties/partyService/" xmlns:sour="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/sourceSystemRef/" xmlns:loc1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/location/">    <soapenv:Header/>    <soapenv:Body>       <typ:createLocation>          <typ:location>             <loc:CreatedByModule>AMS</loc:CreatedByModule>             <loc:Address1>510 Quercia Marcozzi</loc:Address1>             <loc:Address2>Building 300</loc:Address2>             <loc:City>Caserta</loc:City>             <loc:Country>IT</loc:Country>             <loc:State>CE</loc:State>             <loc:PostalCode>90102</loc:PostalCode>          </typ:location>       </typ:createLocation>    </soapenv:Body> </soapenv:Envelope> 2. Add the location to the Sales_Prospect making it into a SalesAccount using SalesPartyService <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"        xmlns:typ="http://xmlns.oracle.com/apps/crmCommon/salesParties/salesPartiesService/types/"        xmlns:sal="http://xmlns.oracle.com/apps/crmCommon/salesParties/salesPartiesService/"        xmlns:org="http://xmlns.oracle.com/apps/cdm/foundation/parties/organizationService/"        xmlns:par="http://xmlns.oracle.com/apps/cdm/foundation/parties/partyService/"        xmlns:con="http://xmlns.oracle.com/apps/cdm/foundation/parties/contactPointService/"        xmlns:sour="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/sourceSystemRef/"        xmlns:con1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/contactPoint/"        xmlns:org1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/organization/"        xmlns:par1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/partySite/"        xmlns:rel="http://xmlns.oracle.com/apps/cdm/foundation/parties/relationshipService/"        xmlns:org2="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/orgContact/"        xmlns:rel1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/relationship/"        xmlns:per="http://xmlns.oracle.com/apps/cdm/foundation/parties/personService/"        xmlns:per1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/person/">        <soapenv:Header />        <soapenv:Body>               <typ:updateSalesParty>                      <typ:salesParty>                            <!-- PartyID of the organization -->                            <sal:PartyId>100000000055273</sal:PartyId>                            <sal:OrganizationParty>                                   <!-- PartyID of the organization -->                                   <org:PartyId>100000000055273</org:PartyId>                                   <org:PartySite>                                          <!-- PartyID of the organization -->                                          <par:PartyId>100000000055273</par:PartyId>                                          <!-- PartyID of the location you wish to add -->                                          <par:LocationId>300000000599001</par:LocationId>                                          <!-- Module which created the entry, ZCM is the code for the UI, can                                                 be others -->                                          <par:CreatedByModule>ZCM</par:CreatedByModule>                                          <par:PartySiteUse>                                                 <par:CreatedByModule>ZCM</par:CreatedByModule>                                                 <par:SiteUseType>BILL_TO</par:SiteUseType>                                          </par:PartySiteUse>                                   </org:PartySite>                            </sal:OrganizationParty>                      </typ:salesParty>               </typ:updateSalesParty>        </soapenv:Body> </soapenv:Envelope> 3.      Add theResource(SalesPerson) to the SalesAccount, using createSalesAccountResource, inthe SalesPartyService <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/crmCommon/salesParties/salesPartiesService/types/" xmlns:sal="http://xmlns.oracle.com/apps/crmCommon/salesParties/salesPartiesService/">    <soapenv:Header/>    <soapenv:Body>       <typ:createSalesAccountResource>          <typ:salesAccountResource          <sal:LockAssignmentFlag>false</sal:LockAssignmentFlag> <!—The code indicating how the resource is assigned to the sales account team. The possible values are contained in the ZCA_ASSIGNMENT_TYPE lookup.à             <sal:AssignmentTypeCode>MANUAL</sal:AssignmentTypeCode>             <sal:ResourceId>300000000623680</sal:ResourceId>             <sal:SalesAccountId>300000000690006</sal:SalesAccountId> </typ:salesAccountResource> </typ:createSalesAccountResource> </soapenv:Body></soapenv:Envelope> 4.      Make the new personthe Account Lead, using updateSalesParty, in SalesPartyService <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/crmCommon/salesParties/salesPartiesService/types/" xmlns:sal="http://xmlns.oracle.com/apps/crmCommon/salesParties/salesPartiesService/" xmlns:org="http://xmlns.oracle.com/apps/cdm/foundation/parties/organizationService/" xmlns:par="http://xmlns.oracle.com/apps/cdm/foundation/parties/partyService/" xmlns:con="http://xmlns.oracle.com/apps/cdm/foundation/parties/contactPointService/" xmlns:sour="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/sourceSystemRef/" xmlns:con1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/contactPoint/" xmlns:org1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/organization/" xmlns:par1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/partySite/" xmlns:rel="http://xmlns.oracle.com/apps/cdm/foundation/parties/relationshipService/" xmlns:org2="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/orgContact/" xmlns:rel1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/relationship/" xmlns:per="http://xmlns.oracle.com/apps/cdm/foundation/parties/personService/" xmlns:per1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/person/"> 5.    <soapenv:Header/> 6.    <soapenv:Body> 7.       <typ:updateSalesParty> 8.          <typ:salesParty> 9.             <sal:PartyId>100000000055273</sal:PartyId> 10.             <sal:SalesAccountId>300000000629280</sal:SalesAccountId> 11.          </typ:salesParty> 12.       </typ:updateSalesParty> 13.    </soapenv:Body> 14.              </soapenv:Envelope>

Some payloads for creating customers in FusionCRM, namely Create a location in Fusion CRM Add the location to the Sales_Prospect making it into a SalesAccount Add a sales person to the SalesAccount Make...

Oracle Fusion Sales Cloud - Payloads

FusionCRM :Adding a Product Item and a Product Group to a CRM Opportunity

Recently it was asked to me how one can insert a product item/group into a Fusion CRM Opportunity. First thing is one needs to understand the difference between a CRM Product Item and a CRM Product Group.  A Product Item is a Item, usually managed externally from Fusion CRM, often from Fusion PIM or uploaded independantly. A  Product Group is a collection of Product Items collected together in the "Manage Product Group" screen within Fusion Setup and Maintenance. When inserting into an opportunity a product group, or a product item, you will need to know the product group ID (ProdGroupId) or the InventoryItemIds+InventoryOrgId respectively. You can get a list of all your product group IDs, by exporting the object "ProductGroupDetailExpPVO" in the "Schedule Export Processes" task within "Setup and Maintenance"  The payload for inserting a product Item within an Opportunity is <typ:soapenv:Body> <typ:mergeOpportunity> <typ:opportunity> <!-- VineYards2 Opportunity --> <opp:OptyId>300000001185032</opp:OptyId> <opp:ChildRevenue> <rev:Quantity>62</rev:Quantity> <rev:RevnAmount>4242</rev:RevnAmount> <rev:InventoryItemId>300000001166019</rev:InventoryItemId> <rev:InventoryOrgId>300000000556217</rev:InventoryOrgId> </opp:ChildRevenue> </typ:opportunity> </typ:mergeOpportunity> </soapenv:Body> and for inserting a ProductGroup is similar but for product groups you dont need the InventoryOrgId. <soapenv:Body> <typ:mergeOpportunity> <typ:opportunity> <!-- VineYards2 Opportunity--> <opp:OptyId>300000001185032</opp:OptyId> <opp:ChildRevenue> <rev:Quantity>62</rev:Quantity> <rev:RevnAmount>4242</rev:RevnAmount> <rev:ProdGroupId>300000000599006</rev:ProdGroupId> </opp:ChildRevenue> </typ:opportunity> </typ:mergeOpportunity> </soapenv:Body> Finally if you want to do this as part of a groovy script,e.g trigger from a button, the script would look something like this // newOpty is the opportunityObject you want to insert intodef ChildrenRev = newOpty.ChildRevenuedef newChild = ChildrenRev.createRow()ChildrenRev.insertRow(newChild)newChild.setAttribute('InventoryItemId',300000001166019)newChild.setAttribute('InventoryOrgId',300000000556217)

Recently it was asked to me how one can insert a product item/group into a Fusion CRM Opportunity. First thing is one needs to understand the difference between a CRM Product Item and a CRM Product...

ADF11g

Debugging ADF Mobile apps, quick tip

Don't you miss the Weblogic console when developing Oracle ADF Mobile applications?? I do..  Well there is a neat workaround for Android. Oracle ADF Mobile outputs quite a bit of debug information onto the Android logcat, which is quite useful. To see the Android logcat, you can execute the following command (Windows or Linux) adb logcat and logcat will continue logging everthing which happens on your android phone to your operating systems command line.. However a better approach is to use Eclipse logcat. If you install eclipse and install the Android Development Toolkit  (link) you get the same functionality as the command line logcat, but with the additional featuresI've since discovered that the Android SDK actually has a program called "Monitor" which appears to be an Eclipse based UI dedicated for debugging your device.. It has information on the heap, threads,network statistics and lots more! but importantly for us the logcat functionality is identical to whats available in eclipse (same plugin I guess) Pretty colours, makes it easier to see Information vs Debug messages A quick & easy UI for setting up filters , so you can configure it to filter only for messages from your application   Useful..

Don't you miss the Weblogic console when developing Oracle ADF Mobile applications?? I do..  Well there is a neat workaround for Android. Oracle ADF Mobile outputs quite a bit of debug information...

ADF11g

Beautiful websites with Oracle ADF/Webcenter

I've been following a thread on the ADF Enterprise Methodology group on google with some interest recently, which has prompted this blog posting.. Its all about "Can Oracle ADF-Faces be used to create a truly uber-sexy website", complete with sizzle ?? The answer is yes of course! Oracle ADF-Faces can produce a sexy website. It's true that Oracle ADF-Faces was originally designed to be quick RAD framework for building Oracle Fusion Applications and it succeeds there, and over time its rapidly being used for building UIs for all of Oracle's products, from internal applications, task screens for Oracle BPM worklists, Enterprise Manager screens and is the main framework you would use with Oracle Webcenter Portal (& Spaces). The latter particularly leans towards a user audience which craves ubersexyness and sizzle vs an expenses clerk who is only really interested in getting the job done efficiently, although nice looking would be nice... So your building an Oracle ADF website and you want it to look good where should you start?? Well Oracle ADF Skinning is the first port of call. Even with simple skinning you can create some really nice looking interfaces, just look at http://www.medibankhealthbook.com.au, an Australian Health Website and http://My.Symantic.com, specifically MySymantic.com uses pure ADF, for both of these sites checkout the look and feel of the registration page to get an idea of what can be done.. my.symantec.com www.medibankhealthbook.com.au Want some sizzle?  So far although the websites could look good, they're clean, efficient and nice looking and depending on your view they might lack uber-sexyness let alone sizzle.. For that you'll probably need some custom javascript and CSS3.  Oracle ADF supports a client side javascript API which allows you to add  your own javascript and thus you can create and invoke client side javascript to hide and show canvases etc.. A good example of this being used on the web, although not built with Oracle ADF, is the O2 website, when you move your mouse over the lower panels (Phones & Tariffs,Priority Moments etc) it hide/shows a panel below. This can easily be done in Oracle ADF with some simple client side javascript which hide/shows Oracle ADF Panels, I'll create an example in a later post showing how to do this. So far so good, but what about uber-sizzle? Well anythings possible with a good dose of javascript, CSS and a good graphics designer, however for the most of us doing this javascript uber-sizzle is a little beyond us (well it is me! :-), this is where 3rd party libraries come to the rescue.  According to theregister , the "current" defacto standard javascript library is the JQuery library, it provides a number of components (some of which compete with ADF components),makes javascript easier to use,  but more importantly it includes a number of "animations" which can be added to a website, these animations by themselves can make a website look ooooerrrr... and thats precisely what a number of web designers do.. A number of my ADF clients have used JQuery in their websites and one of the most common usage of the animate method is to have images slide across or panels slide in-out of view. Examples of this components include this blog and Nivo. Oracle ADF websites which use JQuery/JavaScript http://www.ferrovial.es http://www.baesystems.com http://www.ladwp.com All of these use JQuery in someway, most of them for animations, such as a ticker at the top in Ferrovial, Image slider in BAESystems.com and LADWP.  Also checkout a blog entry by a friend of mine, Duncan Mills, here, he shows whats possible with CSS3 Animations and ADF. I particularly like the ability to have the Next/Previous button hidden in a panel on the left hand side, something which is very popular in the Mac/Ubuntu Desktops at the moment... So there you have it, you can use a Rapid Development Framework like Oracle ADF-Faces, use the native components and then add libraries like JQuery and give it some sizzle. In a later blog posting I'll explain how one integrates JQuery with ADF to add some sizzle.  However, before I leave you here are some important notes : I/Oracle does not endorse the usage of 3rd Party libaries like JQuery, they should work but some might not play nice If possible always try to use the native components in Oracle ADF first, then apply skinning/CSS and finally use a framework like JQuery if needed. Remember beauty is in the eye of the beholder, get people to review the work :-) Read the thread on the ADF Enterprise Development group it has some really good comments Enjoy

I've been following a thread on the ADF Enterprise Methodology group on google with some interest recently, which has prompted this blog posting.. Its all about "Can Oracle ADF-Faces be used to...

ADF11g

Getting rid of the JSESSIONID from the URL for ADF/Webcenter

Today's short snippet Yesterday I had a call from a partner of mine who is implementing a system and they asked the curious question.. "Can we get rid of the JSESSIONID parameter from the URL line of a Webcenter application"..My first thoughts were why?, its part of the session management of any J2EE application but it turns out that the security conscious client wants to make session high-jacking of a Webcenter application much harder and doesnt like the jsessionid on the url line..Make sense,Thankfully this is quite easy, Weblogic server has a parameter in the weblogic.xml file  which allows you the ability to control how sessions are managed and one of these is to force that the JSESSIONID token is force-ably implemented via cookies and not URL parameters. This obviously has the disadvantage that if the browser doesnt have cookies enabled then your application wont work...Cookies however can also be intercepted/viewed too, so I also recommended that they rename the session cookie so that automated tools looking for JSESSIONID wont find it..The weblogic.xml now looks like  <session-descriptor>    <cookie-name>MYAPPSESSID</cookie-name>    <url-rewriting-enabled>false</url-rewriting-enabled>  </session-descriptor> You can also set this from JDeveloper by editing your projects weblogic.xml file and using the "overview" mode of the wizard. Obviously the best next thing is to ensure all communication is also SSL encrypted.

Today's short snippet  Yesterday I had a call from a partner of mine who is implementing a system and they asked the curious question..  "Can we get rid of the JSESSIONID parameter from the URL line of...

Happy New Year All , and are you all integrated and validated?

Firstly Happy New Year to you all Secondly, in late December a friend of mine, who works for an Oracle Partner, asked me questions on how to "correctly" integrate  Oracle eBusiness Suite with a 3rd party application, the answer is "it depends".. There are many ways to do integration and depending on what you need to accomplish depends which one is the "best" approach.. It depends on :- What version ofEBS you are using, if its 12.1.3 then you can use the ISG (integrated ServiceGateway)  to call services within EBS as Web services.-  If your on a EBS prior to12.1.3 (also 11i I guess) then you have something called the Applications SOA Adapter within SOA Suite. This adapter basically acts as a facade between SOA Suite and the Oracle eBusiness Suite PLSQL APIs, quite easy to use and works well.. This adapter is also available in 12.1.3, but its generally recommended to use the previously mentioned ISG Gateway instead.Howeverbeware that the devil is in the detail, it does depend who the 3rd partyis and what they are trying to do, you might for example need to use the OracleService bus for some complex credential mapping, or maybe the Oracle B2B product is a better fit.. Also consider if its a batch process then perhaps one of the data integration products is a better fit (e.g. ODI)Finally, what about validating the solution? Does oracle provide validation services? Yes we do!If its custom code, or a one off for a client, then the best people do validate the solution is probably Oracle Consulting Services, if you are a partner who are creating a reusable asset then the partner program has a validation program called "Oracle Validated Integration" which provides a number of benefits  

Firstly Happy New Year to you all Secondly, in late December a friend of mine, who works for an Oracle Partner, asked me questions on how to "correctly" integrate  Oracle eBusiness Suite with a 3rd...

Improving the performance of JDeveloper11g (part 2) and JVMs in general

Just received an email from one of our JVM developers who read my blog entry on Performance tuning JDeveloper11g and he's confirmed that all of the above parameters are totally supported :-) He's also provided a description of the parameters so we can learn what magic is actually being applied. - -XX:+AggressiveOpts -- this enables the latest andgreatest JVM optimizations. It willlikely help most Java applications. It's fully supported. The downside of it isthat because it has the latest and greatest optimizations, there is some smallprobability that it may not offer as good of an experience. As those features enabled with this command line option have "matured", they aremade the default in a future JDK release. So, you can think of this command line option as the place where thenewest optimizations get introduced. Some time later they are moved out from under AggressiveOpts to becomedefault behavior. -XX:+OptimizeStringConcat -- only works with the -serverJVM. It may be enabled by the defaultin a future JDK 7 update release. Thisoption delays the construction of a StringBuilder/StringBuffer and attempts toavoid re-sizing the underlying char[] by attempting to detect the size of thechar[] to allocate based on what's being appended to theStringBuilder/StringBuffer. -XX:+UseStringCache -- I would not suggest using thisunless you knew that JDeveloper allocated the same string over and overagain. And, the string that's allocatedover and over again is one of the first 100,000 allocated strings. In short, I'd recommend against usingit. And, in fact, in Java 7 (currently)does not include this feature. -XX:+UseCompressedOops -- applicable to 64-bit JVMs. And, if you're using a 64-bit JVM, I'dsuggest you use it. It's auto enabled inJDK 7 64-bit JVMs and later JDK 6 64-bit JVMs enable it by default too. -XX:+UseGCOverheadLimit -- by default this option isalready enabled. One other command line option to consider is-XX:+TieredCompilation for a JDK 6 Update 25 or later, or JDK 7. This gives you the startup of a -client JVMand the peak performance of a -server JVM. Awesome-ness!  Finally, Charlies also pointed out to me a "new" book he's just published where he goes into the details of JVM tuning, a must for all Fusion Middleware tuning exercises..  (click the book)  Thanks Charlie!

Just received an email from one of our JVM developers who read my blog entry on Performance tuning JDeveloper11g and he's confirmed that all of the above parameters are totally supported :-) He's...

SOASuite 11.1.1.4 : Error Logging into BPM11g Composer?

Hey all, I’ve just installed SOA Suite 11.1.1.4 and noticed a few funnies which people might hit, thankfully each of them have an easy solution.   1. Some applications are installed but dont appear to work? If when you install SOASuite you may notice that the following applications dont appear to work, however they do appear as deployments in Weblogic Server Console e.g.  SOA Composer (composer), FMW Welcome Page Application (11.1.0.0.0) and some of the adaptors. If they appear in the deployments list state as “installed” and not Active, then its likely that they haven't been targeted to a specific server.   The solution is to target the application the desired managed server , e.g. AdminServer in a development environment. This is done by selecting the application, tab “Targets”, select all components, Button[change Targets] and select the appropriate server. This change can be done without restarting the Weblogic Server 2. You might find that when you try to log into the BPM Composer at http://machine:7001/bpm/composer , the login screen will appear but you cant log in. The error log might mention the following   The solution to this is two fold, a) When creating the domain, avoid using 127.0.0.1 as the Listener address, or “Any Addresses”, if this is a development machine create an alias in your /etc/hosts file and then use this alias in the domain creation wizard. e.g.   my host file contains an entry     mypc     127.0.0.1   And in the Fusion middleware Configuration wizard   Twill then work!   if it still doesnt you can try setting the ServerURL attribute to http://mypc in the SoaInfraMBean instead of blank. This is accomplished by using Enterprise Manager. Use the System MBean Browser to navigate to Application Defined MBeans->oracle.as.soainfra.config->[ server]->SoaInfraConfig->soa-infra. Then changing the value of 'ServerURL' to http://mypc   Failing that give support a call….

Hey all, I’ve just installed SOA Suite 11.1.1.4 and noticed a few funnies which people might hit, thankfully each of them have an easy solution.   1. Some applications are installed but dont appear to...

Weblogic 10.3.4 (PS3) nodemanager wont start?

Hi all, well Im back from Australia and one of the things which happened was Oracle announced the PS3 release of oracles SOA & Webcenter products have been released. Now I normally use pre-installed images but I always like to install the products at least once that way I get to see its installation caveats.. Here’s one. Installation on Windows 7 64bit, 64bit JVM, generic weblogic Server installer. All worked fine, EXCEPT I cant start the node manager, I get the following error <08-Feb-2011 17:16:48> <INFO> <Loading domains file: D:\products\wls1034\WLSERV~1.3\common\NODEMA~1\nodemanager.domains> <08-Feb-2011 17:16:48> <SEVERE> <Fatal error in node manager server> weblogic.nodemanager.common.ConfigException: Native version is enabled but nodemanager native library could not be loaded     at weblogic.nodemanager.server.NMServerConfig.initProcessControl(NMServerConfig.java:249)     at weblogic.nodemanager.server.NMServerConfig.<init>(NMServerConfig.java:190)     at weblogic.nodemanager.server.NMServer.init(NMServer.java:182)     at weblogic.nodemanager.server.NMServer.<init>(NMServer.java:148)     at weblogic.nodemanager.server.NMServer.main(NMServer.java:390)     at weblogic.NodeManager.main(NodeManager.java:31) Caused by: java.lang.UnsatisfiedLinkError: D:\products\wls1034\wlserver_10.3\server\native\win\32\nodemanager.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform     at java.lang.ClassLoader$NativeLibrary.load(Native Method)     at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1728)     at java.lang.Runtime.loadLibrary0(Runtime.java:823)     at java.lang.System.loadLibrary(System.java:1028)     at weblogic.nodemanager.util.WindowsProcessControl.<init>(WindowsProcessControl.java:17)     at weblogic.nodemanager.util.ProcessControlFactory.getProcessControl(ProcessControlFactory.java:24)     at weblogic.nodemanager.server.NMServerConfig.initProcessControl(NMServerConfig.java:247)     ... 5 more Ok it appears that the node manager has gotten confused and thinks this is a 32bit install of Weblogic Server whereas it is the 64bit install.. Might have been something I did, or didnt do, on installation (e.g. –d64 on the jvm command line), however the workaround is pretty easy. 1. Create a file called nodemanager.properties in %WL_HOME%\common\nodemanager on my machine it was D:\products\wls1034\wlserver_10.3\common\nodemanager 2. Add the following line to it NativeVersionEnabled=false 3. And start it up!, this will force it not to use .DLL files and use emulation/non native methods instead..  

Hi all, well Im back from Australia and one of the things which happened was Oracle announced the PS3 release of oracles SOA & Webcenter products have been released. Now I normally use pre-installed...

SOA

SOA Composite Sensors : Good Practice

I was discussing a interesting design problem with a colleague of mine Niall (his blog) on the topic of how to cancel an inflight SOA Composite process.  Obviously one way to do this is to cancel the process from enterprise Manager ( http://hostort/em ) , however we were thinking this isnt a “user friendly” way of doing this.. If you look at Nialls blog you’ll see he’s highlighted a number of different APIs which enable you the ability to manipulate the SCA instance, e.g. Code Snippet to purge (delete) an instance How to determine the instanceId from a composite_sensor_value using the “composite_sensor_value” table How to determine a BPEL Process status using the cube_instance table   Now all of these require that you know the instanceId of your SOA Composite, how does one find this out? Well the easiest way of doing this is to create a composite sensor on the SCA component. A composite sensor is simply a way of publishing a piece of business data as part of your composite. The magic here is that you can later query composites based on this value. So a good best practice is that for any composites you create consider publishing a composite sensor value using a primary key of some sort , e.g. orderId, that way if you need to manipulate/query composites you can easily look up the instanceId using the sensorid.   For information on how to create a composite Sensor id see this documentation link  

I was discussing a interesting design problem with a colleague of mine Niall (his blog) on the topic of how to cancel an inflight SOA Composite process.  Obviously one way to do this is to cancel...

Why have a webtier?

I recently saw a post on a mail list which basically asked if in a Weblogic Server installation , if it worth having a Webtier when you have a load balancer front ending everything.Now, me personally, I always recommend putting a webtier in front of Weblogic Server, in my case this is almost always Apache HTTP Server and the main reason is to harden the inbuilt Weblogic http server.. however someone else responded with a great list of reasons why you should *always* have a webtier even if you have a load balancer.. namely.•Allows the WLS cluster membership to be reconfigured (new servers added, others removed) without having to change the web server configuration (so long as at least some of the servers in the configured list remain). The plug-in will learn about the cluster membership and direct work accordingly.•More parallelism. You can have as many web servers as you like, and spray inbound traffic across the web server "farm" using stateless load balancers. The plug-in will ensure the requests are directed to the correct server. In contrast, with connection-aware load balancers, you may be limited to using a single LB, or chaining it to a single peer LB.•Faster fail-over in the event of a WLS instance failing. The plug-in actively learn about the failed WLS instance using information supplied by its peers, and avoid it until the peers notify the plug-in that it is again available.•Somewhere to terminate SSL which isn't the server.•Static content hosting.•HTTP redirection and munging capability over and above what WLS provides. You can also use the web server tier to front off against many different WLS clusters, and perhaps do content based routing.•Provides a sacrificial lamb for the DMZ. This is often fits in well with existing infrastructure and is sufficient to satisfy customer security teams.Thanks Phil for the response.. nicely doneAngelo

I recently saw a post on a mail list which basically asked if in a Weblogic Server installation , if it worth having a Webtier when you have a load balancer front ending everything. Now, me personally,...

SOA

New BPEL Partner Link parameter ‘faultableResponseHeaderHandler’

  I’ve just finished helping out one of my partners with an interesting problem which resulted in the usage of a new piece of functionality called “faultableResponseHeaderHandler” partner link support in BPEL 10.1.3.4 MLR9. With this release we’ve extended the responseHeader Handler in our WSIF implementation which allows us the ability to inspect a returning payload, and if required raise a BPEL Fault.. Why do this? Well in our case the system was experiencing random errors from a remote service which if retried would work correctly but as the remote service responded with a business error and not a fault the standard fault management framework couldn’t help. In a perfect world the BPEL Developer would have detected this error by inspecting the payload in BPEL and then issued a retry, however using this new piece of functionality we were able to implement the raising of an error, which then triggers off the standard BPEL Fault Management Framework (documented page 29 of this doc) without changing the main bpel code, which in turn keeps the legibility of the BPEL code high.   So how do you use this new piece of functionality 1. Install Oracle SOASuite 10.1.3.4 and MLR9 (obvious really) 2. Create a class which implements the interface  “com.collaxa.cube.ws.FaultableHeaderHandler” This class should implement the following method public void invoke(CXPartnerLink cxPartnerLink, String string, Map map,  List list, Map map1) throws BPELFault { ….. } The Map contains the payload elements, each one corresponding to a part of the input/output message as defined in your WSDL.  The next step is to get the dom object and query it..  For this you have many options, you could use a DOM API , an XPATH query or something else.. I’ve used xpath as I think it would be easier.. 3. If you decide not to raise a fault, then simply return, if however you decide to raise a fault then simply create a new java exception of type “com.oracle.bpel.client.BPELFault”, fill in the parameters accordingly to the javadocs and throw it. 4. Deploy the resulting class into the <OracleHome>/bpel/system/classes directory and restart your SOASuite server 5. At this point you need to edit the partnerLink binding in the bpel.xml file to include a new parameter called “faultableResponseHeaderHandler” and give it the fully qualified name of class implementing your hander. e.g.          <partnerLinkBinding name="MyService">             <property name="wsdlLocation">MyServiceWSIF.wsdl</property>             <property name="faultableResponseHeaderHandler">com.sample.angelosFaultableErrorHander</property>             ....          </partnerLinkBinding> and then deploy it into your BPEL domain. At this point you should be able to execute your bpel code, and based on the custom logic in your faultableHeaderHandler code, you can throw a BPEL Fault instead of returning a business fault within the response.. At this point I recommend using the Fault Management Framework to manage the fault, e.g. example retry 5 times. For more information on the Fault Management Framework see here Finally, big thanks to Clemens and my Italian friends for helping out here. Enjoy! Resources & Hints Good tutorial on XPATH available here http://www.ibm.com/developerworks/library/x-javaxpathapi.html Deploy the classes into the <OracleHome>/bpel/system/classes directory If you use System.out.println() for debugging your code you’ll see the output go into the BPEL containers log in <OracleHome>opmn/log I’ll be posting a JDeveloper Workspace with a test project soon :-) com.collaxa.cube.ws.FaultableHeaderHandler interface can be found in orabpel.jar which is in <OracleHome>/bpel/lib

  I’ve just finished helping out one of my partners with an interesting problem which resulted in the usage of a new piece of functionality called “faultableResponseHeaderHandler” partner link support...

Gosh has it been that long?

Gosh, Ive been so busy recently I havent really had time to keep my blog up to date. I logged in today for a long time and realised its nearly a near since my last posting.. Must update it more often.. Anyway I've been busy working with out partner comunity doing all sorts of things, from highly available messaging systems, (did you know we can push over 5K messages through our service bus?) to helping a partner design and use our new WebCenter 11g Spaces product.. All rather cool..The latest question I had was ' We are building a coherence grid to manage/process data and we need to persist the data. We are planning to use hibernate as our persistence store and was wondering if Oracle had any views on if we should generate a database schema from the java objects or generate java objects from a dataase schema...Unfortunatly the answer is "It depends"..Typically things like hibernate do a good job of generating a schema but its no way near as good if you got a good data architect to do it. Also you need to keep in mind what other applications are accessing the schema, things like ETL/ODI, BI etc.. Will they be happy with the generated schema??This is why I tend to go the other way, generate the schema first, tune it (ie add indexes, denormalize it etc) and then expose it up to the java world using the persistence engine..My view.. again it depends on the application usage, other application usage of the schema etc.What are you views?

Gosh, Ive been so busy recently I havent really had time to keep my blog up to date. I logged in today for a long time and realised its nearly a near since my last posting.. Must update it more often.. A...

Gosh is it almost Xmas ??

Gosh its almost Xmas and I looked at my blog and thought its looking a little bare.. So I thought Id update it with some things, what have I been doing etc.. Things have been incredibly busy recently with the launch of the Accenture Innovation Centre which was launched in the UK last week. My role for this is to support Accenture as a dedicated Architect from Oracle, oh lets not forget a bit of presales, biz dev and generally running around.. I think someone described it like being at a .COM, exciting..Anyway technology wise things are really shaping out. Oracle Fusion Middleware adoption continues to grow and so does our acquistions (Tangosol, Bridgestream, Bharossa, AppForge  etc) , checkout this url http://www.oracle.com/corporate/acquisition.html for a list with a description....JDeveloper vs .Net and Web 2.0Our JDeveloper product is also evolving nicely with its new AJAX user interface. Id recommend anyone to download JDeveloper 11g Preview 2 and checkout the tutorials.. An interesting question I recently heard was how does Java compare with .NET?? Well basically using Java gives you the following "features"freedom of platformfreedom of app server vendor (Oracle,JBoss,IBM, BEA etc)freedom of development tools (Eclipse/JBuilder etc)Its the last one where we Oracle really play a strong part. The ADF framework is really rich in its feature set from the bottom layer of where do I put my business logic (Toplink,EJB3.0, Business Components), to user interface decisions such as ADF Faces, JSF, JSP, Struts, Portal etc.. To glue this all together we have my favourite layer called (ADFm), ADF Model...With ADF Faces 11g (comes with JDeveloper 11g) we've taken the bull by the horns and made building AJAX applications even easier!Here's a sample screen shot of a sample app Ive  have used to demo the new features. Of interest is the accordian control on the left (Featured,Browse and Search), drag-n-drop support, stylesheets and "Templates!" (Something sorely missing in JSF) and lots of other goodies.. Its all good.......

Gosh its almost Xmas and I looked at my blog and thought its looking a little bare.. So I thought Id update it with some things, what have I been doing etc.. Things have been incredibly busy recently...

BPEL : The effect of deliveryPersistPolicy

Oracle BPEL has a number of knobs you can tweak to improve performance, one of the easiest tweaks is the deliveryPersistPolicy parameter.This parameter determines whether the delivery messages, entering BPEL, are persisted. That is when you call a BPEL process an row is inserted into the BPEL repository, and response is given to the client. After a short time worker threads are activated to process the request. &lt;Picture of request , message table , threads >If you look at your BPEL statistics page you'll see that this process can take a couple of hundred ms' so lets assume that your process is synchronous and can be repeated, do you want it to be persisted???Fortunatly this is one of the knobs you can tweak to improve performance here..deliveryPersistPolicy has three valid valuesonClient thread stores message in the databaseWorker threads pick up the message and deliver it to the BPEL instanceThis approach is a "Send and forget" approach, with the guarantee that once its submitted it will get processedoffNo database logging is done, the message is stored in memory cache If the server crashes during the processing then the request will be lost.off.immediate (since 10.1.3.1)In this scenario the message isnt saved at all, and the request is passed directly to the BPEL instance."Send and Wait" approachGreat for Synchronous processes that can be repeated.This parameter can be set in the BPEL Console parameters screen.

Oracle BPEL has a number of knobs you can tweak to improve performance, one of the easiest tweaks is the deliveryPersistPolicy parameter.This parameter determines whether the delivery messages,...

Multiple JVMs & Multiple OC4J Instance

I've recently seen an email on  our internal mail list which was entitled "Multiple JVMs vs Multiple Instances"The author of the original email was testing performance differences between multiple jvms on a single container vs multiple containers...  He noticed (quite correctly in my view) that the performance is virtually identical..So whats the difference, well in my view one of the responses nailed it down, smack down style..Multiple JVMs:The processes share the same configuration for the entire container (notjust for the JVM parameters).Same applications, same container configuration etc.This is a great way of scaling symmetrically to better utilize the CPUs andstill only having to manage one container.Multiple OC4Js:You can individually control all of the container configurations, havedifferent applications deployed etc. You can use this strategy incombination with multiple JVMs to scale while at the same time having aheterogeneous environment wrt. nr. of applications deployed, containerconfigurations etc.So it really falls down into a how do you want to deploy your oc4j application. Now that reminds me of a different question I often get, its "How many JVMs shall I have for my application?"Now in the past the JVM had some limitations and if you had a large number of connections it was very very wise to have lots of jvms.. Nowadays the JVM has grown up and is quite a mature beast.. I remember for example 3 years ago I was working with a Israeli Consulting company and they were boasting that they had 2500 concurrent users running on a single jvm. Quite a large number it sounded but not so large when you dug a bit and discovered that the actualy pages/second wasnt huge (10's from memory) and that the clients were all effectively stateless.....So back to the original question, lets assume I have an application with say 100 users, how many JVMs, well different people have different ideas, you really need to test it, but my rule of thumb to start with is :- Minimum of two JVMs , this is to cope with JVM process failureand then add 1.2 per available extra CPU in your box, then round it up/down depending on how you feel....So a 4 CPU box would have  2+(round(3*1.2)) =  5  Now different CPUs/Operating systems/applications work differently so you always need to load test it and see what works best in your environment. Thankfully in Oracle Application Server Control its really easy to change the number of JVMs for a OC4J instance, simply navigate to the OC4J Instance / Server properties and then you'll see at the top of the page "JVM processes"Checkout this blog entryAlso dont forget the documentation!!!Oracle Application Server 10.1.3.1 Performance GuideandOracle Application Server OC4J Config. & Admin GuideEnjoy

I've recently seen an email on  our internal mail list which was entitled "Multiple JVMs vs Multiple Instances"The author of the original email was testing performance differences between multiple...

Portal Portal and Portal!

Wow, been an interesting month for me. I've just finished helping a partner of ours detail a large portal for a large customer of theirs, of particular interest was the topic of Integration with StellentAccessibilityIntegration with Content Management SystemsHere the customer already uses a content management system and doesn't want to use the built in Oracle Portal CM. This is fine!, although Oracle portal already has a CM built in , its not in the same vein as a product like Stellent which they use. Using content management systems with oracle portal is quite easy mainly due to standards in how one develops portlets (See JSR 168 & WSRP) and there is a white paper on otn describing Portals and CMS (See here)In the past if you wanted to integrate with a 3rd party CM you would have to use the Oracle Portal proprietary Java Portlet Development Kit (JPDK), since then standards like JSR 168 & WSRP have appeared and if possible I'd use them instead. However it doesn't mean JPDK is dead, I recently heard that JSR168 doesn't support AJAX  style portlets (i.e. with call backs), and our's has.  Now an easy way around this is to make the call backs go directly the provider not via the portal engine.. (see here)back to Stellent and Oracle Portal...Stellent does support JSR168/WSRP however currently these portlets are not supported/certified on Oracle Portal. Now in practice they'll probably work however since we've acquired Stellent we've been working on certifiying these portlets and enhancing them.  From my internal contacts at Oracle I've been told that the Stellent Portlets (JSR168 compliant) will be certified against Oracle Portal 10.1.4 soon.....The plan is to release and support them with the 10GR3 release of Oracle UCM , although the portlets would probably work against Stellent 7.5 but they aren't supported (beware!)AccessabilityAccessibility is all about allowing access to your website via products like JAWS,Dragon etc (These things read the website to you etc).. To validate your website you need to make sure you code the html in a clean and descriptive way. e.g. whenever you have images make sure there is an "alt" text to allow JAWS to read something out.. During my hunt for an accessible website I find , perfection is hard to find. There are tools out there like (http://webxact.watchfire.com/) which check your websites for "accessibility compliance with WACG standards etc, but the results can be misleading.. For example look at http://sacs.kennesaw.edu , its a really good example of an accessible website however even it brings out a couple of warnings/errors. If you read carefully however you'll realise that most of the errors aren't issues.. For example, Oracle Portal uses a hidden frame to do its partial page rendering, this can upset some "accessibility" testers, however if the frame is hidden, the user cant see it, doesn't know its there and JAWS simply ignores it..Another example is when you use "blank - images" to space your website out nicely, many accessibility checkers flag them too, simply because they don't have "names"... Anyway, I'm by no means an expert on this but it has been an interesting ride..Finally check these videos out, they show examples of how to access portal websites using accessible meansVideo: Low Vision User&lt;o:p>&lt;/o:p>Video:Portal and Applications Enjoy

Wow, been an interesting month for me. I've just finished helping a partner of ours detail a large portal for a large customer of theirs, of particular interest was the topic of Integration with...